mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- make polyobject setup errors not abort the map.
This commit is contained in:
parent
d014395dae
commit
3d8821ee82
1 changed files with 31 additions and 18 deletions
|
@ -34,6 +34,7 @@
|
|||
#include "p_blockmap.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "actorinlines.h"
|
||||
#include "v_text.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
@ -1536,8 +1537,11 @@ static void SpawnPolyobj (int index, int tag, int type)
|
|||
{
|
||||
if (po->Sidedefs.Size() > 0)
|
||||
{
|
||||
I_Error ("SpawnPolyobj: Polyobj %d already spawned.\n", tag);
|
||||
Printf (TEXTCOLOR_RED "SpawnPolyobj: Polyobj %d already spawned.\n", tag);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
sd->linedef->special = 0;
|
||||
sd->linedef->args[0] = 0;
|
||||
IterFindPolySides(&polyobjs[index], sd);
|
||||
|
@ -1550,6 +1554,7 @@ static void SpawnPolyobj (int index, int tag, int type)
|
|||
{
|
||||
po->seqType = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1570,11 +1575,15 @@ static void SpawnPolyobj (int index, int tag, int type)
|
|||
{
|
||||
if (!level.sides[i].linedef->args[1])
|
||||
{
|
||||
I_Error("SpawnPolyobj: Explicit line missing order number in poly %d, linedef %d.\n", tag, level.sides[i].linedef->Index());
|
||||
Printf(TEXTCOLOR_RED "SpawnPolyobj: Explicit line missing order number in poly %d, linedef %d.\n", tag, level.sides[i].linedef->Index());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
po->Sidedefs.Push(&level.sides[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
qsort(&po->Sidedefs[0], po->Sidedefs.Size(), sizeof(po->Sidedefs[0]), posicmp);
|
||||
if (po->Sidedefs.Size() > 0)
|
||||
{
|
||||
|
@ -1585,7 +1594,10 @@ static void SpawnPolyobj (int index, int tag, int type)
|
|||
po->MirrorNum = po->Sidedefs[0]->linedef->args[2];
|
||||
}
|
||||
else
|
||||
I_Error ("SpawnPolyobj: Poly %d does not exist\n", tag);
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "SpawnPolyobj: Poly %d does not exist\n", tag);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
validcount++;
|
||||
|
@ -1648,11 +1660,13 @@ static void TranslateToStartSpot (int tag, const DVector2 &origin)
|
|||
}
|
||||
if (po == NULL)
|
||||
{ // didn't match the tag with a polyobj tag
|
||||
I_Error("TranslateToStartSpot: Unable to match polyobj tag: %d\n", tag);
|
||||
Printf(TEXTCOLOR_RED "TranslateToStartSpot: Unable to match polyobj tag: %d\n", tag);
|
||||
return;
|
||||
}
|
||||
if (po->Sidedefs.Size() == 0)
|
||||
{
|
||||
I_Error ("TranslateToStartSpot: Anchor point located without a StartSpot point: %d\n", tag);
|
||||
Printf(TEXTCOLOR_RED "TranslateToStartSpot: Anchor point located without a StartSpot point: %d\n", tag);
|
||||
return;
|
||||
}
|
||||
po->OriginalPts.Resize(po->Sidedefs.Size());
|
||||
po->PrevPts.Resize(po->Sidedefs.Size());
|
||||
|
@ -1738,8 +1752,7 @@ void PO_Init (void)
|
|||
{
|
||||
if (polyobjs[polyIndex].OriginalPts.Size() == 0)
|
||||
{
|
||||
I_Error ("PO_Init: StartSpot located without an Anchor point: %d\n",
|
||||
polyobjs[polyIndex].tag);
|
||||
Printf (TEXTCOLOR_RED "PO_Init: StartSpot located without an Anchor point: %d\n", polyobjs[polyIndex].tag);
|
||||
}
|
||||
}
|
||||
InitBlockMap();
|
||||
|
|
Loading…
Reference in a new issue