Asserts for some hard-to-detect bugs.
This commit is contained in:
parent
404ad8c722
commit
615b35ec26
6 changed files with 33 additions and 10 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.10 r3 \cu(Sun 17 Apr 19:51:50 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.2.10 r3 \cu(2022-04-17 19:51:50)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.10 r4 \cu(Sun 17 Apr 19:52:07 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.2.10 r4 \cu(2022-04-17 19:52:07)\c-";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Custom intermission screens
|
||||
Class SWWMStatScreenData : Thinker
|
||||
Class SWWMStatScreenData : SWWMStaticThinker
|
||||
{
|
||||
// to prevent repetition
|
||||
Array<int> lasttip, lastart;
|
||||
|
|
|
|||
|
|
@ -471,6 +471,9 @@ Class Demolitionist : PlayerPawn
|
|||
}
|
||||
oldsinglefirst = swwm_singlefirst; // super already sets up the slots, so save the cvar value now
|
||||
mystats = SWWMStats.Find(player);
|
||||
// sanity checks
|
||||
if ( !EventHandler.Find("SWWMHandler") || !StaticEventHandler.Find("SWWMStaticHandler") )
|
||||
ThrowAbortException("Panic! SWWM event handlers not detected!");
|
||||
}
|
||||
void A_Dash()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Static handler responsible for some special stuff
|
||||
|
||||
// save version holder
|
||||
Class SWWMSaveVerData : Thinker
|
||||
Class SWWMSaveVerData : SWWMStaticThinker
|
||||
{
|
||||
String ver;
|
||||
}
|
||||
|
|
@ -22,6 +22,8 @@ Class SWWMStaticHandler : StaticEventHandler
|
|||
bool titlefirst;
|
||||
// warnings
|
||||
bool mpwarned;
|
||||
// checks
|
||||
ThinkerIterator sti;
|
||||
|
||||
override void NewGame()
|
||||
{
|
||||
|
|
@ -47,6 +49,17 @@ Class SWWMStaticHandler : StaticEventHandler
|
|||
Console.Printf("\cgWARNING:\c- Multiplayer is no longer officially supported, desyncs and other issues may potentially happen. You are on your own.");
|
||||
S_StartSound("compat/warn",CHAN_YOUDONEFUCKEDUP,CHANF_UI|CHANF_NOPAUSE|CHANF_OVERLAP,1,ATTN_NONE);
|
||||
}
|
||||
// sanity check
|
||||
Array<Thinker> stinkers;
|
||||
if ( !sti ) sti = ThinkerIterator.Create("SWWMStaticThinker");
|
||||
else sti.Reinit();
|
||||
Thinker t;
|
||||
while ( t = sti.Next() ) stinkers.Push(t);
|
||||
if ( stinkers.Size() > 0 )
|
||||
{
|
||||
for ( int i=0; i<stinkers.Size(); i++ ) Console.Printf("%s is not STAT_STATIC!",stinkers[i].GetClassName());
|
||||
ThrowAbortException("Panic! %d static thinker%s been tampered with!",stinkers.Size(),(stinkers.Size()==1)?" has":"s have");
|
||||
}
|
||||
}
|
||||
|
||||
override void WorldLoaded( WorldEvent e )
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ Class LIEntry
|
|||
Color mapcolor;
|
||||
}
|
||||
|
||||
Class SWWMCachedLockInfo : Thinker
|
||||
Class SWWMCachedLockInfo : SWWMStaticThinker
|
||||
{
|
||||
Array<LIEntry> ent;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
// player-specific thinkers
|
||||
|
||||
Class SWWMStaticThinker : Thinker abstract
|
||||
{
|
||||
// shell class to iterate easier on sanity checks
|
||||
// all subclasses should be guaranteed to have a statnum of STAT_STATIC
|
||||
// if they don't, something is very wrong
|
||||
}
|
||||
|
||||
// "Full History" contains all messages since session start, nothing is flushed
|
||||
// this can be accessed from a section of the knowledge base
|
||||
Class SWWMFullHistory : Thinker
|
||||
Class SWWMFullHistory : SWWMStaticThinker
|
||||
{
|
||||
String lastmap;
|
||||
Array<MsgLine> msg;
|
||||
|
|
@ -40,7 +47,7 @@ Class SWWMFullHistory : Thinker
|
|||
}
|
||||
|
||||
// Dedicated mission log (for custom maps)
|
||||
Class SWWMMissionLog : Thinker
|
||||
Class SWWMMissionLog : SWWMStaticThinker
|
||||
{
|
||||
Array<String> entries;
|
||||
bool clockset;
|
||||
|
|
@ -107,7 +114,7 @@ Class LevelStat
|
|||
int time, par, suck;
|
||||
}
|
||||
|
||||
Class SWWMStats : Thinker
|
||||
Class SWWMStats : SWWMStaticThinker
|
||||
{
|
||||
PlayerInfo myplayer;
|
||||
int lastspawn, dashcount, boostcount, stompcount, airtime, kills,
|
||||
|
|
@ -289,7 +296,7 @@ Class SWWMStats : Thinker
|
|||
}
|
||||
|
||||
// Scoring
|
||||
Class SWWMCredits : Thinker
|
||||
Class SWWMCredits : SWWMStaticThinker
|
||||
{
|
||||
PlayerInfo myplayer;
|
||||
int credits;
|
||||
|
|
@ -367,7 +374,7 @@ Class SWWMLore
|
|||
bool read;
|
||||
}
|
||||
|
||||
Class SWWMLoreLibrary : Thinker
|
||||
Class SWWMLoreLibrary : SWWMStaticThinker
|
||||
{
|
||||
PlayerInfo myplayer;
|
||||
Array<SWWMLore> ent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue