Fix instances reverted to old unlocked variable

This commit is contained in:
Sally Coolatta 2022-10-12 01:18:02 -04:00
parent d751ad5cf2
commit 29f55471dd
2 changed files with 6 additions and 10 deletions

View file

@ -79,9 +79,9 @@ static UINT8 cheatf_warp(void)
// Temporarily unlock stuff. // Temporarily unlock stuff.
G_SetUsedCheats(false); G_SetUsedCheats(false);
unlockables[31].unlocked = true; // credits clientGamedata->unlocked[31] = true; // credits
unlockables[30].unlocked = true; // sound test clientGamedata->unlocked[30] = true; // sound test
unlockables[28].unlocked = true; // level select clientGamedata->unlocked[28] = true; // level select
// Refresh secrets menu existing. // Refresh secrets menu existing.
M_ClearMenus(true); M_ClearMenus(true);

View file

@ -1795,9 +1795,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
{ // Unlockable triggers required { // Unlockable triggers required
INT32 trigid = triggerline->args[1]; INT32 trigid = triggerline->args[1];
if (netgame || multiplayer) if (trigid < 0 || trigid > 31) // limited by 32 bit variable
return false;
else if (trigid < 0 || trigid > 31) // limited by 32 bit variable
{ {
CONS_Debug(DBG_GAMELOGIC, "Unlockable trigger (sidedef %hu): bad trigger ID %d\n", triggerline->sidenum[0], trigid); CONS_Debug(DBG_GAMELOGIC, "Unlockable trigger (sidedef %hu): bad trigger ID %d\n", triggerline->sidenum[0], trigid);
return false; return false;
@ -1810,14 +1808,12 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
{ // An unlockable itself must be unlocked! { // An unlockable itself must be unlocked!
INT32 unlockid = triggerline->args[1]; INT32 unlockid = triggerline->args[1];
if (netgame || multiplayer) if (unlockid < 0 || unlockid >= MAXUNLOCKABLES) // limited by unlockable count
return false;
else if (unlockid < 0 || unlockid >= MAXUNLOCKABLES) // limited by unlockable count
{ {
CONS_Debug(DBG_GAMELOGIC, "Unlockable check (sidedef %hu): bad unlockable ID %d\n", triggerline->sidenum[0], unlockid); CONS_Debug(DBG_GAMELOGIC, "Unlockable check (sidedef %hu): bad unlockable ID %d\n", triggerline->sidenum[0], unlockid);
return false; return false;
} }
else if (!(unlockables[unlockid-1].unlocked)) else if (!(serverGamedata->unlocked[unlockid-1]))
return false; return false;
} }
break; break;