From: Rudolf Polzer Date: Wed, 4 Jun 2014 09:11:45 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/Mario/ka_fixes' X-Git-Tag: xonotic-v0.8.0~205 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=f1d984d31a409523f2bb51b586942765d34c10a3;hp=5379cc3dcc6a4a8278622516885096177c2c2a35;p=xonotic%2Fxonotic-data.pk3dir.git Merge remote-tracking branch 'origin/Mario/ka_fixes' * origin/Mario/ka_fixes: Teleport the ball to a spawnpoint if random location failed (fixes a crash), show a different centerprint notification to the player who picked up the ball --- diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 003c0fcc1..117965f7b 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -637,6 +637,7 @@ void Send_Notification_WOCOVA( MSG_CENTER_NOTIF(1, CENTER_JOIN_PREVENT, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_DROPPED, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has dropped the ball!"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has picked up the ball!"), "") \ + MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP_SELF, 0, 0, "", CPID_KEEPAWAY, "0 0", _("^BGYou picked up the ball"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_WARN, 0, 0, "", CPID_KEEPAWAY_WARN, "0 0", _("^BGKilling people while you don't have the ball gives no points!"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_HELP, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGAll keys are in your team's hands!\nHelp the key carriers to meet!"), "") \ MULTITEAM_CENTER(1, CENTER_KEYHUNT_INTERFERE_, 4, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGAll keys are in ^TC^TT team^BG's hands!\nInterfere ^F4NOW^BG!"), "") \ diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index ec6ee8cd4..942682c16 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -25,28 +25,28 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated if(gameover) { return; } vector oldballorigin = self.origin; - if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256)) + if(!MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256)) { - makevectors(self.angles); - self.movetype = MOVETYPE_BOUNCE; - self.velocity = '0 0 200'; - self.angles = '0 0 0'; - self.effects = autocvar_g_keepawayball_effects; - self.think = ka_RespawnBall; - self.nextthink = time + autocvar_g_keepawayball_respawntime; + entity spot = SelectSpawnPoint(TRUE); + setorigin(self, spot.origin); + self.angles = spot.angles; + } - pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1); - pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1); + makevectors(self.angles); + self.movetype = MOVETYPE_BOUNCE; + self.velocity = '0 0 200'; + self.angles = '0 0 0'; + self.effects = autocvar_g_keepawayball_effects; + self.think = ka_RespawnBall; + self.nextthink = time + autocvar_g_keepawayball_respawntime; - WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1'); - WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); + pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1); + pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1); - sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) - } - else - { - ka_RespawnBall(); // finding a location failed, retry - } + WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1'); + WaypointSprite_Ping(self.waypointsprite_attachedforcarrier); + + sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) } void ka_TimeScoring() @@ -102,7 +102,8 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth // messages and sounds ka_EventLog("pickup", other); Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname); - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname); + Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname); + Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF); sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) // scoring