]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move jump grunt to the mutator system
authorMario <mario.mario@y7mail.com>
Thu, 6 Jun 2013 07:37:46 +0000 (17:37 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 6 Jun 2013 07:37:46 +0000 (17:37 +1000)
qcsrc/server/cl_physics.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_jump_grunt.qc [new file with mode: 0644]
qcsrc/server/mutators/mutators.qh
qcsrc/server/progs.src

index 5424f1d8a11f31c64bafe06440915fa9b53dfe9e..3263d627f41ddd7123690887250f2f694ffe2bd3 100644 (file)
@@ -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)
 }
index 1457836c80e4586320e788e99fc6971c0f560bc3..74d4345b824529469b3855d185a249e14221ccd4 100644 (file)
@@ -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;
index c55819704e2005fb4a6d070431d84d5dae0e6b8d..46d0beeee6069cee890fd2768e9d085e520e2556 100644 (file)
@@ -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 (file)
index 0000000..b99d1c8
--- /dev/null
@@ -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;
+}
index 34e96a00fbb63b03706ea113e2e552f32e1b8cd5..243cfd71c61e67d46d477c915ba32f4afac3fea8 100644 (file)
@@ -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);
index d4a98e6d1654a8241fece9b98ebbe254e33089bd..684ed03c9fda119233100d8822d10aebd445fdae 100644 (file)
@@ -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