]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Vertical offset, comments, etc
authorPenguinum <penguinum@gmail.com>
Wed, 20 May 2015 06:04:28 +0000 (09:04 +0300)
committerPenguinum <penguinum@gmail.com>
Wed, 20 May 2015 06:04:28 +0000 (09:04 +0300)
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/server/defs.qh
qcsrc/server/g_models.qc

index f1b250e324b2fa402f7605191149acca0a82c181..6a9f5a440fc1c1d6f0fc366d5110945bda33d300 100644 (file)
@@ -12,17 +12,16 @@ void Ent_Wall_PreDraw()
                org = getpropertyvec(VF_ORIGIN);
                if(!checkpvs(org, self))
                        self.alpha = 0;
                org = getpropertyvec(VF_ORIGIN);
                if(!checkpvs(org, self))
                        self.alpha = 0;
-               else if(self.fade_start) {
-                       float player_dist = vlen(org - self.origin - 0.5 * (self.mins + self.maxs));
+               else if(self.fade_start || self.fade_end) {
+                       vector offset = '0 0 0';
+                       offset_z = self.fade_vertical_offset;
+                       float player_dist = vlen(org - self.origin - 0.5 * (self.mins + self.maxs) + offset);
                        if (self.fade_end == self.fade_start)
                        {
                        if (self.fade_end == self.fade_start)
                        {
-                               if (player_dist >= self.fade_start) {
+                               if (player_dist >= self.fade_start)
                                        self.alpha = 0;
                                        self.alpha = 0;
-                               }
                                else
                                else
-                               {
                                        self.alpha = 1;
                                        self.alpha = 1;
-                               }
                        }
                        else
                        {
                        }
                        else
                        {
@@ -211,6 +210,7 @@ void Ent_Wall()
                self.alpha_max = ReadShort();
                self.alpha_min = ReadShort();
                self.inactive = ReadShort();
                self.alpha_max = ReadShort();
                self.alpha_min = ReadShort();
                self.inactive = ReadShort();
+               self.fade_vertical_offset = ReadShort();
                BGMScript_InitEntity(self);
        }
 
                BGMScript_InitEntity(self);
        }
 
index dca8f1d3e4ef698f3fee0a88ff3865d8a805714b..3094b4373de44f8cf288414b16e6715e93512dde 100644 (file)
@@ -7,11 +7,14 @@
 .float loddistance1, loddistance2;
 .vector saved;
 
 .float loddistance1, loddistance2;
 .vector saved;
 
-// Needed for dynamic clientwalls
+// Needed for interactive clientwalls
 .float inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
 .float inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
-.float fade_start, fade_end;
-.float default_solid; // Variable to store default self.solid for clientwalls
+// If fade_start > fade_end, fadeout will be inverted
+// fade_vertical_offset is a vertival offset for player position
+.float fade_start, fade_end, fade_vertical_offset;
+.float default_solid;
+// This variable will be set by trigger
 .float antiwall_flag;
 
 void Ent_Wall_Draw();
 .float antiwall_flag;
 
 void Ent_Wall_Draw();
index f0a9d2f4e8b5e978ba3ec7885243ab228b782277..98f0661e7c05e1bb0132440ea2467675d2d689cc 100644 (file)
@@ -85,7 +85,7 @@ float server_is_dedicated;
 // Needed for dynamic clientwalls
 .float inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
 // Needed for dynamic clientwalls
 .float inactive; // Clientwall disappears when inactive
 .float alpha_max, alpha_min;
-.float fade_start, fade_end;
+.float fade_start, fade_end, fade_vertical_offset;
 .float default_solid; // Variable to store default self.solid for clientwalls
 
 .string killtarget;
 .float default_solid; // Variable to store default self.solid for clientwalls
 
 .string killtarget;
index 101f16796a27c3f565404ce3f509708f7e3945f0..9bf4c4ece34f39bff24cd80be23dec39add3f947 100644 (file)
@@ -153,6 +153,7 @@ float g_clientmodel_genericsendentity (entity to, float sf)
                WriteShort(MSG_ENTITY, self.alpha_max);
                WriteShort(MSG_ENTITY, self.alpha_min);
                WriteShort(MSG_ENTITY, self.inactive);
                WriteShort(MSG_ENTITY, self.alpha_max);
                WriteShort(MSG_ENTITY, self.alpha_min);
                WriteShort(MSG_ENTITY, self.inactive);
+               WriteShort(MSG_ENTITY, self.fade_vertical_offset);
        }
 
        return true;
        }
 
        return true;