Skip to content

Commit

Permalink
Merge pull request #979 from klaussilveira/fix-ai
Browse files Browse the repository at this point in the history
Fix bug where NPCs do not cower when the player shoots nearby
  • Loading branch information
RobertBeckebans authored Feb 28, 2025
2 parents 502f8f7 + fe69f28 commit 1971da1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions neo/d3xp/Game_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4488,7 +4488,7 @@ void idGameLocal::AlertAI( idEntity* ent )
if( ent && ent->IsType( idActor::Type ) )
{
// alert them for the next frame
lastAIAlertTime = time + 1;
lastAIAlertTime = framenum + 1;
lastAIAlertEntity = static_cast<idActor*>( ent );
}
}
Expand All @@ -4500,14 +4500,7 @@ idGameLocal::GetAlertEntity
*/
idActor* idGameLocal::GetAlertEntity()
{
int timeGroup = 0;
if( lastAIAlertTime && lastAIAlertEntity.GetEntity() )
{
timeGroup = lastAIAlertEntity.GetEntity()->timeGroup;
}
SetTimeState ts( timeGroup );

if( lastAIAlertTime >= time )
if( lastAIAlertTime >= framenum )
{
return lastAIAlertEntity.GetEntity();
}
Expand Down

0 comments on commit 1971da1

Please sign in to comment.