From: bones_was_here Date: Fri, 7 Jul 2023 10:02:41 +0000 (+1000) Subject: test disabling ka pickup delay X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=87d8875e7901b6e5e4bc82fcb75d19444f88bdab;p=xonotic%2Fxonotic-data.pk3dir.git test disabling ka pickup delay --- diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc index c50d0d2fc..e68da03d9 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc +++ b/qcsrc/common/gamemodes/gamemode/keepaway/sv_keepaway.qc @@ -104,6 +104,7 @@ void ka_DamageEvent(entity this, entity inflictor, entity attacker, float damage ka_RespawnBall(this); } +.entity kh_previous_owner; void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball comes in contact with something { if (!this || game_stopped) @@ -123,7 +124,8 @@ void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball c sound(this, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM); return; } - else if(this.wait > time) { return; } + else if(this.wait > time && this.kh_previous_owner == toucher) + return; // attach the ball to the player this.owner = toucher; @@ -188,7 +190,8 @@ void ka_DropEvent(entity player) // runs any time that a player is supposed to l // reset the ball setattachment(ball, NULL, ""); set_movetype(ball, MOVETYPE_BOUNCE); - ball.wait = time + 1; + ball.kh_previous_owner = player; + ball.wait = time + 0.5; // same as for thrown weapons settouch(ball, ka_TouchEvent); setthink(ball, ka_RespawnBall); ball.nextthink = time + autocvar_g_keepawayball_respawntime; diff --git a/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc b/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc index 0be1e4663..2629594ef 100644 --- a/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc +++ b/qcsrc/common/gamemodes/gamemode/tka/sv_tka.qc @@ -81,6 +81,7 @@ void tka_TimeScoring(entity this) } } +.entity kh_previous_owner; void tka_TouchEvent(entity this, entity toucher) // runs any time that the ball comes in contact with something { if (!this || game_stopped) @@ -100,7 +101,8 @@ void tka_TouchEvent(entity this, entity toucher) // runs any time that the ball sound(this, CH_TRIGGER, SND_KA_TOUCH, VOL_BASE, ATTEN_NORM); return; } - else if(this.wait > time) { return; } + else if(this.wait > time && this.kh_previous_owner == toucher) + return; // attach the ball to the player this.owner = toucher; @@ -172,7 +174,8 @@ void tka_DropEvent(entity player) // runs any time that a player is supposed to // reset the ball setattachment(ball, NULL, ""); set_movetype(ball, MOVETYPE_BOUNCE); - ball.wait = time + 1; + ball.kh_previous_owner = player; + ball.wait = time + 0.5; // same as for thrown weapons settouch(ball, tka_TouchEvent); setthink(ball, tka_RespawnBall); ball.nextthink = time + autocvar_g_tkaball_respawntime;