diff --git a/source/games/duke/src/global.cpp b/source/games/duke/src/global.cpp index fd61e656f..d1b7ec87c 100644 --- a/source/games/duke/src/global.cpp +++ b/source/games/duke/src/global.cpp @@ -85,8 +85,6 @@ int rtsplaying; // RTS playback state TArray mspos; TArray animates; -bool sound445done; // used in checksectors_r. This was local state inside a function, but this must be maintained globally and serialized - int spriteqamount = 64; // internal sprite queue int spriteqloc; animwalltype animwall[MAXANIMWALLS]; // animated walls diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index ad61e5fea..bbbf662ac 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -65,7 +65,6 @@ extern int screenpeek; // Variables that must be saved extern int rtsplaying; -extern bool sound445done; extern player_struct ps[MAXPLAYERS]; extern int spriteqamount; extern int lastvisinc; diff --git a/source/games/duke/src/namelist_r.h b/source/games/duke/src/namelist_r.h index 19b754447..6b3ee2d7a 100644 --- a/source/games/duke/src/namelist_r.h +++ b/source/games/duke/src/namelist_r.h @@ -681,8 +681,8 @@ y(RRTILE2075, 2075) y(RRTILE2083, 2083) x(VIXENSHOT, 2095) y(RRTILE2097, 2097) -y(RRTILE2121, 2121) -y(RRTILE2122, 2122) +y(TOILETSEAT, 2121) +y(TOILET2, 2122) y(RRTILE2123, 2123) y(RRTILE2124, 2124) y(RRTILE2125, 2125) @@ -1341,7 +1341,7 @@ y(RRTILE8397, 8397) y(RRTILE8398, 8398) y(RRTILE8399, 8399) y(RRTILE8423, 8423) -y(RRTILE8448, 8448) +y(MUSICNOTES, 8448) y(AIRPLANE, 8450) x(BOATAMMO, 8460) y(RRTILE8461, 8461) @@ -1397,7 +1397,7 @@ y(SNAKERIVERSIGNB, 8680) y(RRTILE8681, 8681) y(RRTILE8682, 8682) y(RRTILE8683, 8683) -y(RRTILE8704, 8704) +y(JOE9000, 8704) x(BOULDER, 256) x(BOULDER1, 264) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index dbc495fdc..87b96cd41 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3357,7 +3357,7 @@ void processinput_r(int snum) else p->stairs--; } - else if (clz.actor()->spr.picnum == TOILET || clz.actor()->spr.picnum == RRTILE2121) + else if (clz.actor()->spr.picnum == TOILET || clz.actor()->spr.picnum == TOILETSEAT) { if ((actions & SB_CROUCH) && !p->OnMotorcycle) //if (Sound[436].num == 0) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 4237281f0..6c7614285 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -427,6 +427,7 @@ void resetprestat(int snum,int g) animates.Clear(); camsprite =nullptr; ud.earthquaketime = 0; + ud.joe9000 = false; WindTime = 0; WindDir = nullAngle; diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index c51421e69..84f029724 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -63,8 +63,8 @@ static void cachespritenum(DDukeActor* actor) for (j = TOILETWATER; j < (TOILETWATER + 4); j++) tloadtile(j, pal); break; - case RRTILE2121: - case RRTILE2122: + case TOILETSEAT: + case TOILET2: tloadtile(actor->spr.picnum, pal); break; case TOILET: diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index d09865555..904053ccd 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -366,7 +366,7 @@ void GameInterface::SerializeGameState(FSerializer& arc) ("rtsplaying", rtsplaying) //("tempwallptr", tempwallptr) - ("sound445done", sound445done) + ("joe9000", ud.joe9000) .Array("players", ps, ud.multimode) ("spriteqamount", spriteqamount) ("lastvisinc", lastvisinc) diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index b99f8f22c..370740033 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -1615,20 +1615,20 @@ void checksectors_r(int snum) else switch (neartagsprite->spr.picnum) { - case RRTILE8448: + case MUSICNOTES: if (!isRRRA()) return; if (!S_CheckActorSoundPlaying(neartagsprite, 340)) S_PlayActorSound(340, neartagsprite); return; - case RRTILE8704: + case JOE9000: if (!isRRRA()) return; if (numplayers == 1) { // This is from RedneckGDX - the version in RR Reconstruction looked like broken nonsense. - if (S_CheckActorSoundPlaying(neartagsprite, 445) || sound445done != 0) + if (S_CheckActorSoundPlaying(neartagsprite, 445) || ud.joe9000 != 0) { if (!S_CheckActorSoundPlaying(neartagsprite, 445) && !S_CheckActorSoundPlaying(neartagsprite, 446) && - !S_CheckActorSoundPlaying(neartagsprite, 447) && sound445done != 0) + !S_CheckActorSoundPlaying(neartagsprite, 447) && ud.joe9000 != 0) { if ((krand() % 2) == 1) S_PlayActorSound(446, neartagsprite); @@ -1639,7 +1639,7 @@ void checksectors_r(int snum) else { S_PlayActorSound(445, neartagsprite); - sound445done = 1; + ud.joe9000 = 1; } } return; @@ -1654,8 +1654,8 @@ void checksectors_r(int snum) case TOILET: case STALL: - case RRTILE2121: - case RRTILE2122: + case TOILETSEAT: + case TOILET2: if (p->last_pissed_time == 0) { S_PlayActorSound(435, pact); diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 2566368ba..f29dd252f 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -66,12 +66,12 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.scale = DVector2(0, 0); ps[screenpeek].sea_sick_stat = 1; break; - case RRTILE8448: + case MUSICNOTES: if (!isRRRA()) goto default_case; act->spr.lotag = 1; act->clipdist = 0; break; - case RRTILE8704: + case JOE9000: if (!isRRRA()) goto default_case; act->spr.lotag = 1; act->clipdist = 0; @@ -750,8 +750,8 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case TOILET: case STALL: - case RRTILE2121: - case RRTILE2122: + case TOILETSEAT: + case TOILET2: act->spr.lotag = 1; act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; act->clipdist = 2; diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 6712d2c43..d079059b6 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -165,6 +165,7 @@ struct user_defs int player_skill, marker; int chickenplant; // readonly - used to trigger some special behavior if a special item is found in a map. int earthquaketime; + bool joe9000; // this was formerly a static local variable inside a function, but needs to be properly maintained and serialized. TObjPtr cameraactor; diff --git a/source/games/duke/src/vmexports.cpp b/source/games/duke/src/vmexports.cpp index 565a3039e..a39cda4eb 100644 --- a/source/games/duke/src/vmexports.cpp +++ b/source/games/duke/src/vmexports.cpp @@ -1446,6 +1446,7 @@ DEFINE_FIELD_X(DukeUserDefs, user_defs, cameraactor); DEFINE_FIELD_X(DukeUserDefs, user_defs, chickenplant); DEFINE_FIELD_X(DukeUserDefs, user_defs, earthquaketime); DEFINE_FIELD_X(DukeUserDefs, user_defs, ufospawnsminion); +DEFINE_FIELD_X(DukeUserDefs, user_defs, joe9000); DEFINE_GLOBAL_UNSIZED(ud) diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index 85d5b1f6f..137351fe1 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -462,4 +462,5 @@ struct DukeUserDefs native native uint8 ufospawnsminion; native int16 bomb_tag; native DukeActor cameraactor; + native bool joe9000; }