- Reverted the changes from Revision 5270, because it crashes the map editor on saving

- I hope now, maps saved with a Map Editor Version <= 5216 will now load again and can be saved without problems.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5271 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-05-14 09:25:44 +00:00
parent 4f10c38a49
commit b541d759a8
2 changed files with 14 additions and 5 deletions
+13 -4
View File
@@ -2388,10 +2388,18 @@ BOOLEAN StackedObjectData::Load( INT8** hBuffer, float dMajorMapVersion, UINT8 u
{
int size;
// Flugente: changed this, otherwise game would crash when reading WF maps if class ObjectData was different. this is a rough fix and by no means perfect
// LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) );
// +1 because we have to account for endOfPOD itself
LOADDATA(&(this->data), *hBuffer, SIZEOF_OBJECTDATA_POD+1 );
// When saving maps with the new map editor that has weapon overheated feature included!
if (dMajorMapVersion >= 7 && ubMinorMapVersion >= 28)
{
// Flugente: changed this, otherwise game would crash when reading WF maps if class ObjectData was different. this is a rough fix and by no means perfect
LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) );
}
else
{
// WF Maps have old format
// +1 because we have to account for endOfPOD itself
LOADDATA(&(this->data), *hBuffer, SIZEOF_OBJECTDATA_POD+1 );
}
LOADDATA(&size, *hBuffer, sizeof(int) );
attachments.resize(size);
@@ -2408,6 +2416,7 @@ BOOLEAN StackedObjectData::Load( INT8** hBuffer, float dMajorMapVersion, UINT8 u
return TRUE;
}
BOOLEAN StackedObjectData::Load( HWFILE hFile )
{
UINT32 uiNumBytesRead;