This commit is contained in:
Christoph Oelckers 2013-08-28 11:23:00 +02:00
commit bd5777917e
6 changed files with 20 additions and 16 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

@ -150,7 +150,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_AlertMonsters)
ACTION_PARAM_FIXED(maxdist, 0); ACTION_PARAM_FIXED(maxdist, 0);
ACTION_PARAM_INT(Flags, 1); ACTION_PARAM_INT(Flags, 1);
AActor * target; AActor * target = NULL;
AActor * emitter = self; AActor * emitter = self;
if (self->player != NULL || (Flags & AMF_TARGETEMITTER)) if (self->player != NULL || (Flags & AMF_TARGETEMITTER))

View file

@ -12,7 +12,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "doomtype.h" #include "doomtype.h"
#if defined(__GNUC__) && defined(__i386__) #if defined(__GNUC__) && defined(__i386__) && !defined(__clang__)
#include "gccinlines.h" #include "gccinlines.h"
#elif defined(_MSC_VER) && defined(_M_IX86) #elif defined(_MSC_VER) && defined(_M_IX86)
#include "mscinlines.h" #include "mscinlines.h"

View file

@ -53,11 +53,6 @@
#include "r_data/r_translate.h" #include "r_data/r_translate.h"
#include "g_level.h" #include "g_level.h"
#define WATER_SINK_FACTOR 3
#define WATER_SINK_SMALL_FACTOR 4
#define WATER_SINK_SPEED (FRACUNIT/2)
#define WATER_JUMP_SPEED (FRACUNIT*7/2)
CVAR (Bool, cl_bloodsplats, true, CVAR_ARCHIVE) CVAR (Bool, cl_bloodsplats, true, CVAR_ARCHIVE)
CVAR (Int, sv_smartaim, 0, CVAR_ARCHIVE|CVAR_SERVERINFO) CVAR (Int, sv_smartaim, 0, CVAR_ARCHIVE|CVAR_SERVERINFO)
CVAR (Bool, cl_doautoaim, false, CVAR_ARCHIVE) CVAR (Bool, cl_doautoaim, false, CVAR_ARCHIVE)

View file

@ -3996,9 +3996,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++;
}
} }
} }

View file

@ -867,7 +867,7 @@ static void ParseActionDef (FScanner &sc, PClass *cls)
OPTIONAL = 1 OPTIONAL = 1
}; };
bool error = false; unsigned int error = 0;
const AFuncDesc *afd; const AFuncDesc *afd;
FName funcname; FName funcname;
FString args; FString args;
@ -876,8 +876,8 @@ static void ParseActionDef (FScanner &sc, PClass *cls)
if (sc.LumpNum == -1 || Wads.GetLumpFile(sc.LumpNum) > 0) if (sc.LumpNum == -1 || Wads.GetLumpFile(sc.LumpNum) > 0)
{ {
sc.ScriptMessage ("action functions can only be imported by internal class and actor definitions!"); sc.ScriptMessage ("Action functions can only be imported by internal class and actor definitions!");
error++; ++error;
} }
sc.MustGetToken(TK_Native); sc.MustGetToken(TK_Native);
@ -887,7 +887,7 @@ static void ParseActionDef (FScanner &sc, PClass *cls)
if (afd == NULL) if (afd == NULL)
{ {
sc.ScriptMessage ("The function '%s' has not been exported from the executable.", sc.String); sc.ScriptMessage ("The function '%s' has not been exported from the executable.", sc.String);
error++; ++error;
} }
sc.MustGetToken('('); sc.MustGetToken('(');
if (!sc.CheckToken(')')) if (!sc.CheckToken(')'))
@ -998,7 +998,7 @@ static void ParseActionDef (FScanner &sc, PClass *cls)
} }
if (error) if (error)
{ {
FScriptPosition::ErrorCounter++; FScriptPosition::ErrorCounter += error;
} }
else if (cls->Symbols.AddSymbol (sym) == NULL) else if (cls->Symbols.AddSymbol (sym) == NULL)
{ {