From 73588b4fa5052e8915dad3081d4af4d905b4ea54 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 23 Jun 2021 13:16:38 +1000 Subject: [PATCH] Reset dodging status when re-spawning players, fixes #2603 --- .../mutators/mutator/dodging/sv_dodging.qc | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc index a6611b755..53effbae2 100644 --- a/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc +++ b/qcsrc/common/mutators/mutator/dodging/sv_dodging.qc @@ -310,6 +310,31 @@ MUTATOR_HOOKFUNCTION(dodging, PlayerPhysics) REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout"); REPLICATE(cvar_cl_dodging, bool, "cl_dodging"); +void dodging_ResetPlayer(entity this) +{ + this.last_dodging_time = 0; + + this.dodging_action = 0; + this.dodging_single_action = 0; + + this.dodging_force_total = 0; + this.dodging_force_remaining = 0; + + this.dodging_direction = '0 0 0'; +} + +MUTATOR_HOOKFUNCTION(dodging, PlayerSpawn) +{ + entity player = M_ARGV(0, entity); + dodging_ResetPlayer(player); +} + +MUTATOR_HOOKFUNCTION(dodging, MakePlayerObserver) +{ + entity player = M_ARGV(0, entity); + dodging_ResetPlayer(player); +} + MUTATOR_HOOKFUNCTION(dodging, GetPressedKeys) { entity player = M_ARGV(0, entity); -- 2.39.2