From: Mario Date: Wed, 17 Oct 2018 08:44:23 +0000 (+1000) Subject: Disallow enabling r_water via mapinfo, automatically enable it on maps with warpzones... X-Git-Tag: xonotic-v0.8.5~1761 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=d13b85731d2a23db27bb221646b3701a06e8f350;ds=sidebyside Disallow enabling r_water via mapinfo, automatically enable it on maps with warpzones and cameras --- diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 384513521d..6fbb7ce896 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -674,4 +674,4 @@ void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame void MapInfo_Shutdown(); // call this in the shutdown handler #define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl") -#define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* +*" +#define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* -r_water +*" diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 183302b3a1..a7e9c42104 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1298,6 +1298,7 @@ float matchacl(string acl, string str) if(s == t) { r = d; + break; // if we found a killing case, apply it! other settings may be allowed in the future, but this one is caught } } return r; diff --git a/qcsrc/lib/warpzone/client.qc b/qcsrc/lib/warpzone/client.qc index 3a6765e9d4..7f8b0cdc83 100644 --- a/qcsrc/lib/warpzone/client.qc +++ b/qcsrc/lib/warpzone/client.qc @@ -28,6 +28,8 @@ void WarpZone_Fade_PreDraw(entity this) void WarpZone_Touch(entity this, entity toucher); NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew) { + if(!warpzone_warpzones_exist) + cvar_settemp("r_water", "1"); // HACK for DarkPlaces: always enable reflections when a map has warpzones warpzone_warpzones_exist = 1; if (!this.enemy) { @@ -84,6 +86,8 @@ NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew) NET_HANDLE(ENT_CLIENT_WARPZONE_CAMERA, bool isnew) { + if(!warpzone_cameras_exist) + cvar_settemp("r_water", "1"); // HACK for DarkPlaces: always enable reflections when a map has cameras warpzone_cameras_exist = 1; this.classname = "func_warpzone_camera";