From 7480f036d3afd94d2bd2d079ed8870f0f8d0eaf8 Mon Sep 17 00:00:00 2001 From: Bukz Date: Sat, 16 Feb 2013 01:43:47 +0000 Subject: [PATCH] persistidents fixes (plz review/test) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7213 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/admin.cfg | 4 ++++ config/autosave.cfg | 4 +++- config/compatibility.cfg | 6 +++++- config/defaults.cfg | 7 ------- config/dyngamma.cfg | 2 ++ config/faq.cfg | 2 ++ config/favourites.cfg | 6 +++++- config/firstrun.cfg | 6 +++++- config/font.cfg | 3 +++ config/locale.cfg | 6 +++++- config/mdarray.cfg | 4 ++++ config/menus.cfg | 4 ++++ config/menus_bot.cfg | 4 ++++ config/menus_edit.cfg | 6 +++++- config/menus_multiplayer.cfg | 4 ++++ config/menus_settings.cfg | 4 ++++ config/menus_voicecom.cfg | 6 +++++- config/on_quit.cfg | 7 ++++++- config/prefabs.cfg | 6 +++++- config/scontext.cfg | 4 ++++ config/scripts.cfg | 3 ++- config/survival.cfg | 4 ++++ source/src/clientgame.cpp | 4 ++-- source/src/command.cpp | 24 ++++++++++++++++++------ source/src/main.cpp | 12 ++++++------ source/src/md2.h | 4 ++-- source/src/md3.h | 6 +++--- source/src/protos.h | 2 +- source/src/serverbrowser.cpp | 6 +++--- source/src/world.cpp | 4 ++-- source/src/worldio.cpp | 8 ++++---- 31 files changed, 126 insertions(+), 46 deletions(-) diff --git a/config/admin.cfg b/config/admin.cfg index a55c40d8..b9e65d98 100644 --- a/config/admin.cfg +++ b/config/admin.cfg @@ -1,3 +1,5 @@ +persistidents 0 + const kick [ callvote 0 $arg1 $arg2 ] const ban [ callvote 1 $arg1 $arg2 ] const removebans [ callvote 2 $arg1 ] @@ -22,3 +24,5 @@ const demo [ mode -1; map $_demofile ] ] + +persistidents 1 diff --git a/config/autosave.cfg b/config/autosave.cfg index 13a08e75..3b8507ba 100644 --- a/config/autosave.cfg +++ b/config/autosave.cfg @@ -1,4 +1,5 @@ persistidents 0 + checkinit mapstartalways [ if $autosavemap autoSaveCheck; numAutoSaves = 0 ] checkinit onNewMap [ if $autosavemap autoSaveCheck; numAutoSaves = 0 ] check2init autosavemap 0 // Autosavemap system disabled by default @@ -28,4 +29,5 @@ const doAutoSave [ ] addListOnQuit [autoSaveCheck execAutoSave doAutoSave numAutoSaves oldmapbackups] -persistidents 1 \ No newline at end of file + +persistidents 1 diff --git a/config/compatibility.cfg b/config/compatibility.cfg index da6e3ec1..78fc3244 100644 --- a/config/compatibility.cfg +++ b/config/compatibility.cfg @@ -1,5 +1,7 @@ // Makes old cubescripts compatible with newer versions of the game +persistidents 0 + const alive [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 alive) ] [ result (player1 alive) ] ] const currole [ if (&& $numargs (isclient $arg1)) [ result (player $arg1 role) ] [ result (player1 role) ] ] const curmode [ result $gamemode ] @@ -34,4 +36,6 @@ const orderscorecolumns [ sc_clientnum 6; sc_name 7; ] -] \ No newline at end of file +] + +persistidents 1 diff --git a/config/defaults.cfg b/config/defaults.cfg index 1dfb1294..cd3457e9 100644 --- a/config/defaults.cfg +++ b/config/defaults.cfg @@ -10,13 +10,6 @@ skin_rvsf (rnd 6) autoreload 1 // Reload the guns automatically by default. setfont default // Choose your font -// alternative weapon switching (more economic), no more 1-2-3-4 /wheel cycling no finger ever leaving WASD -// uncomment lines (remove the //) below to activate - -// delta_game_0 = [ if (= $arg1 1) [ primary ] [ secondary ] ] -// bind lshift [ grenades ] -// bind lalt [ melee ] - ofc_gamma_list = [] loop ogl (listlen $defaultmaps) [ add2list ofc_gamma_list $gamma ] diff --git a/config/dyngamma.cfg b/config/dyngamma.cfg index d4e1829f..d77c4c7c 100644 --- a/config/dyngamma.cfg +++ b/config/dyngamma.cfg @@ -1,4 +1,5 @@ persistidents 0 + // Initialize the list (if it doesn't already exist) using the current gamma as initial values. if (! (checkalias ofc_gamma_list)) [ ofc_gamma_list = [] @@ -32,4 +33,5 @@ check2init dyngamma 0 checkinit mapstartalways [ if $dyngamma [ if (strstr $defaultmaps (curmap 1)) [ gamma (at $ofc_gamma_list (findlist $defaultmaps (curmap 1))) ] ] ] + persistidents 1 diff --git a/config/faq.cfg b/config/faq.cfg index 50a2fc17..98682152 100644 --- a/config/faq.cfg +++ b/config/faq.cfg @@ -1,5 +1,6 @@ // generates the FAQ menu available from the first run menu or the help menu persistidents 0 + faqQuestions = [ "What is the fastest way to get help/support for AssaultCube?" "How do I determine what version of AssaultCube I have installed?" @@ -109,4 +110,5 @@ newmenu faq genFaq menuitem [] -1 menuitem [ Close] [ closemenu faq ] + persistidents 1 diff --git a/config/favourites.cfg b/config/favourites.cfg index 546ed20f..3dc8475f 100644 --- a/config/favourites.cfg +++ b/config/favourites.cfg @@ -42,6 +42,8 @@ // pongflags is bit-coded: bit 0: passworded, bit 1: banned, bit 2: blacklisted, bit 6: mastermode // these two example scripts check, if the server plays a map from either the official list or the mappack list +persistidents 0 + mpmap = [ (+ 1 (findlist $mappack_maps $arg1)) ] offmap = [ (+ 1 (findlist $defaultmaps $arg1)) ] @@ -93,4 +95,6 @@ addfavcategory MODE sbfavourite_MODE_desc = "Favourite game modes" sbfavourite_MODE_alpha = 0 sbfavourite_MODE_weight = 1 -sbfavourite_MODE_keys = "#42" // automatically add servers playing towel mode \ No newline at end of file +sbfavourite_MODE_keys = "#42" // automatically add servers playing towel mode + +persistidents 1 diff --git a/config/firstrun.cfg b/config/firstrun.cfg index b2eb3fc2..0a15d55a 100644 --- a/config/firstrun.cfg +++ b/config/firstrun.cfg @@ -1,5 +1,7 @@ // executed at first run, don't change +persistidents 0 + delayed_firstrun = [ music "pingpong/Ping_Pong_-_Kamikadze.ogg" 89000 " " // 90 secs, fade @@ -13,4 +15,6 @@ delayed_firstrun = [ showmenu [QUICK setup] ] -sleep 1000 [ delayed_firstrun ] \ No newline at end of file +sleep 1000 [ delayed_firstrun ] + +persistidents 1 \ No newline at end of file diff --git a/config/font.cfg b/config/font.cfg index 28099e0d..439bbf69 100644 --- a/config/font.cfg +++ b/config/font.cfg @@ -1,4 +1,6 @@ // To add your own fonts, create a seperate font file and execute like this: +persistidents 0 + exec config/font_default.cfg // Must be executed! DO NOT MODIFY. exec config/font_monospace.cfg // Must be executed! DO NOT MODIFY. exec config/font_serif.cfg @@ -55,3 +57,4 @@ fontchar 192 64 64 64 //5 [Green] fontchar 256 64 64 64 //6 [Yellow] fontchar 320 64 64 64 //7 [Red] +persistidents 1 diff --git a/config/locale.cfg b/config/locale.cfg index 38e3e92c..d149944d 100644 --- a/config/locale.cfg +++ b/config/locale.cfg @@ -1,6 +1,10 @@ // localization tools +persistidents 0 + // retrieves the localized version of a string based on the current locale _ = [ result (gettext $arg1) -] \ No newline at end of file +] + +persistidents 1 \ No newline at end of file diff --git a/config/mdarray.cfg b/config/mdarray.cfg index c59bd483..81116bda 100644 --- a/config/mdarray.cfg +++ b/config/mdarray.cfg @@ -1,4 +1,6 @@ // Cubescript Multidimensional Arrays +persistidents 0 + islists = [ bool = 0 loop i (listlen $arg1) [ @@ -203,3 +205,5 @@ MDArray_Add_To_Subarray = [ // some of these aliases can cause issues if they get stored in saved.cfg (missing bracket errors/etc.) addListOnQuit [bool MDArray_New_Subarray MDArray_Get_Bracket_Positions MDArray_Get reverseString MDArray_Get_All_Opening_Bracket_Positions MDArray_Get_Subarray_Count MDArray_Get_All_Subarray_Names extractSubarrayName MDArray_Search MDArray_Delete_Subarray MDArray_Modify_Subarray original_subarray target_elem new_elem new_subarray j next_elem islists hasQuotePair got_open_quote got_close_quote r i d mdarray subarray firstchar lastchar oldstr newstr subarray_names subarray_name tmpchar token subarrays search_results curarray orig_array target_subarray target_pos gotclose delstr h next_char] + +persistidents 1 diff --git a/config/menus.cfg b/config/menus.cfg index 07004fcd..8efbf831 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -1,3 +1,5 @@ +persistidents 0 + // check for an installed mappack mappack_version = 0; mappack_maps = []; mappack_flagmaps = [] exec config/menus_mappack.cfg @@ -132,3 +134,5 @@ exec config/menus_settings.cfg exec config/menus_multiplayer.cfg exec config/menus_voicecom.cfg exec config/favourites.cfg + +persistidents 1 diff --git a/config/menus_bot.cfg b/config/menus_bot.cfg index 566e4a53..5fbe1abf 100644 --- a/config/menus_bot.cfg +++ b/config/menus_bot.cfg @@ -1,5 +1,7 @@ // bot menus and tools +persistidents 0 + newmenu botmaps genbotmaps = [ @@ -169,3 +171,5 @@ newmenu [Delete all waypoints] menuinit [ delallwps = 0 ] // Ensures this menu works correctly. menuitemcheckbox [Yes, delete all waypoints: ] [delallwps = 1] [delallwps = $arg1] menuitem " 2 [ Apply! ]" [ if $delallwps wpclear [ showmenu [] ] ] + +persistidents 1 diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index 75aabb84..04006499 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -1,3 +1,5 @@ +persistidents 0 + newmenu editing menuitem [Mapmodels...] [ showmenu Mapmodels ] @@ -433,4 +435,6 @@ menuitemslider [Grid/Selection style: ] 0 1 "$oldselstyle" 1 [triangles "squares menuitemslider [Fly speeds multiplier: ] 1 5 "$flyspeed" 1 [] [ flyspeed $arg1 ] menuitemcheckbox [Enable auto save map: ] "$autosavemap" [ autosavemap = $arg1 ] menuitemslider [Time between auto saves (in minutes): ] 2 60 "$timeBetAutoSaves" 1 [] [ timeBetAutoSaves = (* $arg1 60000) ] -menuitemtextinput [Make a map backup (.BAK) every: ] "$numAutoSaveBackups" [ numAutoSaveBackups = $arg1 ] [] 4 \ No newline at end of file +menuitemtextinput [Make a map backup (.BAK) every: ] "$numAutoSaveBackups" [ numAutoSaveBackups = $arg1 ] [] 4 + +persistidents 1 \ No newline at end of file diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index aca0c35c..d8548eb6 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -1,3 +1,5 @@ +persistidents 0 + // Decides whether to open the admin or normal in-game menu. ingamemenu = [ if (currole) [ showmenu [In-game admin] ] [ showmenu In-game ] ] @@ -232,3 +234,5 @@ menuitem [] -1 menuitem " 2 [ Download the servers map version and join the game ]" [ getmap ] menuitem " 3 [ Keep the local map version and disconnect from the server ]" [ showmenu ""; disconnect ] menuinitselection 4 + +persistidents 1 diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index 22cafffd..309a5f46 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -1,3 +1,5 @@ +persistidents 0 + newmenu settings menuitem [Video settings] [ showmenu video ] @@ -621,3 +623,5 @@ menuitemtextinput [Knife: ] [gibmessage 0] [ gibmessage 0 $arg1 ] [] 15 menuitemtextinput [Shotgun: ] [gibmessage 3] [ gibmessage 3 $arg1 ] [] 15 menuitemtextinput [Sniper: ] [gibmessage 5] [ gibmessage 5 $arg1 ] [] 15 menuitemtextinput [Grenades: ] [gibmessage 8] [ gibmessage 8 $arg1 ] [] 15 + +persistidents 1 diff --git a/config/menus_voicecom.cfg b/config/menus_voicecom.cfg index 6a8687c9..20bc3bbf 100644 --- a/config/menus_voicecom.cfg +++ b/config/menus_voicecom.cfg @@ -1,3 +1,5 @@ +persistidents 0 + newmenu voicecom 1 1 menuitem [1. Team Replies] [ showmenu [Team Replies] ] @@ -63,4 +65,6 @@ genvcitem [Report In!] reportin newmenu [Public Talk] 1 1 genvcitem [Nice shot] niceshot 1 genvcitem [Thanks! "Thanks, man"] [thanks_1 thanks_2] 2 -genvcitem [Awesome Awesome!] [awesome_1 awesome_2] 3 \ No newline at end of file +genvcitem [Awesome Awesome!] [awesome_1 awesome_2] 3 + +persistidents 1 \ No newline at end of file diff --git a/config/on_quit.cfg b/config/on_quit.cfg index 3fd0cb4d..28880bcf 100644 --- a/config/on_quit.cfg +++ b/config/on_quit.cfg @@ -1,6 +1,8 @@ // Adds a list of aliases to be deleted (cleared from saved.cfg) on every quit. // Do not modify. (unless you really know what you're doing) +persistidents 0 + const addListOnQuit [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQuit (concat delalias (at $alias_list $al)) ] ] const on_quit_aliases [ @@ -15,6 +17,7 @@ const on_quit_aliases [ numcla numrvsf omit_idents + preload_music r s sbdesc @@ -41,4 +44,6 @@ const on_quit_aliases [ ] addListOnQuit $on_quit_aliases -addOnQuit [ delalias alias_list ] \ No newline at end of file +addOnQuit [ delalias alias_list ] + +persistidents 1 \ No newline at end of file diff --git a/config/prefabs.cfg b/config/prefabs.cfg index 5a13f6a5..736da7a9 100755 --- a/config/prefabs.cfg +++ b/config/prefabs.cfg @@ -2,6 +2,8 @@ // arch of 2xN cubes, i.e. 3 vertices [0..2] // archvertex // vertices not defined have a 0 delta +persistidents 0 + av = [ loop i $arg1 [ archvertex (+ $arg1 1) (+ $i 1) (at $arg2 $i) @@ -23,4 +25,6 @@ av 13 "8 13 16 18 19 19 19 19 19 18 16 13 8" // these last few can be improved av 14 "8 13 16 18 19 19 19 19 19 19 18 16 13 8" av 15 "8 13 16 18 19 19 19 19 19 19 19 18 16 13 8" -// add wider arches here! :) \ No newline at end of file +// add wider arches here! :) + +persistidents 1 diff --git a/config/scontext.cfg b/config/scontext.cfg index 31782554..f6418bc8 100644 --- a/config/scontext.cfg +++ b/config/scontext.cfg @@ -1,6 +1,8 @@ // define script security contexts to restrict commands to certain contexts // do NOT modify +persistidents 0 + // supported contexts context_core = 0 // hardcoded scripts context_cfg = 1 // known scripts @@ -22,3 +24,5 @@ isolatecontext $context_mdlcfg // secure this configuration for the rest of the game sealcontexts + +persistidents 1 diff --git a/config/scripts.cfg b/config/scripts.cfg index 814a8cf9..0efad7e2 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -1,5 +1,7 @@ // CubeScript placed in this file is automatically executed on each startup. +persistidents 0 + const MODES [tdm coop dm surv ts ctf pf btdm bdm lss osok tosok bosok htf tktf ktf tpf tlss bpf blss bts btosok] const MODEALIASES [map lms vip sendmap] @@ -432,4 +434,3 @@ run faq persistidents 1 execdir scripts -persistidents 0 diff --git a/config/survival.cfg b/config/survival.cfg index 67cdf8c7..710c10bd 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -8,6 +8,8 @@ // * The difficulty is "increased" over time, by spawning more and increasing the skill level of bots at "checkpoints". // * If the player dies, or leaves the "zone" for too long of a duration, the game ends. // * Total seconds survived, total number of enemies killed during, average amount of time between kills, and total damage dealt while alive are reported as stats when the game ends. +persistidents 0 + const survResetAliases [gotCheckPoint lastCheckPoint survIsFinished startedSurvival startedOBCount startPreSurvMillis startSurvMillis survKills survTeleported survTotalDmg survOrigSets changingspeed changinggamma] const resetSurvAliases [ @@ -214,3 +216,5 @@ const endSurvival [ // List of aliases that need to be cleared from saved.cfg on quit: const survAliases (concat $survResetAliases [resetSurvAliases genSurvDifStr survival tmpSurvSets curSurvDifficulty survLastKill survTimeBetKills startPreSurvMillis startSurvival startedSurvival setzone survOfcZones setOfcZones survMapIndex tmpSurvZone findCenter midZoneX midZoneY teleportPlayer survTeleported isInZone checkzone startOBCount startedOBCount startOBMillis backInZone tmpSCtr increaseDifficulty lastCheckPoint tmpSurvInt endSurvival tmp_survstr tmp_nargs survIsFinished tmpstrlist finalSurvMillis zone changegamma changespeed loops loopss increments incrementss curgamma targetgamma curspeed targetspeed applySurvDamageEffects survSetsList survDifList survSetDif survResetAliases survAliases]) addListOnQuit $survAliases + +persistidents 1 diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 66d36da7..11c83054 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -1155,9 +1155,9 @@ void startmap(const char *name, bool reset) // called just after a map load // run once if(firstrun) { - persistidents = false; + per_idents = false; execfile("config/firstrun.cfg"); - persistidents = true; + per_idents = true; firstrun = false; } // execute mapstart event once diff --git a/source/src/command.cpp b/source/src/command.cpp index 2410032d..c213e60c 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -17,11 +17,23 @@ int loop_level = 0; // avoid bad calls of b hashtable *idents = NULL; // contains ALL vars/commands/aliases -bool persistidents = true, neverpersist = false; -COMMANDF(persistidents, "i", (int *on) { - persistidents = neverpersist ? false : *on; +VAR(persistidents, 0, 1, 1); + +bool per_idents = true, neverpersist = false; +COMMANDF(per_idents, "i", (int *on) { + per_idents = neverpersist ? false : *on; }); +void ispersist() +{ + if (persistidents) + conoutf("persistidents is on"); + else + conoutf("persistidents is off"); +} + +COMMAND(ispersist, ""); + void clearstack(ident &id) { identstack *stack = id.stack; @@ -63,7 +75,7 @@ ident *newident(const char *name, int context = execcontext) ident *id = idents->access(name); if(!id) { - ident init(ID_ALIAS, newstring(name), newstring(""), persistidents, context); + ident init(ID_ALIAS, newstring(name), newstring(""), per_idents, context); id = &idents->access(init.name, init); } return id; @@ -153,7 +165,7 @@ void constant(const char *name, const char *action) ident *b = idents->access(name); if(!b) { - ident b(ID_ALIAS, newstring(name), newstring(action), persistidents, execcontext); + ident b(ID_ALIAS, newstring(name), newstring(action), false, execcontext); // never write consts to saved.cfg, too error prone - Bukz b.isconst = true; idents->access(b.name, b); return; @@ -177,7 +189,7 @@ void constant(const char *name, const char *action) { if(b->action!=b->executing) delete[] b->action; b->action = newstring(action); - if(b->persist!=persistidents) b->persist = persistidents; + //if(b->persist!=persistidents) b->persist = persistidents; } } else diff --git a/source/src/main.cpp b/source/src/main.cpp index 37084ecd..4a19d3fe 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -1110,7 +1110,7 @@ int main(int argc, char **argv) if(!notexture) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)"); initlog("console"); - persistidents = false; + per_idents = false; // Main font file, all other font files execute from here. if(!execfile("config/font.cfg")) fatal("cannot find default font definitions"); // Check these 2 standard fonts have been executed. @@ -1147,7 +1147,7 @@ int main(int argc, char **argv) exec("config/securemaps.cfg"); exec("config/admin.cfg"); execfile("config/servers.cfg"); - persistidents = true; + per_idents = true; static char resdata[] = { 112, 97, 99, 107, 97, 103, 101, 115, 47, 116, 101, 120, 116, 117, 114, 101, 115, 47, 107, 117, 114, 116, 47, 107, 108, 105, 116, 101, 50, 46, 106, 112, 103, 0 }; stream *f = opengzfile(resdata, "rb"); @@ -1173,9 +1173,9 @@ int main(int argc, char **argv) if(identexists("afterinit")) execute("afterinit"); if(compatibilitymode) { - persistidents = false; + per_idents = false; exec("config/compatibility.cfg"); // exec after saved.cfg to get "compatibilitymode", but before user scripts.. - persistidents = true; + per_idents = true; } execfile("config/autoexec.cfg"); execfile("config/auth.cfg"); @@ -1189,9 +1189,9 @@ int main(int argc, char **argv) preload_entmodels(); initlog("docs"); - persistidents = false; + per_idents = false; execfile("config/docs.cfg"); - persistidents = true; + per_idents = true; initlog("localconnect"); extern string clientmap; diff --git a/source/src/md2.h b/source/src/md2.h index 014c8eba..0d6113bc 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -258,7 +258,7 @@ struct md2 : vertmodel if(skin==notexture) conoutf(_("could not load model skin for %s"), name1); loadingmd2 = this; defformatstring(name2)("packages/models/%s/md2.cfg", loadname); - persistidents = false; + per_idents = false; neverpersist = true; if(!execfile(name2)) { @@ -266,7 +266,7 @@ struct md2 : vertmodel execfile(name2); } neverpersist = false; - persistidents = true; + per_idents = true; loadingmd2 = 0; loopv(parts) parts[i]->scaleverts(scale/16.0f, vec(translate.x, -translate.y, translate.z)); radius = calcradius(); diff --git a/source/src/md3.h b/source/src/md3.h index e16cc3e6..4f0c4bbf 100644 --- a/source/src/md3.h +++ b/source/src/md3.h @@ -215,19 +215,19 @@ struct md3 : vertmodel defformatstring(cfgname)("packages/models/%s/md3.cfg", loadname); loadingmd3 = this; - persistidents = false; + per_idents = false; neverpersist = true; if(execfile(cfgname) && parts.length()) // configured md3, will call the md3* commands below { neverpersist = false; - persistidents = true; + per_idents = true; loadingmd3 = NULL; if(parts.empty()) return false; loopv(parts) if(!parts[i]->filename) return false; } else // md3 without configuration, try default tris and skin { - persistidents = false; + per_idents = false; loadingmd3 = NULL; md3part &mdl = *new md3part; parts.add(&mdl); diff --git a/source/src/protos.h b/source/src/protos.h index a6a4053d..6fb0329d 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -781,7 +781,7 @@ extern bool checkchallenge(const char *answerstr, void *correct); extern void conoutf(const char *s, ...); // command -extern bool persistidents, neverpersist; +extern bool per_idents, neverpersist; extern int variable(const char *name, int min, int cur, int max, int *storage, void (*fun)(), bool persist); extern float fvariable(const char *name, float min, float cur, float max, float *storage, void (*fun)(), bool persist); extern char *svariable(const char *name, const char *cur, char **storage, void (*fun)(), bool persist); diff --git a/source/src/serverbrowser.cpp b/source/src/serverbrowser.cpp index eafd6e99..9aa57faa 100644 --- a/source/src/serverbrowser.cpp +++ b/source/src/serverbrowser.cpp @@ -786,8 +786,8 @@ void addfavcategory(const char *refdes) if(!text[0]) { intret(0); return; } loopv(favcats) if(!strcmp(favcats[i], text)) { intret(i + 1); return; } favcats.add(newstring(text)); - bool oldpersist = persistidents; - persistidents = false; // only keep changed values + bool oldpersist = per_idents; + per_idents = false; // only keep changed values loopi(FC_NUM) alx[i] = getalias(favcatargname(text, i)) ? 1 : 0; loopi(3) { @@ -798,7 +798,7 @@ void addfavcategory(const char *refdes) const int defk[] = { FC_WEIGHT, FC_DESC, FC_TAG, FC_KEYS, FC_IGNORE, FC_ALPHA }; const char *defv[] = { "0", val, refdes, "", "", "20" }; loopi(sizeof(defk)/sizeof(defk[0])) { if(!alx[defk[i]]) alias(favcatargname(text, defk[i]), defv[i]); } - persistidents = oldpersist; + per_idents = oldpersist; intret(favcats.length()); } diff --git a/source/src/world.cpp b/source/src/world.cpp index 3b7eaafc..912ef66c 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -514,11 +514,11 @@ bool empty_world(int factor, bool force) // main empty world creation routine if(clearmap) { pushscontext(IEXC_MAPCFG); - persistidents = false; + per_idents = false; neverpersist = true; execfile("config/default_map_settings.cfg"); neverpersist = false; - persistidents = true; + per_idents = true; popscontext(); setvar("fullbright", 1); fullbrightlight(); diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index e5396927..5bf757bd 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -690,13 +690,13 @@ bool load_world(char *mname) // still supports all map formats that have conoutf("read map %s rev %d (%d milliseconds)", cgzname, hdr.maprevision, watch.stop()); conoutf("%s", hdr.maptitle); pushscontext(IEXC_MAPCFG); // untrusted altogether - persistidents = false; + per_idents = false; neverpersist = true; execfile("config/default_map_settings.cfg"); execfile(pcfname); execfile(mcfname); neverpersist = false; - persistidents = true; + per_idents = true; popscontext(); c2skeepalive(); @@ -841,13 +841,13 @@ void listmapdependencies(char *mapname) // print map dependencies to file allmods[0] = '\0'; enumeratek(usedmods, const char *, key, concatformatstring(allmods, "%s%s",*allmods ? ", " : "", key); delete key; usedm++); pushscontext(IEXC_MAPCFG); // untrusted altogether - persistidents = false; + per_idents = false; neverpersist = true; execfile(mcfname); f->printf(" used: %s%s %d total packages (%s.cfg)\n", allmods, usedm ? ", " : "", usedm, mapname); if(usedm) conoutf(" used: %s (%s.cfg) in %s", allmods, mapname, mapname); neverpersist = false; - persistidents = true; + per_idents = true; popscontext(); f->printf("\n\n"); }