Chanceboxes and collectibles shouldn't appear in DM.

This commit is contained in:
Mari the Deer 2021-05-23 19:12:56 +02:00
commit 9e00ee41ae
4 changed files with 13 additions and 13 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r505 \cu(Sun 23 May 14:05:28 CEST 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r505 \cu(2021-05-23 14:05:28)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r506 \cu(Sun 23 May 19:12:56 CEST 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r506 \cu(2021-05-23 19:12:56)\c-";

View file

@ -271,7 +271,7 @@ extend Class SWWMHandler
SWWMInterest.Spawn(lpos,theline:l);
}
// spawn loot
Chancebox.SpawnChanceboxes();
if ( !deathmatch ) Chancebox.SpawnChanceboxes();
// list map keys
let ti = ThinkerIterator.Create("Key");
Key k;

View file

@ -46,17 +46,11 @@ Class SWWMCollectible : Inventory abstract
if ( (avail == AVAIL_Hexen) && (gameinfo.gametype&GAME_Hexen) ) return true;
return false;
}
override void PostBeginPlay()
override bool ShouldSpawn()
{
Super.PostBeginPlay();
// delet ourselves if wrong iwad
if ( !ValidGame() ) Destroy();
}
override bool CanPickup( Actor toucher )
{
// no pickup if wrong iwad
if ( !ValidGame() ) return false;
return Super.CanPickup(toucher);
// don't spawn in-game if on deathmatch or the wrong IWAD
if ( deathmatch || !ValidGame() ) return false;
return true;
}
override string PickupMessage()
{

View file

@ -716,6 +716,12 @@ Class ChanceboxSpawner : Actor
{
override void PostBeginPlay()
{
if ( deathmatch )
{
// not in DM
Destroy();
return;
}
int numbox = 0;
let ti = ThinkerIterator.Create("ChanceboxSpawner");
while ( ti.Next() ) numbox++;