summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-08-28 23:37:35 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-08-30 21:46:05 +0100
commit3acea30a35983df9d43d114d044109df1ad90931 (patch)
tree59e8bd9c29a691d663016b5f8ba0f92f7756d853
parentcbbe8a87093995bcdec71771aca42dc098a4b37b (diff)
Only register portal colour cvars in Portal
-rw-r--r--src/portalcolours.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/portalcolours.c b/src/portalcolours.c
index 48e4ee0..33a6020 100644
--- a/src/portalcolours.c
+++ b/src/portalcolours.c
@@ -34,11 +34,11 @@ REQUIRE_GLOBAL(clientlib)
// It's like the thing Portal Tools does, but at runtime!
-DEF_CVAR(sst_portal_colour0, "Crosshair colour for gravity beam (hex)",
+DEF_CVAR_UNREG(sst_portal_colour0, "Crosshair colour for gravity beam (hex)",
"F2CAA7", CON_ARCHIVE | CON_HIDDEN)
-DEF_CVAR(sst_portal_colour1, "Crosshair colour for left portal (hex)",
+DEF_CVAR_UNREG(sst_portal_colour1, "Crosshair colour for left portal (hex)",
"40A0FF", CON_ARCHIVE | CON_HIDDEN)
-DEF_CVAR(sst_portal_colour2, "Crosshair colour for right portal (hex)",
+DEF_CVAR_UNREG(sst_portal_colour2, "Crosshair colour for right portal (hex)",
"FFA020", CON_ARCHIVE | CON_HIDDEN)
static struct rgba colours[3] = {
{242, 202, 167, 255}, {64, 160, 255, 255}, {255, 160, 32, 255}};
@@ -122,7 +122,11 @@ static bool find_UTIL_Portal_Color(void *base) {
}
PREINIT {
- return GAMETYPE_MATCHES(Portal1);
+ if (!GAMETYPE_MATCHES(Portal1)) return false;
+ con_reg(sst_portal_colour0);
+ con_reg(sst_portal_colour1);
+ con_reg(sst_portal_colour2);
+ return true;
}
INIT {