added compile-time support for up to 64 maxplayers

This commit is contained in:
jeefo 2016-03-10 00:37:33 +03:00
commit 5ff6b9ecde
8 changed files with 28 additions and 13 deletions

View file

@ -1052,7 +1052,7 @@ void Waypoint::InitTypes (void)
bool Waypoint::Load (void)
{
MemoryFile fp (CheckSubfolderFile ());
File fp (CheckSubfolderFile (), "rb");
WaypointHeader header;
memset (&header, 0, sizeof (header));
@ -1118,6 +1118,16 @@ bool Waypoint::Load (void)
fp.Close ();
return false;
}
// more checks of waypoint quality
if (m_paths[i]->pathNumber < 0 || m_paths[i]->pathNumber > g_numWaypoints)
{
sprintf (m_infoBuffer, "%s.pwf - bad waypoint file (path #%d index is out of bounds)", map, i);
AddLogEntry (true, LL_ERROR, m_infoBuffer);
fp.Close ();
return false;
}
}
m_waypointPaths = true;
}