Save game after initial character created, in case they quick.

This commit is contained in:
Martin Haye 2017-09-09 10:08:06 -07:00
parent f33aa1f143
commit b8e89af594
2 changed files with 6 additions and 11 deletions

View File

@ -224,8 +224,7 @@ def _rwGame(cmd)#0
end
///////////////////////////////////////////////////////////////////////////////////////////////////
def saveInternal()#0
def _saveGame()#1
// Never save corrupted heap
mmgr(CHECK_MEM, 0)
@ -235,12 +234,6 @@ def saveInternal()#0
// Copy data to main memory, and write it out.
memcpy(HEAP_BOTTOM, LOAD_SAVE_BUF, HEAP_SIZE) // LC to low mem
_rwGame(RWTS_WRITE)
end
///////////////////////////////////////////////////////////////////////////////////////////////////
def _saveGame()#1
showMapName("Saving game...")
saveInternal()
return 0
end
@ -331,7 +324,7 @@ def importGame()#1
loadInternal()
puts("\n Game imported.")
reinsert()
saveInternal()
_saveGame()
return TRUE
fin
puts("\n Not found.")

View File

@ -2091,7 +2091,6 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Called by scripts to display a string. We set the flag noting that something has been
// displayed, then use an assembly routine to do the work.
// Also, clear the keyboard strobe, so the player has time to read the text.
export def scriptDisplayStr(str)#0
if pIntimate
pIntimate=>intimate_displayStr(str)
@ -2304,7 +2303,7 @@ export def removeFromList(pList, toRemove)#0
end
///////////////////////////////////////////////////////////////////////////////////////////////////
def saveMapPos()#0
export def saveMapPos()#0
global->b_mapIs3D = mapIs3D
global->b_mapNum = mapNum
getPos(@global=>w_mapX, @global=>w_mapY)
@ -2516,6 +2515,8 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
def saveGame()#1
saveMapPos()
flipToPage1()
showMapName("Saving game...")
loadEngine(MOD_DISKOPS)=>diskops_saveGame()
returnFromEngine(TRUE)
return 0
@ -3126,6 +3127,7 @@ def startGame(ask)#0
allowZoneInit = TRUE
initMap(q_x, q_y, q_dir)
allowZoneInit = FALSE
saveGame()
else
q_mapNum = 0
restoreMapPos()