mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
C-CON: fix possible crash when a CON error is raised due to access of invalid sprite.
For example, in CON_ERRPRINTF("invalid target sprite (%d) %d %d\n", iActor, vm.g_i, TrackerCast(vm.g_sp->picnum)); vm.g_i can be -1 and vm.g_sp can be NULL then. (Not anymore.) DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4709 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
8605285f7f
commit
ae63745eb3
1 changed files with 6 additions and 3 deletions
|
@ -140,9 +140,12 @@ int32_t VM_OnEvent_(int32_t iEventID, int32_t iActor, int32_t iPlayer, int32_t l
|
||||||
intptr_t *oinsptr=insptr;
|
intptr_t *oinsptr=insptr;
|
||||||
vmstate_t vm_backup;
|
vmstate_t vm_backup;
|
||||||
|
|
||||||
vmstate_t tempvm ={ iActor, iPlayer, lDist,
|
static spritetype dummy_sprite;
|
||||||
iActor >= 0 ? &actor[iActor].t_data[0] : NULL,
|
static int32_t dummy_t[ARRAY_SIZE(actor[0].t_data)];
|
||||||
iActor >= 0 ? &sprite[iActor] : NULL,
|
|
||||||
|
vmstate_t tempvm = { iActor, iPlayer, lDist,
|
||||||
|
iActor >= 0 ? &actor[iActor].t_data[0] : dummy_t,
|
||||||
|
iActor >= 0 ? &sprite[iActor] : &dummy_sprite,
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
int32_t backupReturnVar = aGameVars[g_iReturnVarID].val.lValue;
|
int32_t backupReturnVar = aGameVars[g_iReturnVarID].val.lValue;
|
||||||
|
|
Loading…
Reference in a new issue