X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_triggers.qc;h=c5fb08c965c2afa88d6f6f3aecf1d58974c333bd;hb=5310c50bac3297a0f8f21db55e8095921f61c656;hp=4c24ed60650bd574283744814918241081eb07a2;hpb=0315148a7932523108e2783df88e29d6c9d3e07b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index 4c24ed606..c5fb08c96 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -61,6 +61,7 @@ void SUB_UseTargets() // // print the message // + if(self) if(IS_PLAYER(activator) && self.message != "") if(IS_REAL_CLIENT(activator)) { @@ -162,7 +163,7 @@ void multi_trigger() if (self.classname == "trigger_secret") { - if not(IS_PLAYER(self.enemy)) + if (!IS_PLAYER(self.enemy)) return; found_secrets = found_secrets + 1; WriteByte (MSG_ALL, SVC_FOUNDSECRET); @@ -203,8 +204,8 @@ void multi_use() void multi_touch() { - if not(self.spawnflags & 2) - if not(other.iscreature) + if(!(self.spawnflags & 2)) + if(!other.iscreature) return; if(self.team) @@ -384,7 +385,7 @@ void counter_use() { if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED); - + self.enemy = activator; multi_trigger (); } @@ -433,7 +434,7 @@ void trigger_hurt_use() .float triggerhurttime; void trigger_hurt_touch() { - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if(self.team) @@ -451,7 +452,7 @@ void trigger_hurt_touch() entity own; own = self.enemy; - if not(IS_PLAYER(own)) + if (!IS_PLAYER(own)) { own = self; self.enemy = world; // I still hate you all @@ -524,9 +525,9 @@ float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end) .float triggerhealtime; void trigger_heal_touch() { - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; - + // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu) if (other.iscreature) { @@ -536,7 +537,7 @@ void trigger_heal_touch() { EXACTTRIGGER_TOUCH; other.triggerhealtime = time + 1; - + if (other.health < self.max_health) { other.health = min(other.health + self.health, self.max_health); @@ -550,7 +551,7 @@ void trigger_heal_touch() void spawnfunc_trigger_heal() { self.active = ACTIVE_ACTIVE; - + EXACTTRIGGER_INIT; self.touch = trigger_heal_touch; if (!self.health) @@ -620,7 +621,7 @@ void trigger_gravity_touch() g = self.gravity; - if not(self.spawnflags & 1) + if (!(self.spawnflags & 1)) { if(other.trigger_gravity_check) { @@ -683,7 +684,7 @@ void spawnfunc_trigger_gravity() void target_speaker_use_off(); void target_speaker_use_activator() { - if not(IS_REAL_CLIENT(activator)) + if (!IS_REAL_CLIENT(activator)) return; string snd; if(substring(self.noise, 0, 1) == "*") @@ -934,7 +935,7 @@ void spawnfunc_func_pointparticles() setmodel(self, self.model); if(self.noise != "") precache_sound (self.noise); - + if(!self.bgmscriptsustain) self.bgmscriptsustain = 1; else if(self.bgmscriptsustain < 0) @@ -1089,9 +1090,6 @@ void spawnfunc_func_snow() Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity); } - -void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype); - .float modelscale; void misc_laser_aim() { @@ -1156,7 +1154,7 @@ void misc_laser_think() if(self.enemy) { o = self.enemy.origin; - if not(self.spawnflags & 2) + if (!(self.spawnflags & 2)) o = self.origin + normalize(o - self.origin) * 32768; } else @@ -1361,7 +1359,7 @@ void trigger_impulse_touch1() float pushdeltatime; float str; - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if (!isPushable(other)) @@ -1401,7 +1399,7 @@ void trigger_impulse_touch2() { float pushdeltatime; - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if (!isPushable(other)) @@ -1425,7 +1423,7 @@ void trigger_impulse_touch3() float pushdeltatime; float str; - if (self.active != ACTIVE_ACTIVE) + if (self.active != ACTIVE_ACTIVE) return; if (!isPushable(other)) @@ -1758,7 +1756,7 @@ void target_voicescript_next(entity pl) return; if(vs.message == "") return; - if not(IS_PLAYER(pl)) + if (!IS_PLAYER(pl)) return; if(gameover) return; @@ -1773,7 +1771,7 @@ void target_voicescript_next(entity pl) if(pl.voicescript_index < vs.cnt) i = pl.voicescript_index * 2; else if(n > vs.cnt * 2) - i = mod(pl.voicescript_index - vs.cnt, (n - vs.cnt * 2 - 1) / 2) * 2 + vs.cnt * 2 + 1; + i = ((pl.voicescript_index - vs.cnt) % ((n - vs.cnt * 2 - 1) / 2)) * 2 + vs.cnt * 2 + 1; else i = -1; @@ -1811,7 +1809,7 @@ void spawnfunc_target_voicescript() // added after this message // wait: average time between messages // delay: initial delay before the first message - + float i, n; self.use = target_voicescript_use; @@ -1910,13 +1908,13 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, dotrigger = ((IS_PLAYER(source)) && (source.deadflag == DEAD_NO) && ((ear.radius == 0) || (vlen(source.origin - ear.origin) <= ear.radius))); domatch = ((ear.spawnflags & 32) || dotrigger); - if not(domatch) + if (!domatch) return msgin; - if not(msgin) + if (!msgin) { // we are in TUBA mode! - if not(ear.spawnflags & 256) + 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)) @@ -1962,7 +1960,7 @@ string trigger_magicear_processmessage(entity ear, entity source, float teamsay, if(ear.spawnflags & 8) return msgin; } - + matchstart = -1; l = strlen(ear.message); @@ -2054,9 +2052,9 @@ string trigger_magicear_processmessage_forallears(entity source, float teamsay, for(ear = magicears; ear; ear = ear.enemy) { msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin); - if not(ear.spawnflags & 64) - if(magicear_matched) - return msgout; + if(!(ear.spawnflags & 64)) + if(magicear_matched) + return msgout; msgin = msgout; } return msgin; @@ -2102,9 +2100,9 @@ void spawnfunc_trigger_magicear() void relay_activators_use() { entity trg, os; - + os = self; - + for(trg = world; (trg = find(trg, targetname, os.target)); ) { self = trg; @@ -2116,11 +2114,11 @@ void relay_activators_use() if(os.cnt == ACTIVE_TOGGLE) if(trg.active == ACTIVE_ACTIVE) trg.active = ACTIVE_NOT; - else + else trg.active = ACTIVE_ACTIVE; else trg.active = os.cnt; - } + } } self = os; } @@ -2134,13 +2132,13 @@ void spawnfunc_relay_activate() void spawnfunc_relay_deactivate() { self.cnt = ACTIVE_NOT; - self.use = relay_activators_use; + self.use = relay_activators_use; } void spawnfunc_relay_activatetoggle() { self.cnt = ACTIVE_TOGGLE; - self.use = relay_activators_use; + self.use = relay_activators_use; } .string chmap, gametype;