Brief: //dnl ch74

- Couple map editor fixes.
Details:
- Map loading not properly set Vanilla global variable switch.
- Loading AIMNAS maps of version 28 cause CTD due to incorrect StackedObjectData loading sizeof.
- Only in editor mode and if NAS setting is on inseparable and default attachments will be always add, but default attachments will not, so older maps should be converted from mapeditor to new version.
- Fix CTD if try to place items from tab selection which contains no items.
- There was missing part from ch4 for mouse wheel support in mapeditor.
- There was conflict between keyboard and mouse events creating problems when try to select taskbar options by mouse.
- Fix annoying message of using improper attachment during item place if item consist of default or inseparable attachments.
- Remove hints to display if loading map from editor.
- Fix CTD if have previously selected merc and loading another (smaller) map.
- Saving map as Vanilla will check if attachment is valid for 1.12, that means you will lost some stuff from NIV if save in Vanilla mode, so you should always save map in newest format if want play map in 1.13.
- Add correct weight recalculation when saving in Vanilla format using old OBJECTTYPE.
- Remove entry points check during map save as Scheinworld reported problem with basement levels and similar maps which doesn't need entry points.
- Fix displaying wrong map version in summary window because MapInfo is incorrectly saved in all previous mapeditors.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6530 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-10-25 18:48:37 +00:00
parent c5e72c4265
commit f008316275
12 changed files with 101 additions and 46 deletions
+12 -5
View File
@@ -2284,10 +2284,9 @@ BOOLEAN SaveWorld(const STR8 puiFilename, FLOAT dMajorMapVersion, UINT8 ubMinorM
if( uiFlags & MAP_WORLDLIGHTS_SAVED )
{
SaveMapLights( hfile );
}
#if 0//dnl ch74 191013 from 050611 Scheinworld reported problem with basement levels and similar maps which doesn't need entry points so decide to remove this check completely
if(gMapInformation.sCenterGridNo == -1 || gMapInformation.ubEditorSmoothingType == SMOOTHING_NORMAL && (gMapInformation.sNorthGridNo == -1 && gMapInformation.sEastGridNo == -1 && gMapInformation.sSouthGridNo == -1 && gMapInformation.sWestGridNo == -1))//dnl ch17 290909
{
swprintf(gzErrorCatchString, L"SAVE ABORTED! Center and at least one of (N,S,E,W) entry point should be set.");
@@ -2295,6 +2294,8 @@ BOOLEAN SaveWorld(const STR8 puiFilename, FLOAT dMajorMapVersion, UINT8 ubMinorM
FileClose(hfile);
return(FALSE);
}
#endif
gMapInformation.ubMapVersion = ubMinorMapVersion;//dnl ch74 241013 all this years MapInfo saves incorrect version :-(
SaveMapInformation(hfile, dMajorMapVersion, ubMinorMapVersion);//dnl ch33 150909
if( uiFlags & MAP_FULLSOLDIER_SAVED )
@@ -2602,6 +2603,8 @@ BOOLEAN EvaluateWorld(STR8 pSector, UINT8 ubLevel)
// Read Map Information
pSummary->MapInfo.Load(&pBuffer, dMajorMapVersion);
if(pSummary->MapInfo.ubMapVersion != ubMinorMapVersion)//dnl ch74 241013 stupid fix because MapInfo is incorrectly saved in all previous mapeditor if you edit existing map
pSummary->MapInfo.ubMapVersion = ubMinorMapVersion;
if(uiFlags & MAP_FULLSOLDIER_SAVED)
{
@@ -2882,7 +2885,8 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
gfCaves = FALSE;
// Flugente: select loadscreen hint
SetNewLoadScreenHint();
if(!gfEditMode)//dnl ch74 211013
SetNewLoadScreenHint();
SetRelativeStartAndEndPercentage(0, 0, 1, L"Trashing world...");
#ifdef JA2TESTVERSION
@@ -2919,7 +2923,8 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
// We enlarge the map
SetWorldSize(iNewMapWorldRows, iNewMapWorldCols);
// Uncheck "vanilla map saving", because it is not allowed on maps > 160x160
// Uncheck "vanilla map saving", because it is not allowed on maps > 160x160
gfVanillaMode = FALSE;//dnl ch74 191013
UnclickEditorButton(OPTIONS_VANILLA_MODE);
// Reset
@@ -2933,12 +2938,14 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
// We still have the "normal" map size AND the map is saved in vanilla format
if ((iRowSize <= OLD_WORLD_ROWS && iRowSize <= OLD_WORLD_COLS) && (dMajorMapVersion == VANILLA_MAJOR_MAP_VERSION && ubMinorMapVersion == VANILLA_MINOR_MAP_VERSION))
{
// Check "vanilla map saving"
// Check "vanilla map saving"
gfVanillaMode = TRUE;//dnl ch74 191013
ClickEditorButton(OPTIONS_VANILLA_MODE);
}
else
{
// Uncheck "vanilla map saving"
gfVanillaMode = FALSE;//dnl ch74 191013
UnclickEditorButton(OPTIONS_VANILLA_MODE);
}
}