Move some antiwall handling out of the main trigger code
authorMario <mario@smbclan.net>
Tue, 9 Oct 2018 11:13:36 +0000 (21:13 +1000)
committerMario <mario@smbclan.net>
Tue, 9 Oct 2018 11:13:36 +0000 (21:13 +1000)
qcsrc/common/mapobjects/models.qc
qcsrc/common/mapobjects/triggers.qc

index 9fb61c2..10c3900 100644 (file)
@@ -41,6 +41,11 @@ void g_clientmodel_setcolormaptoactivator(entity this, entity actor, entity trig
 
 void g_clientmodel_use(entity this, entity actor, entity trigger)
 {
+       // Flag to set func_clientwall state
+       // 1 == deactivate, 2 == activate, 0 == do nothing
+       if(this.classname == "func_clientwall" || this.classname == "func_clientillusionary")
+               this.antiwall_flag = trigger.antiwall_flag;
+
        if (this.antiwall_flag == 1)
        {
                this.inactive = 1;
index 62fabd2..940eb32 100644 (file)
@@ -302,9 +302,6 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe
                }
                if (s != "")
                {
-                       // Flag to set func_clientwall state
-                       // 1 == deactivate, 2 == activate, 0 == do nothing
-                       int aw_flag = this.antiwall_flag;
                        for(entity t = NULL; (t = find(t, targetname, s)); )
                        {
                                if(t.use && (t.sub_target_used != time || !preventReuse))
@@ -315,9 +312,6 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe
                                        }
                                        else
                                        {
-                                               if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary")
-                                                       t.antiwall_flag = aw_flag;
-
                                                t.use(t, actor, this);
                                                if(preventReuse)
                                                        t.sub_target_used = time;