summaryrefslogtreecommitdiffhomepage
path: root/src/demorec.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2021-12-29 18:14:01 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2021-12-29 18:18:42 +0000
commitd40d588f6d7cf866f7de41db9efffdd6c1a05135 (patch)
treecc1ff1eaecf3680815d7b30776f8b6264b0242e3 /src/demorec.c
parent8eecc029568bbe8e2f3c0d9af218ad3f957251c9 (diff)
Make convar init macro type-generic
This removes the need to call atof() on each cvar on plugin load; now all that's required is the memory allocations for the string values. The syntax is also a bit nicer since numbers can just be numbers rather than quoted strings. Minor issue: specifying a string value that also happens to be numeric will break this since the numeric representation will be zero, but I can't see a reason this would ever happen. Also, add a DEF_CVAR_MAX just for completeness.
Diffstat (limited to 'src/demorec.c')
-rw-r--r--src/demorec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/demorec.c b/src/demorec.c
index c4ac504..dda692f 100644
--- a/src/demorec.c
+++ b/src/demorec.c
@@ -49,8 +49,8 @@ static int nbits_datalen;
static int auto_demonum = 1;
static bool auto_recording = false;
-DEF_CVAR(sst_autorecord, "Continue recording demos through map changes",
- "1", CON_ARCHIVE | CON_HIDDEN)
+DEF_CVAR(sst_autorecord, "Continue recording demos through map changes", 1,
+ CON_ARCHIVE | CON_HIDDEN)
static void VCALLCONV hook_StopRecording(void *this) {
// This hook will get called twice per loaded save (in most games/versions,