]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Xonotic-like code formatting
authorPenguinum <penguinum@gmail.com>
Wed, 6 May 2015 06:25:04 +0000 (09:25 +0300)
committerPenguinum <penguinum@gmail.com>
Wed, 6 May 2015 06:25:04 +0000 (09:25 +0300)
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/server/g_models.qc
qcsrc/server/g_triggers.qc

index 8ff162faaa16fb21407881ab2ae86422cd120c75..d80787d735c723d760063e7e573cbebe5fd961a5 100644 (file)
@@ -2,25 +2,30 @@
 
 void Ent_Wall_PreDraw()
 {
-    if (self.inactive) {
-        self.alpha = 0;
-    } else {
-        vector org;
-        org = getpropertyvec(VF_ORIGIN);
-        if(!checkpvs(org, self))
-            self.alpha = 0;
-        else if(self.fade_start) {
-            self.alpha = self.alpha_max / 100.0 * bound(0,
-                               (self.fade_end - vlen(org - self.origin - 0.5 * (self.mins + self.maxs)))
-                               / (self.fade_end - self.fade_start), 1);
-        } else {
-            self.alpha = 1;
-        }
-    }
-    if(self.alpha <= 0)
-        self.drawmask = 0;
-    else
-        self.drawmask = MASK_NORMAL;
+       if (self.inactive)
+       {
+               self.alpha = 0;
+       }
+       else
+       {
+               vector org;
+               org = getpropertyvec(VF_ORIGIN);
+               if(!checkpvs(org, self))
+                       self.alpha = 0;
+               else if(self.fade_start) {
+                       self.alpha = self.alpha_max / 100.0 * bound(0,
+                                                          (self.fade_end - vlen(org - self.origin - 0.5 * (self.mins + self.maxs)))
+                                                          / (self.fade_end - self.fade_start), 1);
+               }
+               else
+               {
+                       self.alpha = 1;
+               }
+       }
+       if(self.alpha <= 0)
+               self.drawmask = 0;
+       else
+               self.drawmask = MASK_NORMAL;
 }
 
 void Ent_Wall_Draw()
@@ -187,11 +192,11 @@ void Ent_Wall()
                        self.movedir_z = ReadCoord();
                        self.lip = ReadByte() / 255.0;
                }
-        self.fade_start = ReadShort();
-        self.fade_end = ReadShort();
-        self.alpha_max = ReadShort();
-        self.alpha_min = ReadShort();
-        self.inactive = ReadShort();
+               self.fade_start = ReadShort();
+               self.fade_end = ReadShort();
+               self.alpha_max = ReadShort();
+               self.alpha_min = ReadShort();
+               self.inactive = ReadShort();
                BGMScript_InitEntity(self);
        }
 
@@ -201,5 +206,5 @@ void Ent_Wall()
 
        self.entremove = Ent_Wall_Remove;
        self.draw = Ent_Wall_Draw;
-    self.predraw = Ent_Wall_PreDraw;
+       self.predraw = Ent_Wall_PreDraw;
 }
index 85d025f81b4ce9328bfe31b806ffcc017eef2993..cfed790500a807bc09dc217707667da6aa5de7d9 100644 (file)
@@ -12,6 +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;
 
 void Ent_Wall_Draw();
 
index cd25c53ef444cc925e52f0e03568b6a8dc2a4935..bd23500c840690931ad8c99379f3c9cb3a3b3314 100644 (file)
@@ -34,7 +34,7 @@ void g_clientmodel_setcolormaptoactivator (void)
 
 void g_clientmodel_use(void)
 {
-    g_clientmodel_setcolormaptoactivator();
+       g_clientmodel_setcolormaptoactivator();
 }
 
 void g_model_dropbyspawnflags()
@@ -138,11 +138,11 @@ float g_clientmodel_genericsendentity (entity to, float sf)
                        WriteCoord(MSG_ENTITY, self.movedir.z);
                        WriteByte(MSG_ENTITY, floor(self.lip * 255));
                }
-        WriteShort(MSG_ENTITY, self.fade_start);
-        WriteShort(MSG_ENTITY, self.fade_end);
-        WriteShort(MSG_ENTITY, self.alpha_max);
-        WriteShort(MSG_ENTITY, self.alpha_min);
-        WriteShort(MSG_ENTITY, self.inactive);
+               WriteShort(MSG_ENTITY, self.fade_start);
+               WriteShort(MSG_ENTITY, self.fade_end);
+               WriteShort(MSG_ENTITY, self.alpha_max);
+               WriteShort(MSG_ENTITY, self.alpha_min);
+               WriteShort(MSG_ENTITY, self.inactive);
        }
 
        return true;
@@ -166,7 +166,7 @@ float g_clientmodel_genericsendentity (entity to, float sf)
        if(!self.solid) self.solid = (sol); else if(self.solid < 0) self.solid = SOLID_NOT; \
        if(!self.bgmscriptsustain) self.bgmscriptsustain = 1; else if(self.bgmscriptsustain < 0) self.bgmscriptsustain = 0; \
        Net_LinkEntity(self, true, 0, g_clientmodel_genericsendentity); \
-    self.default_solid = sol;
+       self.default_solid = sol;
 
 // non-solid model entities:
 void spawnfunc_misc_gamemodel()         { self.angles_x = -self.angles.x; G_MODEL_INIT      (SOLID_NOT) } // model entity
index 6851f2942b0ab56717a77eb59d47d887363a2d8d..e2d088ae924c1d51df31e157f304181bc813763a 100644 (file)
@@ -103,9 +103,9 @@ void SUB_UseTargets()
                }
                if (s != "")
                {
-            // Flag to set func_clientwall state
-            // 1 == deactivate, 2 == activate, 0 == do nothing
-            float aw_inactive = self.clientwall_flag;
+                       // Flag to set func_clientwall state
+                       // 1 == deactivate, 2 == activate, 0 == do nothing
+                       float aw_inactive = self.clientwall_flag;
                        for(t = world; (t = find(t, targetname, s)); )
                        if(t.use)
                        {
@@ -115,18 +115,25 @@ 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;
-                        }
-                    }
+                                       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;
+                                               }
+                                       }
                                        self = t;
                                        other = stemp;
                                        activator = act;