X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_triggers.qc;h=c5fb08c965c2afa88d6f6f3aecf1d58974c333bd;hb=ee9fb31ee5e8f39ff60ce5d4ef6b480f7a1cdeed;hp=c0e81fa8916d66d961ac88c259dca131922c03b4;hpb=e0ac5f9f14e169a1e19d0e36b85cab061a74ed93;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index c0e81fa89..c5fb08c96 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -61,14 +61,13 @@ void SUB_UseTargets() // // print the message // - if (IS_PLAYER(activator) && self.message != "") + if(self) + if(IS_PLAYER(activator) && self.message != "") + if(IS_REAL_CLIENT(activator)) { - if(IS_REAL_CLIENT(activator)) - { - centerprint (activator, self.message); - if (self.noise == "") - play2(activator, "misc/talk.wav"); - } + centerprint(activator, self.message); + if (self.noise == "") + play2(activator, "misc/talk.wav"); } // @@ -205,8 +204,8 @@ void multi_use() void multi_touch() { - if (!(self.spawnflags & 2)) - if (!other.iscreature) + if(!(self.spawnflags & 2)) + if(!other.iscreature) return; if(self.team) @@ -378,32 +377,26 @@ void spawnfunc_trigger_delay() void counter_use() { - self.count = self.count - 1; + self.count -= 1; if (self.count < 0) return; - if (self.count != 0) + if (self.count == 0) { - if (IS_PLAYER(activator) - && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - { - if (self.count >= 4) - centerprint (activator, "There are more to go..."); - else if (self.count == 3) - centerprint (activator, "Only 3 more to go..."); - else if (self.count == 2) - centerprint (activator, "Only 2 more to go..."); - else - centerprint (activator, "Only 1 more to go..."); - } - return; - } + if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED); - if (IS_PLAYER(activator) - && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - centerprint(activator, "Sequence completed!"); - self.enemy = activator; - multi_trigger (); + self.enemy = activator; + multi_trigger (); + } + else + { + if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) + if(self.count >= 4) + Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER); + else + Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, self.count); + } } void counter_reset() @@ -1097,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() { @@ -1781,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; @@ -2062,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 (!(ear.spawnflags & 64)) - if(magicear_matched) - return msgout; + if(!(ear.spawnflags & 64)) + if(magicear_matched) + return msgout; msgin = msgout; } return msgin;