From: Samual Date: Mon, 2 Apr 2012 14:17:46 +0000 (-0400) Subject: Check game over in the flag think function -- if a flag is dropped or passing, instan... X-Git-Tag: xonotic-v0.7.0~240^2~97 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=721882b772e2dac6477f6d57c32727e527a21b27;p=xonotic%2Fxonotic-data.pk3dir.git Check game over in the flag think function -- if a flag is dropped or passing, instantly stop it from moving (game is over, everything should pause.) --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index dd82a8380..94beaf2cb 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -538,6 +538,19 @@ void ctf_FlagDamage(entity inflictor, entity attacker, float damage, float death } } +void ctf_FlagGameOver(entity flag) +{ + if(gameover) + { + // lock the flag, game is over + flag.movetype = MOVETYPE_NONE; + flag.takedamage = DAMAGE_NO; + flag.solid = SOLID_NOT; + flag.nextthink = 0; // stop thinking + return; + } +} + void ctf_FlagThink() { // declarations @@ -574,6 +587,7 @@ void ctf_FlagThink() case FLAG_DROPPED: { + if(gameover) { ctf_FlagGameOver(self); return; } if(autocvar_g_ctf_flag_return_dropped) { if((vlen(self.origin - self.ctf_spawnorigin) <= autocvar_g_ctf_flag_return_dropped) || (autocvar_g_ctf_flag_return_dropped == -1)) @@ -633,6 +647,7 @@ void ctf_FlagThink() case FLAG_PASSING: // todo make work with warpzones { + if(gameover) { ctf_FlagGameOver(self); return; } vector targ_origin = ((self.pass_target.absmin + self.pass_target.absmax) * 0.5); traceline(self.origin, targ_origin, MOVE_NOMONSTERS, self); @@ -1065,6 +1080,7 @@ MUTATOR_HOOKFUNCTION(ctf_VehicleEnter) setattachment(other.flagcarried, self, ""); setorigin(other, VEHICLE_FLAG_OFFSET); other.flagcarried.scale = VEHICLE_FLAG_SCALE; + //other.flagcarried.angles = '0 0 0'; } } @@ -1078,6 +1094,7 @@ MUTATOR_HOOKFUNCTION(ctf_VehicleExit) setattachment(self.owner.flagcarried, self.owner, ""); setorigin(self.owner.flagcarried, FLAG_CARRY_OFFSET); self.owner.flagcarried.scale = FLAG_SCALE; + self.owner.flagcarried.angles = '0 0 0'; } return 0;