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()
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);
}
self.entremove = Ent_Wall_Remove;
self.draw = Ent_Wall_Draw;
- self.predraw = Ent_Wall_PreDraw;
+ self.predraw = Ent_Wall_PreDraw;
}
.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();
void g_clientmodel_use(void)
{
- g_clientmodel_setcolormaptoactivator();
+ g_clientmodel_setcolormaptoactivator();
}
void g_model_dropbyspawnflags()
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;
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
}
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)
{
}
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;