X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_triggers.qc;h=cacb434d3d76cd00e04d8e0728272b7b68349eca;hp=c5fb08c965c2afa88d6f6f3aecf1d58974c333bd;hb=ba0988ca930f50286f8cf3b6c114ebc6584964af;hpb=ccc13f7e2fb7a076e6e953127f70109d79313b91 diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index c5fb08c96..cacb434d3 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -1,3 +1,22 @@ +#if defined(CSQC) +#elif defined(MENUQC) +#elif defined(SVQC) + #include "../dpdefs/progsdefs.qc" + #include "../dpdefs/dpextensions.qc" + #include "../warpzonelib/util_server.qh" + #include "../common/constants.qh" + #include "../common/util.qh" + #include "../common/monsters/monsters.qh" + #include "../common/weapons/weapons.qh" + #include "weapons/csqcprojectile.qh" + #include "autocvars.qh" + #include "constants.qh" + #include "defs.qh" + #include "../common/notifications.qh" + #include "../common/deathtypes.qh" + #include "../common/mapinfo.qh" +#endif + void SUB_DontUseTargets() { } @@ -509,9 +528,9 @@ float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end) for(th = trigger_hurt_first; th; th = th.trigger_hurt_next) if(tracebox_hits_box(start, mi, ma, end, th.absmin, th.absmax)) - return TRUE; + return true; - return FALSE; + return false; } ////////////////////////////////////////////////////////////// @@ -614,7 +633,7 @@ void trigger_gravity_touch() { float g; - if(self.state != TRUE) + if(self.state != true) return; EXACTTRIGGER_TOUCH; @@ -668,12 +687,12 @@ void spawnfunc_trigger_gravity() if(self.noise != "") precache_sound(self.noise); - self.state = TRUE; + self.state = true; IFTARGETED { self.use = trigger_gravity_use; if(self.spawnflags & 2) - self.state = FALSE; + self.state = false; } } @@ -847,9 +866,9 @@ float pointparticles_SendEntity(entity to, float fl) } if(fl & 4) { - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, self.origin.x); + WriteCoord(MSG_ENTITY, self.origin.y); + WriteCoord(MSG_ENTITY, self.origin.z); } if(fl & 1) { @@ -858,12 +877,12 @@ float pointparticles_SendEntity(entity to, float fl) WriteShort(MSG_ENTITY, self.modelindex); if(fl & 0x80) { - WriteCoord(MSG_ENTITY, self.mins_x); - WriteCoord(MSG_ENTITY, self.mins_y); - WriteCoord(MSG_ENTITY, self.mins_z); - WriteCoord(MSG_ENTITY, self.maxs_x); - WriteCoord(MSG_ENTITY, self.maxs_y); - WriteCoord(MSG_ENTITY, self.maxs_z); + WriteCoord(MSG_ENTITY, self.mins.x); + WriteCoord(MSG_ENTITY, self.mins.y); + WriteCoord(MSG_ENTITY, self.mins.z); + WriteCoord(MSG_ENTITY, self.maxs.x); + WriteCoord(MSG_ENTITY, self.maxs.y); + WriteCoord(MSG_ENTITY, self.maxs.z); } } else @@ -871,9 +890,9 @@ float pointparticles_SendEntity(entity to, float fl) WriteShort(MSG_ENTITY, 0); if(fl & 0x80) { - WriteCoord(MSG_ENTITY, self.maxs_x); - WriteCoord(MSG_ENTITY, self.maxs_y); - WriteCoord(MSG_ENTITY, self.maxs_z); + WriteCoord(MSG_ENTITY, self.maxs.x); + WriteCoord(MSG_ENTITY, self.maxs.y); + WriteCoord(MSG_ENTITY, self.maxs.z); } } WriteShort(MSG_ENTITY, self.cnt); @@ -1003,12 +1022,12 @@ float rainsnow_SendEntity(entity to, float sf) { WriteByte(MSG_ENTITY, ENT_CLIENT_RAINSNOW); WriteByte(MSG_ENTITY, self.state); - WriteCoord(MSG_ENTITY, self.origin_x + self.mins_x); - WriteCoord(MSG_ENTITY, self.origin_y + self.mins_y); - WriteCoord(MSG_ENTITY, self.origin_z + self.mins_z); - WriteCoord(MSG_ENTITY, self.maxs_x - self.mins_x); - WriteCoord(MSG_ENTITY, self.maxs_y - self.mins_y); - WriteCoord(MSG_ENTITY, self.maxs_z - self.mins_z); + WriteCoord(MSG_ENTITY, self.origin.x + self.mins.x); + WriteCoord(MSG_ENTITY, self.origin.y + self.mins.y); + WriteCoord(MSG_ENTITY, self.origin.z + self.mins.z); + WriteCoord(MSG_ENTITY, self.maxs.x - self.mins.x); + WriteCoord(MSG_ENTITY, self.maxs.y - self.mins.y); + WriteCoord(MSG_ENTITY, self.maxs.z - self.mins.z); WriteShort(MSG_ENTITY, compressShortVector(self.dest)); WriteShort(MSG_ENTITY, self.count); WriteByte(MSG_ENTITY, self.cnt); @@ -1040,7 +1059,7 @@ void spawnfunc_func_rain() self.cnt = 12; if (!self.count) self.count = 2000; - self.count = 0.01 * self.count * (self.size_x / 1024) * (self.size_y / 1024); + self.count = 0.01 * self.count * (self.size.x / 1024) * (self.size.y / 1024); if (self.count < 1) self.count = 1; if(self.count > 65535) @@ -1049,7 +1068,7 @@ void spawnfunc_func_rain() self.state = 1; // 1 is rain, 0 is snow self.Version = 1; - Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity); + Net_LinkEntity(self, false, 0, rainsnow_SendEntity); } @@ -1078,7 +1097,7 @@ void spawnfunc_func_snow() self.cnt = 12; if (!self.count) self.count = 2000; - self.count = 0.01 * self.count * (self.size_x / 1024) * (self.size_y / 1024); + self.count = 0.01 * self.count * (self.size.x / 1024) * (self.size.y / 1024); if (self.count < 1) self.count = 1; if(self.count > 65535) @@ -1087,7 +1106,7 @@ void spawnfunc_func_snow() self.state = 0; // 1 is rain, 0 is snow self.Version = 1; - Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity); + Net_LinkEntity(self, false, 0, rainsnow_SendEntity); } .float modelscale; @@ -1107,7 +1126,7 @@ void misc_laser_aim() else { a = vectoangles(self.enemy.origin - self.origin); - a_x = -a_x; + a_x = -a.x; if(a != self.mangle) { self.mangle = a; @@ -1226,15 +1245,15 @@ float laser_SendEntity(entity to, float fl) WriteByte(MSG_ENTITY, fl); if(fl & 1) { - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, self.origin.x); + WriteCoord(MSG_ENTITY, self.origin.y); + WriteCoord(MSG_ENTITY, self.origin.z); } if(fl & 8) { - WriteByte(MSG_ENTITY, self.colormod_x * 255.0); - WriteByte(MSG_ENTITY, self.colormod_y * 255.0); - WriteByte(MSG_ENTITY, self.colormod_z * 255.0); + WriteByte(MSG_ENTITY, self.colormod.x * 255.0); + WriteByte(MSG_ENTITY, self.colormod.y * 255.0); + WriteByte(MSG_ENTITY, self.colormod.z * 255.0); if(fl & 0x40) WriteByte(MSG_ENTITY, self.alpha * 255.0); if(fl & 0x20) @@ -1249,14 +1268,14 @@ float laser_SendEntity(entity to, float fl) { if(fl & 0x80) { - WriteCoord(MSG_ENTITY, self.enemy.origin_x); - WriteCoord(MSG_ENTITY, self.enemy.origin_y); - WriteCoord(MSG_ENTITY, self.enemy.origin_z); + WriteCoord(MSG_ENTITY, self.enemy.origin.x); + WriteCoord(MSG_ENTITY, self.enemy.origin.y); + WriteCoord(MSG_ENTITY, self.enemy.origin.z); } else { - WriteAngle(MSG_ENTITY, self.mangle_x); - WriteAngle(MSG_ENTITY, self.mangle_y); + WriteAngle(MSG_ENTITY, self.mangle.x); + WriteAngle(MSG_ENTITY, self.mangle.y); } } if(fl & 4) @@ -1334,7 +1353,7 @@ void spawnfunc_misc_laser() self.mangle = self.angles; - Net_LinkEntity(self, FALSE, 0, laser_SendEntity); + Net_LinkEntity(self, false, 0, laser_SendEntity); IFTARGETED { @@ -1903,7 +1922,7 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, entity oldself; string savemessage; - magicear_matched = FALSE; + magicear_matched = false; dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius))); domatch = ((ear.spawnflags & 32) || dotrigger); @@ -1917,10 +1936,10 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, if (!(ear.spawnflags & 256)) return msgin; - if(!W_Tuba_HasPlayed(source, ear.message, ear.movedir_x, !(ear.spawnflags & 512), ear.movedir_y, ear.movedir_z)) + if(!W_Tuba_HasPlayed(source, ear.message, ear.movedir.x, !(ear.spawnflags & 512), ear.movedir.y, ear.movedir.z)) return msgin; - magicear_matched = TRUE; + magicear_matched = true; if(dotrigger) { @@ -2011,7 +2030,7 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, if(matchstart == -1) // no match return msgin; - magicear_matched = TRUE; + magicear_matched = true; if(dotrigger) {