void Ent_Antiwall_Draw()
{
float f;
- var .vector fld;
-
- if(self.bgmscriptangular)
- fld = angles;
- else
- fld = origin;
- self.fld = self.saved;
if(self.lodmodelindex1)
{
}
InterpolateOrigin_Do();
-
- self.saved = self.fld;
-
- f = BGMScript(self);
- if(f >= 0)
- {
- if(self.lip < 0) // < 0: alpha goes from 1 to 1-|lip| when toggled (toggling subtracts lip)
- self.alpha = 1 + self.lip * f;
- else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip)
- self.alpha = 1 - self.lip * (1 - f);
- self.fld = self.fld + self.movedir * f;
- }
- else
- self.alpha = 1;
-
- if(self.alpha >= ALPHA_MIN_VISIBLE)
- self.drawmask = MASK_NORMAL;
- else
- self.drawmask = 0;
}
void Ent_Antiwall_Remove()
self.alpha_max = ReadShort();
self.inactive = ReadShort();
self.solid = ReadByte();
+ self.illusion = ReadShort();
if (!self.fade_start) {
self.fade_start = 50;
}
sf = sf & 0x0F;
if(self.angles != '0 0 0')
sf |= 0x10;
- if(self.solid && (self.mins != '0 0 0' || self.maxs != '0 0 0'))
+ if(self.mins != '0 0 0' || self.maxs != '0 0 0')
sf |= 0x20;
if(self.colormap != 0)
sf |= 0x40;
WriteByte(MSG_ENTITY, ENT_CLIENT_ANTIWALL);
WriteByte(MSG_ENTITY, sf);
- if (self.inactive) {
- self.solid = SOLID_NOT;
+ if (!self.illusion) {
+ if (self.inactive) {
+ self.solid = SOLID_NOT;
+ } else {
+ self.solid = SOLID_BSP;
+ }
} else {
- self.solid = SOLID_BSP;
+ self.solid = SOLID_NOT;
}
if(sf & 1)
WriteShort(MSG_ENTITY, self.alpha_max);
WriteShort(MSG_ENTITY, self.inactive);
WriteByte(MSG_ENTITY, self.solid);
+ WriteShort(MSG_ENTITY, self.illusion);
/*printf("called\n");*/
}
return TRUE;
}
-#define ANTIWALL_INIT(sol) \
- if(self.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) self.movetype = MOVETYPE_PHYSICS; \
- if(!self.scale) self.scale = self.modelscale; \
- SetBrushEntityModel(); \
- self.use = antiwall_setcolormaptoactivator; \
- InitializeEntity(self, antiwall_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
- 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, antiwall_genericsendentity);
-
-void spawnfunc_func_antiwall() { ANTIWALL_INIT(SOLID_BSP) } // Solid dynamic entity
-void spawnfunc_func_antiillusion() { ANTIWALL_INIT(SOLID_NOT) } // Non-solid dynamic entity
-void spawnfunc_aw() { ANTIWALL_INIT(SOLID_BSP) } // Solid dynamic entity
+void spawnfunc_func_antiwall() {
+ if (self.geomtype) {
+ if (autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) {
+ self.movetype = MOVETYPE_PHYSICS;
+ }
+ }
+ if (!self.scale) { self.scale = self.modelscale; }
+ SetBrushEntityModel();
+ self.use = antiwall_setcolormaptoactivator;
+ InitializeEntity(self, antiwall_dropbyspawnflags, INITPRIO_DROPTOFLOOR);
+ if (self.illusion) {
+ self.solid = SOLID_NOT;
+ } else {
+ self.solid = SOLID_BSP;
+ }
+ Net_LinkEntity(self, TRUE, 0, antiwall_genericsendentity);
+}
}
if (s != "")
{
+ // Flag to set antiwall state
+ // 1 == deactivate, 2 == activate, 0 == do nothing
+ float aw_inactive = self.antiwall_flag;
for(t = world; (t = find(t, targetname, s)); )
if(t.use)
{
}
else
{
+ if (t.classname == "func_antiwall") {
+ if (aw_inactive == 1) {
+ t.inactive = 1;
+ if (!t.illusion) {
+ t.solid = SOLID_BSP;
+ }
+ } else if (aw_inactive == 2) {
+ t.inactive = 0;
+ if (t.illusion) {
+ t.solid = SOLID_NOT;
+ } else {
+ t.solid = SOLID_BSP;
+ }
+ }
+ }
self = t;
other = stemp;
activator = act;