From: terencehill Date: Mon, 18 Feb 2013 21:19:53 +0000 (+0100) Subject: Fix this bug reported by matthiaskrgr long time ago: "when I shoot a mine out of... X-Git-Tag: xonotic-v0.7.0~62^2~30^2~1 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=6b5135efce694818091bdf63449006d6a9bc5b5f Fix this bug reported by matthiaskrgr long time ago: "when I shoot a mine out of the map, the mine-counter around the cursor isn't reset". Code is basically the same used by the rocketlauncher to clear .lastrocket --- diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index f777254138..9660c6044f 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -291,8 +291,6 @@ float nJoinAllowed(entity ignore); .entity flagcarried; -.entity lastrocket; - .float playerid; float playerid_last; .float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor @@ -590,7 +588,13 @@ float client_cefc_accumulatortime; .float clip_load; .float old_clip_load; .float clip_size; + +.entity lastrocket; .float minelayer_mines; +.float nex_charge; +.float nex_charge_rottime; +.float nex_chargepool_ammo; +.float hagar_load; .float grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab @@ -627,12 +631,6 @@ string deathmessage; .void (float act_state) setactive; .entity realowner; -.float nex_charge; -.float nex_charge_rottime; -.float nex_chargepool_ammo; - -.float hagar_load; - float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended) float serverflags; diff --git a/qcsrc/server/w_minelayer.qc b/qcsrc/server/w_minelayer.qc index 3268b9b5b6..bcce5ebd15 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -226,7 +226,12 @@ void W_Mine_Touch (void) if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW) return; // we're already a stuck mine, why do we get called? TODO does this even happen? - PROJECTILE_TOUCH; + if(WarpZone_Projectile_Touch()) + { + if(wasfreed(self)) + self.realowner.minelayer_mines -= 1; + return; + } if(other && other.classname == "player" && other.deadflag == DEAD_NO) {