X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fdodging%2Fsv_dodging.qc;h=53effbae20c20c89822b6f499e816998be992810;hp=a6611b755dabfa4026ba5a7c24446f2155934678;hb=73588b4fa5052e8915dad3081d4af4d905b4ea54;hpb=0934ac7344041e9f2b677066803c5b0e12e5a60c 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);