Call Director.Unpause() to execute running scripts

This commit is contained in:
smallmodel 2023-08-12 03:03:48 +02:00
parent ec3259271e
commit 77a9cd5a9a
No known key found for this signature in database
GPG key ID: A96F163ED4891440
5 changed files with 9 additions and 27 deletions

View file

@ -4512,12 +4512,8 @@ void Actor::UpdateAnim
Com_Printf("ChangeAnim\n");
ChangeAnim();
}
Director.iPaused--;
if (!Director.iPaused)
{
Director.ExecuteRunning();
}
Director.iPaused++;
Director.Unpause();
Director.Pause();
if (m_csSayAnim != STRING_EMPTY)
{
@ -5534,9 +5530,7 @@ void Actor::Think
m_bNeedReload = false;
mbBreakSpecialAttack = false;
Director.iPaused--;
if (!Director.iPaused)
Director.ExecuteRunning();
Director.Unpause();
//gi.DPrintf("Actor::Think 5: entnum %d, classname: %s\n", entnum, G_GetEntity(0) ? G_GetEntity(0)->getClassname() : "");
}
@ -8234,13 +8228,9 @@ void Actor::IdleTurn
SafePtr<SimpleEntity> prevTurnEntity = m_pTurnEntity;
Director.iPaused--;
if (!Director.iPaused)
{
Director.ExecuteRunning();
}
Director.Unpause();
Unregister(STRING_TURNDONE);
Director.iPaused++;
Director.Pause();
if (m_pTurnEntity == prevTurnEntity)

View file

@ -545,14 +545,8 @@ void G_RunFrame( int levelTime, int frameTime )
}
}
Director.iPaused--;
g_iInThinks++;
if( !Director.iPaused )
{
Director.ExecuteRunning();
}
Director.Unpause();
g_iInThinks--;
// Process any pending events that got posted during the script code

View file

@ -1218,9 +1218,7 @@ void Level::ServerSpawned(void)
ent->entity->Unregister(STRING_SPAWN);
}
if (Director.iPaused-- == 1) {
Director.ExecuteRunning();
}
Director.Unpause();
Unregister(STRING_SPAWN);
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.