Restore the old persistidents system from AC 1.0, since it's working as
intended - if used properly.
As a reminder:
* aliases created by "const" and "tempalias" are never persistent
* aliases created or altered by "alias" or "=" become persistent, if
the persistidents flag is set during that operation
* persistidents if false during the execution of almost all config files
during game start - those files can create aliases with default values
which will not be persistent (until changed later while the flag is
set)
* before saved.cfg is executed, the flag is set and stays set all
throughout the game - which means, that all changes (from menus, for
example) will change the altered alias to "persistent"
* exceptions for map or model config files are unnecessary, since those
run restricted and can't create aliases anyway
* exceptions are necessary for "late run" config files like those in
config/opt/
The new command "persistidents" may be used to manually set or clear the
flag. It also returns the current state of the flag. If used in a config
file, the flag is restored to its original value when the file ends
execution.
In short: only late-run config files (meaning: run after saved.cfg was
restored) may need to manually set/reset the flag. Use const and tempalias
where appropriate and clear persistidents before creating an alias with a
not-to-save default value that may be changed and made persistent later.
DOCREF persistidents
26 lines
1.1 KiB
INI
26 lines
1.1 KiB
INI
const kick [if $numargs [if (> $numargs 1) [loop i (- $numargs 2) [alias arg2 (concat $arg2 (getalias (concatword arg (+ $i 3)))) ] ] [] ; callvote 0 $arg1 $arg2 ] ]
|
|
const ban [if $numargs [if (> $numargs 1) [loop i (- $numargs 2) [alias arg2 (concat $arg2 (getalias (concatword arg (+ $i 3)))) ] ] [] ; callvote 1 $arg1 $arg2 ] ]
|
|
const removebans [ callvote 2 $arg1 ]
|
|
const mastermode [ callvote 3 $arg1 ]
|
|
const autoteam [ callvote 4 $arg1 ]
|
|
const forceteam [ callvote 5 $arg1 $arg2 ]
|
|
const forceme [ if $numargs [ forceteam (player1 cn) $arg1 ] [ if (checkrange (player1 team) 0 1) [ forceteam (player1 cn) (! (player1 team)) ] ] ]
|
|
const giveadmin [ callvote 6 $arg1 ]
|
|
const map [ callvote 7 $arg1 $arg2 ]
|
|
const recorddemo [ callvote 8 1 ]
|
|
const cleardemo [ callvote 10 $arg1 ]
|
|
const cleardemos [ callvote 10 0 ]
|
|
const serverdesc [ callvote 11 $arg1 ]
|
|
const shuffleteams [ callvote 12 ]
|
|
|
|
const demo [
|
|
tempalias _demofile $arg1
|
|
if $connected [
|
|
addOnLoadOnce [ mode -1; map $_demofile ]
|
|
disconnect
|
|
] [
|
|
mode -1; map $_demofile
|
|
]
|
|
]
|
|
|