Fix: if a map was saved before entry points had been defined, it could not be loaded again.

This has been fixed, and we also print out a warning to that a mapper can fix the map.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7802 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-03-31 18:36:19 +00:00
parent 01bdeb2c7f
commit c241c0ea7b
2 changed files with 17 additions and 11 deletions
+7
View File
@@ -171,6 +171,13 @@ BOOLEAN MAPCREATE_STRUCT::Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMin
pData = &OldMapCreateStruct;
uiBytesToWrite = sizeof(_OLD_MAPCREATE_STRUCT);
}
// a map without entry points would be fatal in a campaign, so print out a warning to the maper
if ( sNorthGridNo == NOWHERE && sEastGridNo == NOWHERE && sSouthGridNo == NOWHERE && sWestGridNo == NOWHERE && sCenterGridNo == NOWHERE )
{
ScreenMsg( MSG_FONT_YELLOW, MSG_ERROR, L"Map has no entry points - please fix this!" );
}
UINT32 uiBytesWritten = 0;
FileWrite(hFile, pData, uiBytesToWrite, &uiBytesWritten);
if(uiBytesToWrite == uiBytesWritten)