Skip to content

Commit fc0f878

Browse files
committedMay 1, 2011
2.3: More savegame safeguards. Closes ticket:2627.
1 parent cc156a6 commit fc0f878

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed
 

‎ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* New: Two new 2 player maps - Vision and Roughness (commit:697afb16d5244f9715952f8762b1011c6d75101e)
44
* Change: Increase recycled experience storage in memory (commit:703665b4b7df1282eee29a7064961bc66152a847)
55
* Change: Set a window icon (ticket:2465, commit:ac792c67d4bb66618ae7ff712844c4eebb70a496)
6-
* Fix: Prevent savegame corruption (ticket:2100, commit:a974722e397b7072fb59d0114e2a4ef9f8d509d8)
6+
* Fix: Prevent savegame corruption (ticket:2100, commit:a974722e397b7072fb59d0114e2a4ef9f8d509d8, commit:cc156a668fb5291e38eab33ff77138a05e29fa28)
77
* Mods:
88
* Fix: 1.10 Balance (commit:9943ff3a4b67b0f64a9e2ee163c8ccac711be72e)
99
* Translations:

‎src/display3d.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,7 @@ void displayProximityMsgs( void )
18751875
}
18761876
else
18771877
{
1878+
if (!psProxDisp->psMessage->pViewData) continue; // sanity check
18781879
x = ((BASE_OBJECT *)psProxDisp->psMessage->pViewData)->pos.x;
18791880
y = ((BASE_OBJECT *)psProxDisp->psMessage->pViewData)->pos.y;
18801881
}

‎src/objmem.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,6 @@ BASE_OBJECT *getBaseObjFromId(UDWORD id)
871871
}
872872
}
873873
}
874-
ASSERT(!"couldn't find a BASE_OBJ with ID", "getBaseObjFromId() failed for id %d", id);
875-
876874
return NULL;
877875
}
878876

‎src/scriptobj.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,6 @@ BOOL scrValDefSave(INTERP_VAL *psVal, char *pBuffer, UDWORD *pSize)
740740
RESEARCH *psResearch;
741741
char *pPos;
742742
DROID *psCDroid;
743-
#ifdef _DEBUG
744-
BASE_OBJECT *psObj;
745-
#endif
746743

747744
switch (psVal->type)
748745
{
@@ -780,12 +777,7 @@ BOOL scrValDefSave(INTERP_VAL *psVal, char *pBuffer, UDWORD *pSize)
780777
else
781778
{
782779
*((UDWORD*)pBuffer) = ((BASE_OBJECT *)psVal->v.oval)->id;
783-
#ifdef _DEBUG
784-
psObj = getBaseObjFromId(((BASE_OBJECT *)psVal->v.oval)->id);
785-
ASSERT( psObj == (BASE_OBJECT *)psVal->v.oval,"scrValDefSave failed to find object, continue" );
786-
#endif
787780
}
788-
789781
endian_udword((UDWORD*)pBuffer);
790782
}
791783
*pSize = sizeof(UDWORD);
@@ -1346,14 +1338,12 @@ BOOL scrValDefLoad(SDWORD version, INTERP_VAL *psVal, char *pBuffer, UDWORD size
13461338
psCDroid = (DROID *)getBaseObjFromId(id);
13471339
if (!psCDroid)
13481340
{
1349-
debug( LOG_FATAL, "scrValDefLoad: couldn't find object id %d", id );
1350-
abort();
1341+
debug(LOG_INFO, "Could not find object id %d", id);
13511342
}
13521343
else
13531344
{
13541345
grpJoin((DROID_GROUP*)(psVal->v.oval), psCDroid);
13551346
}
1356-
13571347
pPos += sizeof(UDWORD);
13581348
members -= 1;
13591349
}

0 commit comments

Comments
 (0)