]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Moved code from g_triggers.qc to better place
authorPenguinum <penguinum@gmail.com>
Mon, 18 May 2015 19:20:07 +0000 (22:20 +0300)
committerPenguinum <penguinum@gmail.com>
Mon, 18 May 2015 19:20:07 +0000 (22:20 +0300)
qcsrc/client/wall.qh
qcsrc/server/g_models.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_triggers.qh

index cfed790500a807bc09dc217707667da6aa5de7d9..dca8f1d3e4ef698f3fee0a88ff3865d8a805714b 100644 (file)
@@ -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();
 
index bd23500c840690931ad8c99379f3c9cb3a3b3314..d00b4de29bf2fba84c69a9fb0d39b768ce12fb9c 100644 (file)
@@ -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();
 }
 
index e2d088ae924c1d51df31e157f304181bc813763a..7b7fe131c347cfe8294df786a111e32fedc3b552 100644 (file)
@@ -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;
index 12b57cbf433447f933d4068228f77078f6639416..1bc097fbe2aeb7600eae9ac0d6e7d18e4d0dd72f 100644 (file)
@@ -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