diff --git a/language.version b/language.version index 3ea4b938a..2ea03bc87 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r270 \cu(Sat 13 Feb 22:31:30 CET 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r270 \cu(2021-02-13 22:31:30)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r271 \cu(Sun 14 Feb 17:46:54 CET 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r271 \cu(2021-02-14 17:46:54)\c-"; diff --git a/zscript/swwm_handler.zsc b/zscript/swwm_handler.zsc index b56e7e5f3..68c1c2064 100644 --- a/zscript/swwm_handler.zsc +++ b/zscript/swwm_handler.zsc @@ -295,6 +295,11 @@ Class SWWMHandler : EventHandler bool nugflip; // h/a nugget flip-flop spawn counter + // stuff to reduce worldthingspawned overhead + int bossmap; + int iwantdie; + int indoomvacation; + enum EVanillaMap { MAP_NONE, @@ -582,6 +587,10 @@ Class SWWMHandler : EventHandler { // oneliner RNG must be relative to consoleplayer SetRandomSeed[DemoLines](Random[DemoLines]()+consoleplayer+MSTime()); + // "uninitialize" some vars + iwantdie = -1; + bossmap = -1; + indoomvacation = -1; } private static Vector3 UseLinePos( Line l ) @@ -1770,7 +1779,8 @@ Class SWWMHandler : EventHandler override void WorldThingSpawned( WorldEvent e ) { // I WANT DIE - if ( G_SkillName() == StringTable.Localize("$SWWM_SKLUNATIC") ) + if ( iwantdie == -1 ) iwantdie = (G_SkillName() == StringTable.Localize("$SWWM_SKLUNATIC")); + if ( iwantdie ) { if ( e.Thing.bMISSILE && !e.Thing.FindInventory("DontDuplicate") && !e.Thing.IsZeroDamage() && (e.Thing.target && e.Thing.target.bISMONSTER && !e.Thing.target.player) ) { @@ -1836,6 +1846,7 @@ Class SWWMHandler : EventHandler DoKeyTagFix(e.Thing); SWWMInterest.Spawn(thekey:Key(e.Thing)); } + if ( indoomvacation == -1 ) indoomvacation = SWWMUtility.InDoomVacation(); if ( e.Thing.GetClass() == 'Pig' ) e.Thing.SetTag("$FN_PIG"); // missing in gzdoom // eviternity stuff @@ -1862,7 +1873,7 @@ Class SWWMHandler : EventHandler //e.Thing.Obituary = "$OB_NDEMON"; } // doom vacation stuff - else if ( SWWMUtility.InDoomVacation() ) + else if ( indoomvacation ) { if ( e.Thing.GetClassName() == "Babe" ) { @@ -1979,7 +1990,7 @@ Class SWWMHandler : EventHandler e.Thing.bNOBLOOD = true; // vanilla boss stuff bool upgrademe = swwm_upgradebosses; - int bossmap = WhichVanillaBossMap(); + if ( bossmap == -1 ) bossmap = WhichVanillaBossMap(); if ( bossmap == MAP_DE1M8 ) { if ( e.Thing is 'BaronOfHell' ) @@ -2356,8 +2367,6 @@ Class SWWMHandler : EventHandler e.Replacee = 'Sorcerer2'; } - - override void CheckReplacement( ReplaceEvent e ) { // respect final replacements