]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 9fb61c230fac807e913d5293120cf329f449b15b..10c3900408e1dd3cd818f9c2715729c5c52060b7 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 62fabd2aa80cb85583bea7044f45f28ee6359f5c..940eb32120944a4643a758e50ab8097178c2d72d 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;