- Converted the mace and all related actors to DECORATE and generalized

the spawn function that only spawns one mace per level.
- Moved Mace respawning code into AInventory so that it works properly
  for replacement actors.


SVN r1107 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-03 19:10:48 +00:00
commit affd0e5034
11 changed files with 291 additions and 282 deletions

View file

@ -14,6 +14,7 @@
#include "templates.h"
#include "a_strifeglobal.h"
#include "a_morph.h"
#include "a_specialspot.h"
static FRandom pr_restore ("RestorePos");
@ -489,7 +490,7 @@ void AInventory::Tick ()
void AInventory::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << Owner << Amount << MaxAmount << RespawnTics << ItemFlags << Icon << PickupSound;
arc << Owner << Amount << MaxAmount << RespawnTics << ItemFlags << Icon << PickupSound << SpawnPointClass;
}
//===========================================================================
@ -1168,6 +1169,18 @@ END_DEFAULTS
bool AInventory::DoRespawn ()
{
if (SpawnPointClass != NULL)
{
AActor *spot = NULL;
DSpotState *state = DSpotState::GetSpotState();
if (state != NULL) spot = state->GetRandomSpot(SpawnPointClass);
if (spot != NULL)
{
SetOrigin (spot->x, spot->y, spot->z);
z = floorz;
}
}
return true;
}