Skip to content

Commit

Permalink
- Exhumed: Bring player neartag() call to branch where it's needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Mar 24, 2023
1 parent ed2c557 commit 611d7ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/games/exhumed/src/player.cpp
Expand Up @@ -1327,12 +1327,6 @@ void AIPlayer::Tick(RunListEvent* ev)
pFloorActor->spr.pos.Z = pPlayerActor->sector()->floorz;
}

// code to handle item pickup?
HitInfo near;

// neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value.
neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.Angles.Yaw, near, 128., NT_Hitag | NT_NoSpriteCheck);

doPlayerItemPickups(pPlayer);

// CORRECT ? // loc_1BAF9:
Expand Down Expand Up @@ -1363,6 +1357,12 @@ void AIPlayer::Tick(RunListEvent* ev)
{
pPlayer->input.actions &= ~SB_OPEN;

// code to handle item pickup?
HitInfo near;

// neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value.
neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.Angles.Yaw, near, 128., NT_Hitag | NT_NoSpriteCheck);

int tag;
if (near.hitWall != nullptr && (tag = near.hitWall->lotag) > 0)
{
Expand Down

0 comments on commit 611d7ba

Please sign in to comment.