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
{
self.alpha_max = ReadShort();
self.alpha_min = ReadShort();
self.inactive = ReadShort();
+ self.fade_vertical_offset = ReadShort();
BGMScript_InitEntity(self);
}
.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();
// 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;
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;