From: Mario Date: Thu, 6 Jun 2013 07:37:46 +0000 (+1000) Subject: Move jump grunt to the mutator system X-Git-Tag: xonotic-v0.8.0~366^2~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=05e03031f2c966fc296c93408c2bf78e3bc337cd;p=xonotic%2Fxonotic-data.pk3dir.git Move jump grunt to the mutator system --- diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 5424f1d8a..3263d627f 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -111,9 +111,6 @@ void PlayerJump (void) animdecide_setaction(self, ANIMACTION_JUMP, TRUE); - if(g_jump_grunt) - PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND); - self.restart_jump = -1; // restart jump anim next time // value -1 is used to not use the teleport bit (workaround for tiny hitch when re-jumping) } diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 1457836c8..74d4345b8 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -16,7 +16,7 @@ noref float require_spawnfunc_prefix; // if this float exists, only functions wi // Globals -float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_minstagib; +float g_cloaked, g_footsteps, g_grappling_hook, g_minstagib; float g_warmup_limit; float g_warmup_allguns; float g_warmup_allow_timeout; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index c55819704..46d0beeee 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -924,6 +924,7 @@ void readlevelcvars(void) CHECK_MUTATOR_ADD("g_random_gravity", mutator_random_gravity, 1); CHECK_MUTATOR_ADD("g_norecoil", mutator_norecoil, 1); CHECK_MUTATOR_ADD("g_multijump", mutator_multijump, 1); + CHECK_MUTATOR_ADD("g_jump_grunt", mutator_jump_grunt, 1); CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1); #undef CHECK_MUTATOR_ADD @@ -954,7 +955,6 @@ void readlevelcvars(void) g_cloaked = cvar("g_cloaked"); if(g_cts) g_cloaked = 1; // always enable cloak in CTS - g_jump_grunt = cvar("g_jump_grunt"); g_footsteps = cvar("g_footsteps"); g_grappling_hook = cvar("g_grappling_hook"); g_jetpack = cvar("g_jetpack"); diff --git a/qcsrc/server/mutators/mutator_jump_grunt.qc b/qcsrc/server/mutators/mutator_jump_grunt.qc new file mode 100644 index 000000000..b99d1c844 --- /dev/null +++ b/qcsrc/server/mutators/mutator_jump_grunt.qc @@ -0,0 +1,21 @@ +MUTATOR_HOOKFUNCTION(grunt_PlayerJump) +{ + if(self.flags & FL_ONGROUND) + PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND); + + return FALSE; +} + +MUTATOR_HOOKFUNCTION(grunt_BuildMutatorsString) +{ + ret_string = strcat(ret_string, ":JumpGrunt"); + return FALSE; +} + +MUTATOR_DEFINITION(mutator_jump_grunt) +{ + MUTATOR_HOOK(PlayerJump, grunt_PlayerJump, CBC_ORDER_ANY); + MUTATOR_HOOK(BuildMutatorsString, norecoil_BuildMutatorsString, CBC_ORDER_ANY); + + return FALSE; +} diff --git a/qcsrc/server/mutators/mutators.qh b/qcsrc/server/mutators/mutators.qh index 34e96a00f..243cfd71c 100644 --- a/qcsrc/server/mutators/mutators.qh +++ b/qcsrc/server/mutators/mutators.qh @@ -27,5 +27,6 @@ MUTATOR_DECLARATION(mutator_bloodloss); MUTATOR_DECLARATION(mutator_random_gravity); MUTATOR_DECLARATION(mutator_norecoil); MUTATOR_DECLARATION(mutator_multijump); +MUTATOR_DECLARATION(mutator_jump_grunt); MUTATOR_DECLARATION(sandbox); diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index d4a98e6d1..684ed03c9 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -254,6 +254,7 @@ mutators/mutator_bloodloss.qc mutators/mutator_random_gravity.qc mutators/mutator_norecoil.qc mutators/mutator_multijump.qc +mutators/mutator_jump_grunt.qc ../warpzonelib/anglestransform.qc ../warpzonelib/mathlib.qc