4 #include "../dpdefs/progsdefs.qh"
5 #include "../dpdefs/dpextensions.qh"
6 #include "../common/constants.qh"
7 #include "autocvars.qh"
8 #include "constants.qh"
10 #include "../csqcmodellib/sv_model.qh"
13 void antiwall_setcolormaptoactivator (void)
15 g_model_setcolormaptoactivator();
19 void antiwall_dropbyspawnflags()
23 g_model_dropbyspawnflags();
28 float antiwall_genericsendentity (entity to, float sf)
31 if(self.angles != '0 0 0')
33 if(self.solid && (self.mins != '0 0 0' || self.maxs != '0 0 0'))
35 if(self.colormap != 0)
37 if(self.lodmodelindex1)
40 WriteByte(MSG_ENTITY, ENT_CLIENT_ANTIWALL);
41 WriteByte(MSG_ENTITY, sf);
44 self.solid = SOLID_NOT;
46 self.solid = SOLID_BSP;
52 WriteShort(MSG_ENTITY, self.colormap);
57 WriteCoord(MSG_ENTITY, self.origin_x);
58 WriteCoord(MSG_ENTITY, self.origin_y);
59 WriteCoord(MSG_ENTITY, self.origin_z);
66 WriteAngle(MSG_ENTITY, self.angles_x);
67 WriteAngle(MSG_ENTITY, self.angles_y);
68 WriteAngle(MSG_ENTITY, self.angles_z);
76 WriteShort(MSG_ENTITY, self.lodmodelindex0);
77 WriteShort(MSG_ENTITY, bound(0, self.loddistance1, 65535));
78 WriteShort(MSG_ENTITY, self.lodmodelindex1);
79 WriteShort(MSG_ENTITY, bound(0, self.loddistance2, 65535));
80 WriteShort(MSG_ENTITY, self.lodmodelindex2);
82 WriteShort(MSG_ENTITY, self.modelindex);
84 WriteShort(MSG_ENTITY, floor(self.scale * 256));
87 WriteCoord(MSG_ENTITY, self.mins_x);
88 WriteCoord(MSG_ENTITY, self.mins_y);
89 WriteCoord(MSG_ENTITY, self.mins_z);
90 WriteCoord(MSG_ENTITY, self.maxs_x);
91 WriteCoord(MSG_ENTITY, self.maxs_y);
92 WriteCoord(MSG_ENTITY, self.maxs_z);
94 WriteString(MSG_ENTITY, self.bgmscript);
95 if(self.bgmscript != "")
97 WriteByte(MSG_ENTITY, floor(self.bgmscriptattack * 64));
98 WriteByte(MSG_ENTITY, floor(self.bgmscriptdecay * 64));
99 WriteByte(MSG_ENTITY, floor(self.bgmscriptsustain * 255));
100 WriteByte(MSG_ENTITY, floor(self.bgmscriptrelease * 64));
101 WriteCoord(MSG_ENTITY, self.movedir_x);
102 WriteCoord(MSG_ENTITY, self.movedir_y);
103 WriteCoord(MSG_ENTITY, self.movedir_z);
104 WriteByte(MSG_ENTITY, floor(self.lip * 255));
106 WriteShort(MSG_ENTITY, self.fade_start);
107 WriteShort(MSG_ENTITY, self.fade_end);
108 WriteShort(MSG_ENTITY, self.alpha_max);
109 WriteShort(MSG_ENTITY, self.inactive);
110 WriteByte(MSG_ENTITY, self.solid);
111 /*printf("called\n");*/
117 #define ANTIWALL_INIT(sol) \
118 if(self.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) self.movetype = MOVETYPE_PHYSICS; \
119 if(!self.scale) self.scale = self.modelscale; \
120 SetBrushEntityModel(); \
121 self.use = antiwall_setcolormaptoactivator; \
122 InitializeEntity(self, antiwall_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \
123 if(!self.solid) self.solid = (sol); else if(self.solid < 0) self.solid = SOLID_NOT; \
124 if(!self.bgmscriptsustain) self.bgmscriptsustain = 1; else if(self.bgmscriptsustain < 0) self.bgmscriptsustain = 0; \
125 Net_LinkEntity(self, TRUE, 0, antiwall_genericsendentity);
127 void spawnfunc_func_antiwall() { ANTIWALL_INIT(SOLID_BSP) } // Solid dynamic entity
128 void spawnfunc_func_antiillusion() { ANTIWALL_INIT(SOLID_NOT) } // Non-solid dynamic entity
129 void spawnfunc_aw() { ANTIWALL_INIT(SOLID_BSP) } // Solid dynamic entity