autosave/dyngamma fixes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7184 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2013-02-10 12:02:11 +00:00
parent c7fe8d18cb
commit a5d85bce20
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -3,12 +3,12 @@ checkinit mapstartalways [ if $autosavemap autoSaveCheck; numAutoSaves = 0 ]
checkinit onNewMap [ if $autosavemap autoSaveCheck; numAutoSaves = 0 ]
check2init autosavemap 0 // Autosavemap system disabled by default
check2init timeBetAutoSaves 300000 // Once every 5 minutes.
check2init numAutoSaveBackups 12 // Make a map .bak every 12 autosaves by default
check2init numAutoSaveBackups 3 // Make a map .bak every 3 autosaves (15 minutes) by default
const autoSaveCheck [ sleep $timeBetAutoSaves [ doAutoSave ] 1 ]
const execAutoSave [
+= numAutoSaves 1
++ numAutoSaves
oldmapbackups = $mapbackupsonsave
if (|| (!= $numAutoSaveBackups $numAutoSaves) (= $numAutoSaveBackups 0)) [ mapbackupsonsave 0 ] [ numAutoSaves = 0 ] // Temporarily turn off map backups to avoid clutter.
savemap (curmap 1)
@@ -20,7 +20,7 @@ const doAutoSave [
if $autosavemap [
if (&& (! (strstr $defaultmaps (curmap 1))) (strlen (curmap 1))) [
if $editing execAutoSave [
if (= $gamemode (coop -1)) execAutoSave
if (= $gamemode (modenum coop)) execAutoSave
]
]
]
+1 -1
View File
@@ -10,7 +10,7 @@ if (! (checkalias ofc_gamma_list)) [
// setgamma - allows clients to set custom gamma values for each official map, disabling/enabling the entire system
// can be done with the dyngamma variable.
const setgamma [
if (&& (<= $arg1 300) (>= $arg1 30)) [
if (checkrange $arg1 30 300) [
if (strstr $defaultmaps (curmap 1)) [
tmp_gamma_list = $ofc_gamma_list
ofc_gamma_list = []