mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
- made the coordinate check fatal. If this happens the loaded map will be broken, there is no point trying to recover.
This commit is contained in:
parent
f31fb64750
commit
74a2d58a52
2 changed files with 8 additions and 6 deletions
|
@ -262,8 +262,8 @@ double UDMFParserBase::CheckCoordinate(const char *key)
|
||||||
}
|
}
|
||||||
if (sc.Float < -32768 || sc.Float > 32768)
|
if (sc.Float < -32768 || sc.Float > 32768)
|
||||||
{
|
{
|
||||||
sc.ScriptMessage("Value %f out of range for a coordinate '%s'. Valid range is ]-32768 .. 32768]", key);
|
sc.ScriptMessage("Value %f out of range for a coordinate '%s'. Valid range is ]-32768 .. 32768]", sc.Float, key);
|
||||||
sc.Float = clamp(sc.Float, -32768 + EQUAL_EPSILON*2, 32768 - EQUAL_EPSILON*2);
|
BadCoordinates = true; // If this happens the map must not allowed to be started.
|
||||||
}
|
}
|
||||||
return sc.Float;
|
return sc.Float;
|
||||||
}
|
}
|
||||||
|
@ -2083,10 +2083,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Catch bogus maps here rather than during nodebuilding
|
// Catch bogus maps here rather than during nodebuilding
|
||||||
if (ParsedVertices.Size() == 0) I_Error("Map has no vertices.\n");
|
if (ParsedVertices.Size() == 0) I_Error("Map has no vertices.");
|
||||||
if (ParsedSectors.Size() == 0) I_Error("Map has no sectors. \n");
|
if (ParsedSectors.Size() == 0) I_Error("Map has no sectors. ");
|
||||||
if (ParsedLines.Size() == 0) I_Error("Map has no linedefs.\n");
|
if (ParsedLines.Size() == 0) I_Error("Map has no linedefs.");
|
||||||
if (ParsedSides.Size() == 0) I_Error("Map has no sidedefs.\n");
|
if (ParsedSides.Size() == 0) I_Error("Map has no sidedefs.");
|
||||||
|
if (BadCoordinates) I_Error("Map has out of range coordinates");
|
||||||
|
|
||||||
// Create the real vertices
|
// Create the real vertices
|
||||||
level.vertexes.Alloc(ParsedVertices.Size());
|
level.vertexes.Alloc(ParsedVertices.Size());
|
||||||
|
|
|
@ -11,6 +11,7 @@ protected:
|
||||||
FName namespc;
|
FName namespc;
|
||||||
int namespace_bits;
|
int namespace_bits;
|
||||||
FString parsedString;
|
FString parsedString;
|
||||||
|
bool BadCoordinates = false;
|
||||||
|
|
||||||
void Skip();
|
void Skip();
|
||||||
FName ParseKey(bool checkblock = false, bool *isblock = NULL);
|
FName ParseKey(bool checkblock = false, bool *isblock = NULL);
|
||||||
|
|
Loading…
Reference in a new issue