mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-13 22:22:05 +00:00
Fixed AI not being alerted. Fixes bug where NPCs did not cower when the player shot near them.
This commit is contained in:
parent
15be4c61ff
commit
fe69f28404
1 changed files with 2 additions and 9 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue