mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 01:10:51 +00:00
Fix a potential issue with nested event execution
git-svn-id: https://svn.eduke32.com/eduke32@2655 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
245c8c1fef
commit
3548c50724
4 changed files with 94 additions and 92 deletions
|
@ -10895,7 +10895,7 @@ int32_t G_DoMoveThings(void)
|
||||||
if (sprite[g_player[i].ps->i].pal != 1)
|
if (sprite[g_player[i].ps->i].pal != 1)
|
||||||
sprite[g_player[i].ps->i].pal = g_player[i].pcolor;
|
sprite[g_player[i].ps->i].pal = g_player[i].pcolor;
|
||||||
|
|
||||||
G_HandleSharedKeys(i);
|
P_HandleSharedKeys(i);
|
||||||
|
|
||||||
if (ud.pause_on == 0)
|
if (ud.pause_on == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -111,6 +111,9 @@ void VM_OnEvent(register int32_t iEventID, register int32_t iActor, register int
|
||||||
iActor >= 0 ? &sprite[iActor] : NULL,
|
iActor >= 0 ? &sprite[iActor] : NULL,
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
|
int32_t backupReturnVar = aGameVars[g_iReturnVarID].val.lValue;
|
||||||
|
int32_t backupEventExec = g_currentEventExec;
|
||||||
|
|
||||||
g_currentEventExec = iEventID;
|
g_currentEventExec = iEventID;
|
||||||
insptr = apScriptGameEvent[iEventID];
|
insptr = apScriptGameEvent[iEventID];
|
||||||
|
|
||||||
|
@ -131,7 +134,8 @@ void VM_OnEvent(register int32_t iEventID, register int32_t iActor, register int
|
||||||
Bmemcpy(&vm, &vm_backup, sizeof(vmstate_t));
|
Bmemcpy(&vm, &vm_backup, sizeof(vmstate_t));
|
||||||
insptr = oinsptr;
|
insptr = oinsptr;
|
||||||
|
|
||||||
g_currentEventExec = -1;
|
g_currentEventExec = backupEventExec;
|
||||||
|
aGameVars[g_iReturnVarID].val.lValue = backupReturnVar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2468,7 +2468,7 @@ void allignwarpelevators(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_HandleSharedKeys(int32_t snum)
|
void P_HandleSharedKeys(int32_t snum)
|
||||||
{
|
{
|
||||||
int32_t i, k = 0, dainv;
|
int32_t i, k = 0, dainv;
|
||||||
uint32_t sb_snum = g_player[snum].sync->bits, j;
|
uint32_t sb_snum = g_player[snum].sync->bits, j;
|
||||||
|
@ -2618,11 +2618,9 @@ void G_HandleSharedKeys(int32_t snum)
|
||||||
return; // is there significance to returning?
|
return; // is there significance to returning?
|
||||||
}
|
}
|
||||||
if (p->refresh_inventory)
|
if (p->refresh_inventory)
|
||||||
{
|
|
||||||
sb_snum |= BIT(SK_INV_LEFT); // emulate move left...
|
sb_snum |= BIT(SK_INV_LEFT); // emulate move left...
|
||||||
}
|
|
||||||
if (p->newowner == -1)
|
if (p->newowner == -1 && (TEST_SYNC_KEY(sb_snum, SK_INV_LEFT) || TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT)))
|
||||||
if (TEST_SYNC_KEY(sb_snum, SK_INV_LEFT) || TEST_SYNC_KEY(sb_snum, SK_INV_RIGHT))
|
|
||||||
{
|
{
|
||||||
p->invdisptime = GAMETICSPERSEC*2;
|
p->invdisptime = GAMETICSPERSEC*2;
|
||||||
|
|
||||||
|
|
|
@ -111,12 +111,12 @@ int32_t G_ActivateWarpElevators(int32_t s,int32_t d);
|
||||||
int32_t G_CheckActivatorMotion(int32_t lotag);
|
int32_t G_CheckActivatorMotion(int32_t lotag);
|
||||||
extern inline int32_t G_CheckPlayerInSector(int32_t sect);
|
extern inline int32_t G_CheckPlayerInSector(int32_t sect);
|
||||||
void G_DoSectorAnimations(void);
|
void G_DoSectorAnimations(void);
|
||||||
void G_HandleSharedKeys(int32_t snum);
|
|
||||||
void G_OperateActivators(int32_t low,int32_t snum);
|
void G_OperateActivators(int32_t low,int32_t snum);
|
||||||
void G_OperateForceFields(int32_t s,int32_t low);
|
void G_OperateForceFields(int32_t s,int32_t low);
|
||||||
void G_OperateMasterSwitches(int32_t low);
|
void G_OperateMasterSwitches(int32_t low);
|
||||||
void G_OperateRespawns(int32_t low);
|
void G_OperateRespawns(int32_t low);
|
||||||
void G_OperateSectors(int32_t sn,int32_t ii);
|
void G_OperateSectors(int32_t sn,int32_t ii);
|
||||||
|
void P_HandleSharedKeys(int32_t snum);
|
||||||
int32_t GetAnimationGoal(const int32_t *animptr);
|
int32_t GetAnimationGoal(const int32_t *animptr);
|
||||||
int32_t isanearoperator(int32_t lotag);
|
int32_t isanearoperator(int32_t lotag);
|
||||||
int32_t isanunderoperator(int32_t lotag);
|
int32_t isanunderoperator(int32_t lotag);
|
||||||
|
|
Loading…
Reference in a new issue