Skip to content

Commit

Permalink
2.3: More savegame safeguards. Closes ticket:2627.
Browse files Browse the repository at this point in the history
  • Loading branch information
perim committed May 1, 2011
1 parent cc156a6 commit fc0f878
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Expand Up @@ -3,7 +3,7 @@
* New: Two new 2 player maps - Vision and Roughness (commit:697afb16d5244f9715952f8762b1011c6d75101e)
* Change: Increase recycled experience storage in memory (commit:703665b4b7df1282eee29a7064961bc66152a847)
* Change: Set a window icon (ticket:2465, commit:ac792c67d4bb66618ae7ff712844c4eebb70a496)
* Fix: Prevent savegame corruption (ticket:2100, commit:a974722e397b7072fb59d0114e2a4ef9f8d509d8)
* Fix: Prevent savegame corruption (ticket:2100, commit:a974722e397b7072fb59d0114e2a4ef9f8d509d8, commit:cc156a668fb5291e38eab33ff77138a05e29fa28)
* Mods:
* Fix: 1.10 Balance (commit:9943ff3a4b67b0f64a9e2ee163c8ccac711be72e)
* Translations:
Expand Down
1 change: 1 addition & 0 deletions src/display3d.c
Expand Up @@ -1875,6 +1875,7 @@ void displayProximityMsgs( void )
}
else
{
if (!psProxDisp->psMessage->pViewData) continue; // sanity check
x = ((BASE_OBJECT *)psProxDisp->psMessage->pViewData)->pos.x;
y = ((BASE_OBJECT *)psProxDisp->psMessage->pViewData)->pos.y;
}
Expand Down
2 changes: 0 additions & 2 deletions src/objmem.c
Expand Up @@ -871,8 +871,6 @@ BASE_OBJECT *getBaseObjFromId(UDWORD id)
}
}
}
ASSERT(!"couldn't find a BASE_OBJ with ID", "getBaseObjFromId() failed for id %d", id);

return NULL;
}

Expand Down
12 changes: 1 addition & 11 deletions src/scriptobj.c
Expand Up @@ -740,9 +740,6 @@ BOOL scrValDefSave(INTERP_VAL *psVal, char *pBuffer, UDWORD *pSize)
RESEARCH *psResearch;
char *pPos;
DROID *psCDroid;
#ifdef _DEBUG
BASE_OBJECT *psObj;
#endif

switch (psVal->type)
{
Expand Down Expand Up @@ -780,12 +777,7 @@ BOOL scrValDefSave(INTERP_VAL *psVal, char *pBuffer, UDWORD *pSize)
else
{
*((UDWORD*)pBuffer) = ((BASE_OBJECT *)psVal->v.oval)->id;
#ifdef _DEBUG
psObj = getBaseObjFromId(((BASE_OBJECT *)psVal->v.oval)->id);
ASSERT( psObj == (BASE_OBJECT *)psVal->v.oval,"scrValDefSave failed to find object, continue" );
#endif
}

endian_udword((UDWORD*)pBuffer);
}
*pSize = sizeof(UDWORD);
Expand Down Expand Up @@ -1346,14 +1338,12 @@ BOOL scrValDefLoad(SDWORD version, INTERP_VAL *psVal, char *pBuffer, UDWORD size
psCDroid = (DROID *)getBaseObjFromId(id);
if (!psCDroid)
{
debug( LOG_FATAL, "scrValDefLoad: couldn't find object id %d", id );
abort();
debug(LOG_INFO, "Could not find object id %d", id);
}
else
{
grpJoin((DROID_GROUP*)(psVal->v.oval), psCDroid);
}

pPos += sizeof(UDWORD);
members -= 1;
}
Expand Down

0 comments on commit fc0f878

Please sign in to comment.