mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
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:
+10
-11
@@ -6759,7 +6759,6 @@ void SetInterfaceHeightLevel( )
|
|||||||
{
|
{
|
||||||
INT16 sHeight;
|
INT16 sHeight;
|
||||||
static INT16 sOldHeight = 0;
|
static INT16 sOldHeight = 0;
|
||||||
INT32 sGridNo;
|
|
||||||
|
|
||||||
if( gfBasement || gfCaves )
|
if( gfBasement || gfCaves )
|
||||||
{
|
{
|
||||||
@@ -6769,25 +6768,25 @@ void SetInterfaceHeightLevel( )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ATE: Use an entry point to determine what height to use....
|
// ATE: Use an entry point to determine what height to use....
|
||||||
if( gMapInformation.sNorthGridNo != NOWHERE )
|
if( gMapInformation.sNorthGridNo != NOWHERE )
|
||||||
sGridNo = gMapInformation.sNorthGridNo;
|
sHeight = gpWorldLevelData[gMapInformation.sNorthGridNo].sHeight;
|
||||||
else if( gMapInformation.sEastGridNo != NOWHERE )
|
else if( gMapInformation.sEastGridNo != NOWHERE )
|
||||||
sGridNo = gMapInformation.sEastGridNo;
|
sHeight = gpWorldLevelData[gMapInformation.sEastGridNo].sHeight;
|
||||||
else if( gMapInformation.sSouthGridNo != NOWHERE )
|
else if( gMapInformation.sSouthGridNo != NOWHERE )
|
||||||
sGridNo = gMapInformation.sSouthGridNo;
|
sHeight = gpWorldLevelData[gMapInformation.sSouthGridNo].sHeight;
|
||||||
else if( gMapInformation.sWestGridNo != NOWHERE )
|
else if( gMapInformation.sWestGridNo != NOWHERE )
|
||||||
sGridNo = gMapInformation.sWestGridNo;
|
sHeight = gpWorldLevelData[gMapInformation.sWestGridNo].sHeight;
|
||||||
|
else if ( gMapInformation.sCenterGridNo != NOWHERE )
|
||||||
|
sHeight = gpWorldLevelData[gMapInformation.sCenterGridNo].sHeight;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Assert(0);
|
// we're merely interested in the terrain height. If the map has no entry points at all, we will have other problems than rooftops, so just use height of 0 and be done with it
|
||||||
return;
|
// however, print out a warning, so that a mapper can fix this!
|
||||||
|
ScreenMsg( MSG_FONT_YELLOW, MSG_ERROR, L"Map has no entry points - please fix this!" );
|
||||||
|
sHeight = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sHeight = gpWorldLevelData[ sGridNo ].sHeight;
|
|
||||||
|
|
||||||
if ( sHeight != sOldHeight )
|
if ( sHeight != sOldHeight )
|
||||||
{
|
{
|
||||||
gsRenderHeight = sHeight;
|
gsRenderHeight = sHeight;
|
||||||
|
|||||||
@@ -171,6 +171,13 @@ BOOLEAN MAPCREATE_STRUCT::Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMin
|
|||||||
pData = &OldMapCreateStruct;
|
pData = &OldMapCreateStruct;
|
||||||
uiBytesToWrite = sizeof(_OLD_MAPCREATE_STRUCT);
|
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;
|
UINT32 uiBytesWritten = 0;
|
||||||
FileWrite(hFile, pData, uiBytesToWrite, &uiBytesWritten);
|
FileWrite(hFile, pData, uiBytesToWrite, &uiBytesWritten);
|
||||||
if(uiBytesToWrite == uiBytesWritten)
|
if(uiBytesToWrite == uiBytesWritten)
|
||||||
|
|||||||
Reference in New Issue
Block a user