- fixed: The secret counter was not incremented for items that had the UDMF COUNTSECRET flag set.

This commit is contained in:
Christoph Oelckers 2013-08-28 11:14:48 +02:00
parent 5079d6c505
commit f8899f98fc
2 changed files with 13 additions and 4 deletions

View File

@ -121,7 +121,11 @@ class ARandomSpawner : public AActor
AActor * newmobj = NULL; AActor * newmobj = NULL;
bool boss = false; bool boss = false;
Super::PostBeginPlay(); Super::PostBeginPlay();
if (Species == NAME_None) { Destroy(); return; } if (Species == NAME_None)
{
Destroy();
return;
}
const PClass * cls = PClass::FindClass(Species); const PClass * cls = PClass::FindClass(Species);
if (this->flags & MF_MISSILE && target && target->target) // Attempting to spawn a missile. if (this->flags & MF_MISSILE && target && target->target) // Attempting to spawn a missile.
{ {
@ -142,8 +146,9 @@ class ARandomSpawner : public AActor
newmobj->args[4] = args[4]; newmobj->args[4] = args[4];
newmobj->special1 = special1; newmobj->special1 = special1;
newmobj->special2 = special2; newmobj->special2 = special2;
newmobj->SpawnFlags = SpawnFlags; newmobj->SpawnFlags = SpawnFlags & ~MTF_SECRET; // MTF_SECRET needs special treatment to avoid incrementing the secret counter twice. It had already been processed for the spawner itself.
newmobj->HandleSpawnFlags(); newmobj->HandleSpawnFlags();
newmobj->SpawnFlags = SpawnFlags;
newmobj->tid = tid; newmobj->tid = tid;
newmobj->AddToHash(); newmobj->AddToHash();
newmobj->velx = velx; newmobj->velx = velx;

View File

@ -3992,9 +3992,13 @@ void AActor::HandleSpawnFlags ()
RenderStyle = STYLE_None; RenderStyle = STYLE_None;
} }
if (SpawnFlags & MTF_SECRET) if (SpawnFlags & MTF_SECRET)
{
if (!(flags5 & MF5_COUNTSECRET))
{ {
//Printf("Secret %s in sector %i!\n", GetTag(), Sector->sectornum); //Printf("Secret %s in sector %i!\n", GetTag(), Sector->sectornum);
flags5 |= MF5_COUNTSECRET; flags5 |= MF5_COUNTSECRET;
level.total_secrets++;
}
} }
} }