From: Penguinum Date: Mon, 18 May 2015 19:20:07 +0000 (+0300) Subject: Moved code from g_triggers.qc to better place X-Git-Tag: xonotic-v0.8.1~40^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=256fc2b13ac54b138d204d660b4956bce004bc3b;p=xonotic%2Fxonotic-data.pk3dir.git Moved code from g_triggers.qc to better place --- diff --git a/qcsrc/client/wall.qh b/qcsrc/client/wall.qh index cfed79050..dca8f1d3e 100644 --- a/qcsrc/client/wall.qh +++ b/qcsrc/client/wall.qh @@ -12,7 +12,7 @@ .float alpha_max, alpha_min; .float fade_start, fade_end; .float default_solid; // Variable to store default self.solid for clientwalls -.float clientwall_flag; +.float antiwall_flag; void Ent_Wall_Draw(); diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index bd23500c8..d00b4de29 100644 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@ -34,6 +34,22 @@ void g_clientmodel_setcolormaptoactivator (void) void g_clientmodel_use(void) { + if (self.antiwall_flag == 1) + { + self.inactive = 1; + } + else if (self.antiwall_flag == 2) + { + self.inactive = 0; + } + if (self.inactive) + { + self.solid = SOLID_NOT; + } + else + { + self.solid = self.default_solid; + } g_clientmodel_setcolormaptoactivator(); } diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index e2d088ae9..7b7fe131c 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -105,7 +105,7 @@ void SUB_UseTargets() { // Flag to set func_clientwall state // 1 == deactivate, 2 == activate, 0 == do nothing - float aw_inactive = self.clientwall_flag; + float aw_inactive = self.antiwall_flag; for(t = world; (t = find(t, targetname, s)); ) if(t.use) { @@ -116,24 +116,7 @@ void SUB_UseTargets() else { if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary") - { - if (aw_inactive == 1) - { - t.inactive = 1; - } - else if (aw_inactive == 2) - { - t.inactive = 0; - } - if (t.inactive) - { - t.solid = SOLID_NOT; - } - else - { - t.solid = t.default_solid; - } - } + t.antiwall_flag = aw_inactive; self = t; other = stemp; activator = act; diff --git a/qcsrc/server/g_triggers.qh b/qcsrc/server/g_triggers.qh index 12b57cbf4..1bc097fbe 100644 --- a/qcsrc/server/g_triggers.qh +++ b/qcsrc/server/g_triggers.qh @@ -386,7 +386,7 @@ void spawnfunc_target_changelevel_use(); void spawnfunc_target_changelevel(); -.float clientwall_flag; // Variable to define what to do with func_clientwall +.float antiwall_flag; // Variable to define what to do with func_clientwall // 0 == do nothing, 1 == deactivate, 2 == activate #endif