From 5079d6c505a85c83cab04df23d811997fb78f66f Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Tue, 27 Aug 2013 20:28:38 -0400 Subject: [PATCH 1/4] - Fixed: clang 32-bit compile (I hear it still doesn't run though). - Applied edward's patch to remove boolean increment. --- src/m_fixed.h | 2 +- src/thingdef/thingdef_parse.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/m_fixed.h b/src/m_fixed.h index 61080d73d..71b398124 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -12,7 +12,7 @@ #include #include "doomtype.h" -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && defined(__i386__) && !defined(__clang__) #include "gccinlines.h" #elif defined(_MSC_VER) && defined(_M_IX86) #include "mscinlines.h" diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index c065dfbe0..498003b4e 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -867,7 +867,7 @@ static void ParseActionDef (FScanner &sc, PClass *cls) OPTIONAL = 1 }; - bool error = false; + unsigned int error = 0; const AFuncDesc *afd; FName funcname; FString args; @@ -876,8 +876,8 @@ static void ParseActionDef (FScanner &sc, PClass *cls) if (sc.LumpNum == -1 || Wads.GetLumpFile(sc.LumpNum) > 0) { - sc.ScriptMessage ("action functions can only be imported by internal class and actor definitions!"); - error++; + sc.ScriptMessage ("Action functions can only be imported by internal class and actor definitions!"); + ++error; } sc.MustGetToken(TK_Native); @@ -887,7 +887,7 @@ static void ParseActionDef (FScanner &sc, PClass *cls) if (afd == NULL) { sc.ScriptMessage ("The function '%s' has not been exported from the executable.", sc.String); - error++; + ++error; } sc.MustGetToken('('); if (!sc.CheckToken(')')) @@ -998,7 +998,7 @@ static void ParseActionDef (FScanner &sc, PClass *cls) } if (error) { - FScriptPosition::ErrorCounter++; + FScriptPosition::ErrorCounter += error; } else if (cls->Symbols.AddSymbol (sym) == NULL) { From 0a16e9a2562cb560a5459c52d6ee42d8685447f4 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Tue, 27 Aug 2013 20:42:35 -0400 Subject: [PATCH 2/4] - Fixed uninitialized variable in A_AlertMonsters. --- src/g_strife/a_strifeweapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index d37f0ea5a..a41058492 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -150,7 +150,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_AlertMonsters) ACTION_PARAM_FIXED(maxdist, 0); ACTION_PARAM_INT(Flags, 1); - AActor * target; + AActor * target = NULL; AActor * emitter = self; if (self->player != NULL || (Flags & AMF_TARGETEMITTER)) From f8899f98fcb523a4e78fc739faacc81c0f8e216c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 28 Aug 2013 11:14:48 +0200 Subject: [PATCH 3/4] - fixed: The secret counter was not incremented for items that had the UDMF COUNTSECRET flag set. --- src/g_shared/a_randomspawner.cpp | 9 +++++++-- src/p_mobj.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index 293b17d3b..adfc09b6e 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -121,7 +121,11 @@ class ARandomSpawner : public AActor AActor * newmobj = NULL; bool boss = false; Super::PostBeginPlay(); - if (Species == NAME_None) { Destroy(); return; } + if (Species == NAME_None) + { + Destroy(); + return; + } const PClass * cls = PClass::FindClass(Species); 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->special1 = special1; 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->SpawnFlags = SpawnFlags; newmobj->tid = tid; newmobj->AddToHash(); newmobj->velx = velx; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 14607a682..03bbb4d8d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3993,8 +3993,12 @@ void AActor::HandleSpawnFlags () } if (SpawnFlags & MTF_SECRET) { - //Printf("Secret %s in sector %i!\n", GetTag(), Sector->sectornum); - flags5 |= MF5_COUNTSECRET; + if (!(flags5 & MF5_COUNTSECRET)) + { + //Printf("Secret %s in sector %i!\n", GetTag(), Sector->sectornum); + flags5 |= MF5_COUNTSECRET; + level.total_secrets++; + } } } From 26c381224c9cd3a06f4c4836640c142cd3d1d071 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 28 Aug 2013 11:16:30 +0200 Subject: [PATCH 4/4] - removed unused constants in p_map.cpp. --- src/p_map.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index da87481d0..8b0b605c6 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -53,11 +53,6 @@ #include "r_data/r_translate.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 (Int, sv_smartaim, 0, CVAR_ARCHIVE|CVAR_SERVERINFO) CVAR (Bool, cl_doautoaim, false, CVAR_ARCHIVE)