From: Mario Date: Wed, 23 Jun 2021 03:16:38 +0000 (+1000) Subject: Reset dodging status when re-spawning players, fixes #2603 X-Git-Tag: xonotic-v0.8.5~395 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=73588b4fa5052e8915dad3081d4af4d905b4ea54;p=xonotic%2Fxonotic-data.pk3dir.git Reset dodging status when re-spawning players, fixes #2603 --- 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);