#include "wall.qh"
+ #include "_all.qh"
+
+ #include "bgmscript.qh"
+
+ #include "../common/util.qh"
+
+ #include "../csqcmodellib/interpolate.qh"
+
+ .float alpha;
+ .float scale;
+ .vector movedir;
+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.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)
+ self.alpha = 0;
+ else
+ self.alpha = 1;
+ }
+ else
+ {
+ self.alpha = (self.alpha_min + self.alpha_max * bound(0,
+ (self.fade_end - player_dist)
+ / (self.fade_end - self.fade_start), 1)) / 100.0;
+ }
+ }
+ else
+ {
+ self.alpha = 1;
+ }
+ }
+ if(self.alpha <= 0)
+ self.drawmask = 0;
+ else
+ self.drawmask = MASK_NORMAL;
+}
+
void Ent_Wall_Draw()
{
float f;
#ifndef WALL_H
#define WALL_H
- .float lip;
- .float bgmscriptangular;
- .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
- .float loddistance1, loddistance2;
- .vector saved;
+ entityclass(Wall);
+ class(Wall) .float lip;
+ class(Wall) .float bgmscriptangular;
+ class(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
+ class(Wall) .float loddistance1, loddistance2;
+ class(Wall) .vector saved;
+// Needed for interactive clientwalls
+.float inactive; // Clientwall disappears when inactive
+.float alpha_max, alpha_min;
+// 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();
void Ent_Wall_Remove();