This commit is contained in:
Christoph Oelckers 2015-02-10 20:25:55 +01:00
commit e49572b713
27 changed files with 119 additions and 93 deletions

View file

@ -1234,16 +1234,9 @@ void AM_initVariables ()
for (pnum=0;pnum<MAXPLAYERS;pnum++) for (pnum=0;pnum<MAXPLAYERS;pnum++)
if (playeringame[pnum]) if (playeringame[pnum])
break; break;
// [ZzZombo] no access out of bounds. assert(pnum >= 0 && pnum < MAXPLAYERS);
if(pnum>=MAXPLAYERS) m_x = (players[pnum].camera->x >> FRACTOMAPBITS) - m_w/2;
{ m_y = (players[pnum].camera->y >> FRACTOMAPBITS) - m_h/2;
m_x=m_y=0;
}
else
{
m_x = (players[pnum].camera->x >> FRACTOMAPBITS) - m_w/2;
m_y = (players[pnum].camera->y >> FRACTOMAPBITS) - m_h/2;
}
AM_changeWindowLoc(); AM_changeWindowLoc();
// for saving & restoring // for saving & restoring

View file

@ -61,8 +61,8 @@ void DBot::Serialize (FArchive &arc)
if (SaveVersion < 4515) if (SaveVersion < 4515)
{ {
angle_t savedyaw=0; angle_t savedyaw;
int savedpitch=0; int savedpitch;
arc << savedyaw arc << savedyaw
<< savedpitch; << savedpitch;
} }

View file

@ -439,7 +439,7 @@ static BYTE HexToByte (const char *hex)
UCVarValue FBaseCVar::FromString (const char *value, ECVarType type) UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
{ {
UCVarValue ret; UCVarValue ret;
int i=0; int i;
switch (type) switch (type)
{ {
@ -475,8 +475,11 @@ UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
// 0 1 2 3 // 0 1 2 3
ret.pGUID = NULL; ret.pGUID = NULL;
if(value) if (value == NULL)
for (; i < 38; i++) {
break;
}
for (i = 0; value[i] != 0 && i < 38; i++)
{ {
switch (i) switch (i)
{ {
@ -1685,7 +1688,7 @@ void FBaseCVar::ListVars (const char *filter, bool plain)
flags & CVAR_MOD ? 'M' : ' ', flags & CVAR_MOD ? 'M' : ' ',
flags & CVAR_IGNORE ? 'X' : ' ', flags & CVAR_IGNORE ? 'X' : ' ',
var->GetName(), var->GetName(),
var->GetGenericRep (CVAR_String).String); var->GetGenericRep(CVAR_String).String);
} }
} }
var = var->m_Next; var = var->m_Next;

View file

@ -20,11 +20,11 @@ struct FCompatValues
struct FMD5HashTraits struct FMD5HashTraits
{ {
hash_t Hash(const FMD5Holder &key) hash_t Hash(const FMD5Holder key)
{ {
return key.Hash; return key.Hash;
} }
int Compare(const FMD5Holder &left, const FMD5Holder &right) int Compare(const FMD5Holder left, const FMD5Holder right)
{ {
return left.DWords[0] != right.DWords[0] || return left.DWords[0] != right.DWords[0] ||
left.DWords[1] != right.DWords[1] || left.DWords[1] != right.DWords[1] ||

View file

@ -50,11 +50,12 @@ static FRandom pr_endtag;
// //
//==================================================================== //====================================================================
FConfigFile::FConfigFile () : PathName(NAME_None) FConfigFile::FConfigFile ()
{ {
Sections = CurrentSection = NULL; Sections = CurrentSection = NULL;
LastSectionPtr = &Sections; LastSectionPtr = &Sections;
CurrentEntry = NULL; CurrentEntry = NULL;
PathName = "";
OkayToWrite = true; OkayToWrite = true;
FileExisted = true; FileExisted = true;
} }

View file

@ -2190,24 +2190,25 @@ static int PatchText (int oldSize)
} }
} }
if (!good) // Search through most other texts
{ const char *str;
// Search through most other texts do
const char *str; {
str = EnglishStrings->MatchString (oldStr); str = EnglishStrings->MatchString(oldStr);
if (str != NULL) if (str != NULL)
{ {
GStrings.SetString (str, newStr); GStrings.SetString(str, newStr);
EnglishStrings->SetString(str, "~~"); // set to something invalid so that it won't get found again by the next iteration or by another replacement later
good = true; good = true;
} }
}
while (str != NULL); // repeat search until the text can no longer be found
if (!good) if (!good)
{ {
DPrintf (" (Unmatched)\n"); DPrintf (" (Unmatched)\n");
}
} }
donewithtext: donewithtext:
if (newStr) if (newStr)
delete[] newStr; delete[] newStr;

View file

@ -1022,8 +1022,9 @@ FDecalLib::FTranslation *FDecalLib::GenerateTranslation (DWORD start, DWORD end)
return trans; return trans;
} }
FDecalBase::FDecalBase () : Name(NAME_None) FDecalBase::FDecalBase ()
{ {
Name = NAME_None;
} }
FDecalBase::~FDecalBase () FDecalBase::~FDecalBase ()
@ -1136,8 +1137,9 @@ const FDecalTemplate *FDecalGroup::GetDecal () const
return static_cast<const FDecalTemplate *>(remember); return static_cast<const FDecalTemplate *>(remember);
} }
FDecalAnimator::FDecalAnimator (const char *name) : Name(name) FDecalAnimator::FDecalAnimator (const char *name)
{ {
Name = name;
} }
FDecalAnimator::~FDecalAnimator () FDecalAnimator::~FDecalAnimator ()

View file

@ -24,7 +24,7 @@ struct PSymbol
FName SymbolName; FName SymbolName;
protected: protected:
PSymbol(FName name, ESymbolType type):SymbolName(name) { SymbolType = type; } PSymbol(FName name, ESymbolType type) { SymbolType = type; SymbolName = name; }
}; };
// A constant value --------------------------------------------------------- // A constant value ---------------------------------------------------------

View file

@ -78,8 +78,9 @@ DMover::DMover ()
} }
DMover::DMover (sector_t *sector) DMover::DMover (sector_t *sector)
: DSectorEffect (sector), interpolation(NULL) : DSectorEffect (sector)
{ {
interpolation = NULL;
} }
void DMover::Destroy() void DMover::Destroy()

View file

@ -241,7 +241,7 @@ struct FOptionalMapinfoData
{ {
FOptionalMapinfoData *Next; FOptionalMapinfoData *Next;
FName identifier; FName identifier;
FOptionalMapinfoData():identifier(NAME_None) { Next = NULL; } FOptionalMapinfoData() { Next = NULL; identifier = NAME_None; }
virtual ~FOptionalMapinfoData() {} virtual ~FOptionalMapinfoData() {}
virtual FOptionalMapinfoData *Clone() const = 0; virtual FOptionalMapinfoData *Clone() const = 0;
}; };

View file

@ -16,7 +16,7 @@ class FWeaponSlot
{ {
public: public:
FWeaponSlot() { Clear(); } FWeaponSlot() { Clear(); }
FWeaponSlot(const FWeaponSlot &other):Weapons(other.Weapons) {} FWeaponSlot(const FWeaponSlot &other) { Weapons = other.Weapons; }
FWeaponSlot &operator= (const FWeaponSlot &other) { Weapons = other.Weapons; return *this; } FWeaponSlot &operator= (const FWeaponSlot &other) { Weapons = other.Weapons; return *this; }
void Clear() { Weapons.Clear(); } void Clear() { Weapons.Clear(); }
bool AddWeapon (const char *type); bool AddWeapon (const char *type);

View file

@ -238,7 +238,7 @@ void PacketSend (void)
else else
{ {
// Printf("send %d\n", doomcom.datalength); // Printf("send %d\n", doomcom.datalength);
/*c = */sendto(mysocket, (char *)doomcom.data, doomcom.datalength, c = sendto(mysocket, (char *)doomcom.data, doomcom.datalength,
0, (sockaddr *)&sendaddress[doomcom.remotenode], 0, (sockaddr *)&sendaddress[doomcom.remotenode],
sizeof(sendaddress[doomcom.remotenode])); sizeof(sendaddress[doomcom.remotenode]));
} }

View file

@ -55,8 +55,8 @@ DArgs::DArgs()
// //
//=========================================================================== //===========================================================================
DArgs::DArgs(const DArgs &other):Argv(other.Argv), DArgs::DArgs(const DArgs &other)
DObject() : DObject(), Argv(other.Argv)
{ {
} }

View file

@ -261,10 +261,11 @@ protected:
public: public:
bool mEnabled; bool mEnabled;
FListMenuItem(int xpos = 0, int ypos = 0, FName action = NAME_None):mAction(action) FListMenuItem(int xpos = 0, int ypos = 0, FName action = NAME_None)
{ {
mXpos = xpos; mXpos = xpos;
mYpos = ypos; mYpos = ypos;
mAction = action;
mEnabled = true; mEnabled = true;
} }

View file

@ -937,10 +937,13 @@ void FNodeBuilder::SetNodeFromSeg (node_t &node, const FPrivSeg *pseg) const
DWORD FNodeBuilder::SplitSeg (DWORD segnum, int splitvert, int v1InFront) DWORD FNodeBuilder::SplitSeg (DWORD segnum, int splitvert, int v1InFront)
{ {
double dx, dy;
FPrivSeg newseg; FPrivSeg newseg;
int newnum = (int)Segs.Size(); int newnum = (int)Segs.Size();
newseg = Segs[segnum]; newseg = Segs[segnum];
dx = double(Vertices[splitvert].x - Vertices[newseg.v1].x);
dy = double(Vertices[splitvert].y - Vertices[newseg.v1].y);
if (v1InFront > 0) if (v1InFront > 0)
{ {
newseg.v1 = splitvert; newseg.v1 = splitvert;
@ -1126,7 +1129,8 @@ int ClassifyLineBackpatchC (node_t &node, const FSimpleVert *v1, const FSimpleVe
long pagesize = sysconf(_SC_PAGESIZE); long pagesize = sysconf(_SC_PAGESIZE);
char *callerpage = (char *)((intptr_t)calleroffset & ~(pagesize - 1)); char *callerpage = (char *)((intptr_t)calleroffset & ~(pagesize - 1));
size_t protectlen = (intptr_t)calleroffset + sizeof(void*) - (intptr_t)callerpage; size_t protectlen = (intptr_t)calleroffset + sizeof(void*) - (intptr_t)callerpage;
if (!mprotect(callerpage, protectlen, PROT_READ|PROT_WRITE|PROT_EXEC)) int ptect;
if (!(ptect = mprotect(callerpage, protectlen, PROT_READ|PROT_WRITE|PROT_EXEC)))
#endif #endif
{ {
*calleroffset = diff; *calleroffset = diff;

View file

@ -317,6 +317,7 @@ int FNodeBuilder::CloseSubsector (TArray<glseg_t> &segs, int subsector, vertex_t
{ {
angle_t bestdiff = ANGLE_MAX; angle_t bestdiff = ANGLE_MAX;
FPrivSeg *bestseg = NULL; FPrivSeg *bestseg = NULL;
DWORD bestj = DWORD_MAX;
j = first; j = first;
do do
{ {
@ -327,12 +328,14 @@ int FNodeBuilder::CloseSubsector (TArray<glseg_t> &segs, int subsector, vertex_t
{ {
bestdiff = diff; bestdiff = diff;
bestseg = seg; bestseg = seg;
bestj = j;
break; break;
} }
if (diff < bestdiff && diff > 0) if (diff < bestdiff && diff > 0)
{ {
bestdiff = diff; bestdiff = diff;
bestseg = seg; bestseg = seg;
bestj = j;
} }
} }
while (++j < max); while (++j < max);

View file

@ -176,7 +176,7 @@ void FNodeBuilder::AddMinisegs (const node_t &node, DWORD splitseg, DWORD &fset,
{ {
if (prev != NULL) if (prev != NULL)
{ {
DWORD fseg1, bseg1; DWORD fseg1, bseg1, fseg2, bseg2;
DWORD fnseg, bnseg; DWORD fnseg, bnseg;
// Minisegs should only be added when they can create valid loops on both the front and // Minisegs should only be added when they can create valid loops on both the front and
@ -186,8 +186,8 @@ void FNodeBuilder::AddMinisegs (const node_t &node, DWORD splitseg, DWORD &fset,
if ((fseg1 = CheckLoopStart (node.dx, node.dy, prev->Info.Vertex, event->Info.Vertex)) != DWORD_MAX && if ((fseg1 = CheckLoopStart (node.dx, node.dy, prev->Info.Vertex, event->Info.Vertex)) != DWORD_MAX &&
(bseg1 = CheckLoopStart (-node.dx, -node.dy, event->Info.Vertex, prev->Info.Vertex)) != DWORD_MAX && (bseg1 = CheckLoopStart (-node.dx, -node.dy, event->Info.Vertex, prev->Info.Vertex)) != DWORD_MAX &&
(CheckLoopEnd (node.dx, node.dy, event->Info.Vertex)) != DWORD_MAX && (fseg2 = CheckLoopEnd (node.dx, node.dy, event->Info.Vertex)) != DWORD_MAX &&
(CheckLoopEnd (-node.dx, -node.dy, prev->Info.Vertex)) != DWORD_MAX) (bseg2 = CheckLoopEnd (-node.dx, -node.dy, prev->Info.Vertex)) != DWORD_MAX)
{ {
// Add miniseg on the front side // Add miniseg on the front side
fnseg = AddMiniseg (prev->Info.Vertex, event->Info.Vertex, DWORD_MAX, fseg1, splitseg); fnseg = AddMiniseg (prev->Info.Vertex, event->Info.Vertex, DWORD_MAX, fseg1, splitseg);

View file

@ -217,7 +217,7 @@ FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS];
// //
// When the string table needs to grow to hold more strings, a garbage // When the string table needs to grow to hold more strings, a garbage
// collection is first attempted to see if more room can be made to store // collection is first attempted to see if more room can be made to store
// strings without growing. A string is concidered in use if any value // strings without growing. A string is considered in use if any value
// in any of these variable blocks contains a valid ID in the global string // in any of these variable blocks contains a valid ID in the global string
// table: // table:
// * The active area of the ACS stack // * The active area of the ACS stack
@ -226,7 +226,7 @@ FWorldGlobalArray ACS_GlobalArrays[NUM_GLOBALVARS];
// * All world variables // * All world variables
// * All global variables // * All global variables
// It's not important whether or not they are really used as strings, only // It's not important whether or not they are really used as strings, only
// that they might be. A string is also concidered in use if its lock count // that they might be. A string is also considered in use if its lock count
// is non-zero, even if none of the above variable blocks referenced it. // is non-zero, even if none of the above variable blocks referenced it.
// //
// To keep track of local and map variables for nonresident maps in a hub, // To keep track of local and map variables for nonresident maps in a hub,
@ -660,7 +660,10 @@ void ACSStringPool::ReadStrings(PNGHandle *png, DWORD id)
i++; i++;
j = arc.ReadCount(); j = arc.ReadCount();
} }
delete[] str; if (str != NULL)
{
delete[] str;
}
FindFirstFreeEntry(0); FindFirstFreeEntry(0);
} }
} }
@ -1063,14 +1066,7 @@ static void DoGiveInv (AActor *actor, const PClass *info, int amount)
item->ClearCounters(); item->ClearCounters();
if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorPickup))) if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorPickup)))
{ {
if (static_cast<ABasicArmorPickup*>(item)->SaveAmount != 0) static_cast<ABasicArmorPickup*>(item)->SaveAmount *= amount;
{
static_cast<ABasicArmorPickup*>(item)->SaveAmount *= amount;
}
else
{
static_cast<ABasicArmorPickup*>(item)->SaveAmount *= amount;
}
} }
else if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorBonus))) else if (info->IsDescendantOf (RUNTIME_CLASS(ABasicArmorBonus)))
{ {
@ -5845,7 +5841,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
bool canraiseall = true; bool canraiseall = true;
while ((actor = iterator.Next())) while ((actor = iterator.Next()))
{ {
canraiseall = P_Thing_CanRaise(actor) && canraiseall; canraiseall = P_Thing_CanRaise(actor) & canraiseall;
} }
return canraiseall; return canraiseall;

View file

@ -924,7 +924,7 @@ public:
{ {
const char *speakerName; const char *speakerName;
int x, y, linesize; int x, y, linesize;
int width=screen->GetWidth(), height=screen->GetHeight(), fontheight; int width, fontheight;
player_t *cp = &players[consoleplayer]; player_t *cp = &players[consoleplayer];
@ -949,8 +949,8 @@ public:
{ {
screen->DrawTexture (TexMan(CurNode->Backdrop), 0, 0, DTA_320x200, true, TAG_DONE); screen->DrawTexture (TexMan(CurNode->Backdrop), 0, 0, DTA_320x200, true, TAG_DONE);
} }
x = 16 * width / 320; x = 16 * screen->GetWidth() / 320;
y = 16 * height / 200; y = 16 * screen->GetHeight() / 200;
linesize = 10 * CleanYfac; linesize = 10 * CleanYfac;
// Who is talking to you? // Who is talking to you?
@ -970,16 +970,16 @@ public:
int i; int i;
for (i = 0; mDialogueLines[i].Width >= 0; ++i) for (i = 0; mDialogueLines[i].Width >= 0; ++i)
{ } { }
screen->Dim (0, 0.45f, 14 * width / 320, 13 * height / 200, screen->Dim (0, 0.45f, 14 * screen->GetWidth() / 320, 13 * screen->GetHeight() / 200,
308 * width / 320 - 14 * width / 320, 308 * screen->GetWidth() / 320 - 14 * screen->GetWidth () / 320,
speakerName == NULL ? linesize * i + 6 * CleanYfac speakerName == NULL ? linesize * i + 6 * CleanYfac
: linesize * i + 6 * CleanYfac + linesize * 3/2); : linesize * i + 6 * CleanYfac + linesize * 3/2);
} }
// Dim the screen behind the PC's choices. // Dim the screen behind the PC's choices.
screen->Dim (0, 0.45f, (24-160) * CleanXfac + width/2, screen->Dim (0, 0.45f, (24-160) * CleanXfac + screen->GetWidth()/2,
(mYpos - 2 - 100) * CleanYfac + height/2, (mYpos - 2 - 100) * CleanYfac + screen->GetHeight()/2,
272 * CleanXfac, 272 * CleanXfac,
MIN<int>(mResponseLines.Size() * OptionSettings.mLinespacing + 4, 200 - mYpos) * CleanYfac); MIN<int>(mResponseLines.Size() * OptionSettings.mLinespacing + 4, 200 - mYpos) * CleanYfac);
@ -989,7 +989,7 @@ public:
DTA_CleanNoMove, true, TAG_DONE); DTA_CleanNoMove, true, TAG_DONE);
y += linesize * 3 / 2; y += linesize * 3 / 2;
} }
x = 24 * width / 320; x = 24 * screen->GetWidth() / 320;
for (int i = 0; mDialogueLines[i].Width >= 0; ++i) for (int i = 0; mDialogueLines[i].Width >= 0; ++i)
{ {
screen->DrawText (SmallFont, CR_UNTRANSLATED, x, y, mDialogueLines[i].Text, screen->DrawText (SmallFont, CR_UNTRANSLATED, x, y, mDialogueLines[i].Text,
@ -1019,6 +1019,7 @@ public:
int response = 0; int response = 0;
for (unsigned i = 0; i < mResponseLines.Size(); i++, y += fontheight) for (unsigned i = 0; i < mResponseLines.Size(); i++, y += fontheight)
{ {
width = SmallFont->StringWidth(mResponseLines[i]);
x = 64; x = 64;
screen->DrawText (SmallFont, CR_GREEN, x, y, mResponseLines[i], DTA_Clean, true, TAG_DONE); screen->DrawText (SmallFont, CR_GREEN, x, y, mResponseLines[i], DTA_Clean, true, TAG_DONE);
@ -1036,8 +1037,8 @@ public:
{ {
int color = ((DMenu::MenuTime%8) < 4) || DMenu::CurrentMenu != this ? CR_RED:CR_GREY; int color = ((DMenu::MenuTime%8) < 4) || DMenu::CurrentMenu != this ? CR_RED:CR_GREY;
x = (50 + 3 - 160) * CleanXfac + width / 2; x = (50 + 3 - 160) * CleanXfac + screen->GetWidth() / 2;
int yy = (y + fontheight/2 - 5 - 100) * CleanYfac + height / 2; int yy = (y + fontheight/2 - 5 - 100) * CleanYfac + screen->GetHeight() / 2;
screen->DrawText (ConFont, color, x, yy, "\xd", screen->DrawText (ConFont, color, x, yy, "\xd",
DTA_CellX, 8 * CleanXfac, DTA_CellX, 8 * CleanXfac,
DTA_CellY, 8 * CleanYfac, DTA_CellY, 8 * CleanYfac,

View file

@ -900,12 +900,12 @@ DElevator::DElevator ()
} }
DElevator::DElevator (sector_t *sec) DElevator::DElevator (sector_t *sec)
: m_Interp_Floor(sec->SetInterpolation(sector_t::FloorMove, true)), : Super (sec)
m_Interp_Ceiling(sec->SetInterpolation(sector_t::CeilingMove, true)),
Super (sec)
{ {
sec->floordata = this; sec->floordata = this;
sec->ceilingdata = this; sec->ceilingdata = this;
m_Interp_Floor = sec->SetInterpolation(sector_t::FloorMove, true);
m_Interp_Ceiling = sec->SetInterpolation(sector_t::CeilingMove, true);
} }
void DElevator::Serialize (FArchive &arc) void DElevator::Serialize (FArchive &arc)

View file

@ -1977,9 +1977,9 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
{ {
bool tg = (mo->target != NULL); bool tg = (mo->target != NULL);
bool blockingtg = (BlockingMobj->target != NULL); bool blockingtg = (BlockingMobj->target != NULL);
if (BlockingMobj->flags7 & MF7_AIMREFLECT && (tg || blockingtg)) if ((BlockingMobj->flags7 & MF7_AIMREFLECT) && (tg | blockingtg))
{ {
AActor *origin=tg ? mo->target : BlockingMobj->target; AActor *origin = tg ? mo->target : BlockingMobj->target;
float speed = (float)(mo->Speed); float speed = (float)(mo->Speed);
//dest->x - source->x //dest->x - source->x
@ -1991,7 +1991,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
} }
else else
{ {
if (BlockingMobj->flags7 & MF7_MIRRORREFLECT && (tg || blockingtg)) if ((BlockingMobj->flags7 & MF7_MIRRORREFLECT) && (tg | blockingtg))
{ {
mo->angle += ANGLE_180; mo->angle += ANGLE_180;
mo->velx = -mo->velx / 2; mo->velx = -mo->velx / 2;
@ -3498,7 +3498,7 @@ void AActor::Tick ()
// Check 3D floors as well // Check 3D floors as well
floorplane = P_FindFloorPlane(floorsector, x, y, floorz); floorplane = P_FindFloorPlane(floorsector, x, y, floorz);
#else #else
floorplane = floorsector->floorplane; floorplane = floorsector->floorplane;
#endif #endif
if (floorplane.c < STEEPSLOPE && if (floorplane.c < STEEPSLOPE &&
@ -5629,24 +5629,30 @@ static fixed_t GetDefaultSpeed(const PClass *type)
AActor *P_SpawnMissile (AActor *source, AActor *dest, const PClass *type, AActor *owner) AActor *P_SpawnMissile (AActor *source, AActor *dest, const PClass *type, AActor *owner)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
return P_SpawnMissileXYZ (source->x, source->y, source->z + 32*FRACUNIT + source->GetBobOffset(), return P_SpawnMissileXYZ (source->x, source->y, source->z + 32*FRACUNIT + source->GetBobOffset(),
source, dest, type, true, owner); source, dest, type, true, owner);
} }
AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, const PClass *type) AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, const PClass *type)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
return P_SpawnMissileXYZ (source->x, source->y, z, source, dest, type); return P_SpawnMissileXYZ (source->x, source->y, z, source, dest, type);
} }
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
AActor *source, AActor *dest, const PClass *type, bool checkspawn, AActor *owner) AActor *source, AActor *dest, const PClass *type, bool checkspawn, AActor *owner)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
if (dest == NULL) if (dest == NULL)
{ {
@ -5717,8 +5723,10 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const PClass *type) AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const PClass *type)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
angle_t an; angle_t an;
fixed_t dist; fixed_t dist;
AActor *th = Spawn (type, source->x, source->y, source->z + 4*8*FRACUNIT, ALLOW_REPLACE); AActor *th = Spawn (type, source->x, source->y, source->z + 4*8*FRACUNIT, ALLOW_REPLACE);
@ -5760,8 +5768,10 @@ AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const
AActor *P_SpawnMissileAngle (AActor *source, const PClass *type, AActor *P_SpawnMissileAngle (AActor *source, const PClass *type,
angle_t angle, fixed_t velz) angle_t angle, fixed_t velz)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(), return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
type, angle, velz, GetDefaultSpeed (type)); type, angle, velz, GetDefaultSpeed (type));
} }
@ -5769,16 +5779,16 @@ AActor *P_SpawnMissileAngle (AActor *source, const PClass *type,
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z,
const PClass *type, angle_t angle, fixed_t velz) const PClass *type, angle_t angle, fixed_t velz)
{ {
if(!source)
return NULL;
return P_SpawnMissileAngleZSpeed (source, z, type, angle, velz, return P_SpawnMissileAngleZSpeed (source, z, type, angle, velz,
GetDefaultSpeed (type)); GetDefaultSpeed (type));
} }
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type) AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
angle_t an; angle_t an;
fixed_t dist; fixed_t dist;
fixed_t speed; fixed_t speed;
@ -5809,8 +5819,10 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl
AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type, AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type,
angle_t angle, fixed_t velz, fixed_t speed) angle_t angle, fixed_t velz, fixed_t speed)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(), return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
type, angle, velz, speed); type, angle, velz, speed);
} }
@ -5818,11 +5830,13 @@ AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type,
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
const PClass *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn) const PClass *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
AActor *mo; AActor *mo;
if (z != ONFLOORZ && z != ONCEILINGZ && source != NULL) if (z != ONFLOORZ && z != ONCEILINGZ)
{ {
z -= source->floorclip; z -= source->floorclip;
} }
@ -5857,8 +5871,10 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type) AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type)
{ {
if(!source) if (source == NULL)
{
return NULL; return NULL;
}
return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->angle); return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->angle);
} }

View file

@ -3042,14 +3042,13 @@ void P_LoadBlockMap (MapData * map)
blockmap = blockmaplump+4; blockmap = blockmaplump+4;
} }
line_t** linebuffer;
// //
// P_GroupLines // P_GroupLines
// Builds sector line lists and subsector sector numbers. // Builds sector line lists and subsector sector numbers.
// Finds block bounding boxes for sectors. // Finds block bounding boxes for sectors.
// [RH] Handles extra lights. // [RH] Handles extra lights
// //
line_t** linebuffer;
static void P_GroupLines (bool buildmap) static void P_GroupLines (bool buildmap)
{ {

View file

@ -188,7 +188,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
// Spawn teleport fog at source and destination // Spawn teleport fog at source and destination
if (sourceFog && !predicting) if (sourceFog && !predicting)
{ {
P_SpawnTeleportFog(thing, oldx, oldy, oldz, true, true); //Passes the actor through then pulls the TeleFog metadata types based on properties. P_SpawnTeleportFog(thing, oldx, oldy, oldz, true, true); //Passes the actor through which then pulls the TeleFog metadata types based on properties.
} }
if (useFog) if (useFog)
{ {

View file

@ -101,10 +101,11 @@ FPlayerClass::FPlayerClass ()
Flags = 0; Flags = 0;
} }
FPlayerClass::FPlayerClass (const FPlayerClass &other) : Skins(other.Skins) FPlayerClass::FPlayerClass (const FPlayerClass &other)
{ {
Type = other.Type; Type = other.Type;
Flags = other.Flags; Flags = other.Flags;
Skins = other.Skins;
} }
FPlayerClass::~FPlayerClass () FPlayerClass::~FPlayerClass ()
@ -1011,7 +1012,7 @@ void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer)
else if ((dmflags & DF_COOP_LOSE_ARMOR) && else if ((dmflags & DF_COOP_LOSE_ARMOR) &&
item->IsKindOf(RUNTIME_CLASS(AArmor))) item->IsKindOf(RUNTIME_CLASS(AArmor)))
{ {
if (defitem != NULL) if (defitem == NULL)
{ {
item->Destroy(); item->Destroy();
} }

View file

@ -152,9 +152,11 @@ struct ExpVal
class FxExpression class FxExpression
{ {
protected: protected:
FxExpression(const FScriptPosition &pos):ScriptPosition(pos) FxExpression(const FScriptPosition &pos)
: ScriptPosition(pos)
{ {
isresolved = false; isresolved = false;
ScriptPosition = pos;
} }
public: public:
virtual ~FxExpression() {} virtual ~FxExpression() {}

View file

@ -1576,6 +1576,7 @@ FxExpression *FxAbs::Resolve(FCompileContext &ctx)
case VAL_Float: case VAL_Float:
value.Float = fabs(value.Float); value.Float = fabs(value.Float);
break;
default: default:
// shouldn't happen // shouldn't happen
@ -2052,6 +2053,7 @@ FxExpression *FxGlobalVariable::Resolve(FCompileContext&)
case VAL_Fixed: case VAL_Fixed:
case VAL_Angle: case VAL_Angle:
ValueType = VAL_Float; ValueType = VAL_Float;
break;
case VAL_Object: case VAL_Object:
case VAL_Class: case VAL_Class:

View file

@ -72,7 +72,7 @@ const int SXF_SETTARGET = 1 << 20;
const int SXF_SETTRACER = 1 << 21; const int SXF_SETTRACER = 1 << 21;
const int SXF_NOPOINTERS = 1 << 22; const int SXF_NOPOINTERS = 1 << 22;
const int SXF_ORIGINATOR = 1 << 23; const int SXF_ORIGINATOR = 1 << 23;
const int SIXF_TRANSFERSPRITEFRAME = 1 << 24; const int SXF_TRANSFERSPRITEFRAME = 1 << 24;
// Flags for A_Chase // Flags for A_Chase
const int CHF_FASTCHASE = 1; const int CHF_FASTCHASE = 1;