aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-03 15:52:05 +0000
committerTorbjörn Andersson2004-01-03 15:52:05 +0000
commitc1cddedca88a3a5c7ea01b81ecef5fc869717d5c (patch)
tree2212f5807f3e36bccd214e2fc8046035313c8f86 /sword2
parentfa523f7f7ecbe844901d3b3f08456cea2541f0bc (diff)
downloadscummvm-rg350-c1cddedca88a3a5c7ea01b81ecef5fc869717d5c.tar.gz
scummvm-rg350-c1cddedca88a3a5c7ea01b81ecef5fc869717d5c.tar.bz2
scummvm-rg350-c1cddedca88a3a5c7ea01b81ecef5fc869717d5c.zip
Fixed bug that made ScummVM crash when loading a savegame where the main
character was walking. (I had missed a case where pointers were cast to integers.) svn-id: r12113
Diffstat (limited to 'sword2')
-rw-r--r--sword2/save_rest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index af0f0fe206..08f3373e72 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -350,7 +350,7 @@ uint32 Sword2Engine::restoreFromBuffer(Memory *buffer, uint32 size) {
varsRes = _resman->openResource(1);
// copy that to the buffer, following the header
- memcpy(varsRes, buffer->ad + sizeof(_saveGameHeader), _saveGameHeader.varLength );
+ memcpy(varsRes, buffer->ad + sizeof(_saveGameHeader), _saveGameHeader.varLength);
#ifdef SCUMM_BIG_ENDIAN
uint32 *globalVars = (uint32 *) (varsRes + sizeof(StandardHeader));
@@ -583,10 +583,10 @@ int32 Logic::fnGetPlayerSaveData(int32 *params) {
ob_mega->currently_walking = 0;
// pointer to object's graphic structure
- pars[0] = (int32) ob_graphic;
+ pars[0] = _vm->_memory->ptrToInt((const uint8 *) ob_graphic);
// pointer to object's mega structure
- pars[1] = (int32) ob_mega;
+ pars[1] = _vm->_memory->ptrToInt((const uint8 *) ob_mega);
// target direction
pars[2] = ob_mega->current_dir;