From: Penguinum Date: Wed, 20 May 2015 06:04:28 +0000 (+0300) Subject: Vertical offset, comments, etc X-Git-Tag: xonotic-v0.8.1~40^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3a1633035f0cb6a41a8ee0018c2996a4416f62a1;p=xonotic%2Fxonotic-data.pk3dir.git Vertical offset, comments, etc --- diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index f1b250e32..6a9f5a440 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -12,17 +12,16 @@ void Ent_Wall_PreDraw() 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 (player_dist >= self.fade_start) { + if (player_dist >= self.fade_start) self.alpha = 0; - } else - { self.alpha = 1; - } } else { @@ -211,6 +210,7 @@ void Ent_Wall() self.alpha_max = ReadShort(); self.alpha_min = ReadShort(); self.inactive = ReadShort(); + self.fade_vertical_offset = ReadShort(); BGMScript_InitEntity(self); } diff --git a/qcsrc/client/wall.qh b/qcsrc/client/wall.qh index dca8f1d3e..3094b4373 100644 --- a/qcsrc/client/wall.qh +++ b/qcsrc/client/wall.qh @@ -7,11 +7,14 @@ .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 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(); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index f0a9d2f4e..98f0661e7 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -85,7 +85,7 @@ float server_is_dedicated; // 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; diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index 101f16796..9bf4c4ece 100644 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@ -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.fade_vertical_offset); } return true;