From: FruitieX Date: Mon, 9 Aug 2010 11:27:26 +0000 (+0300) Subject: Merge branch 'master' into mirceakitsune/multijump X-Git-Tag: xonotic-v0.1.0preview~361^2~11^2~7 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=992529cda6e328df91113b580eae2f1b3ef0cdfd Merge branch 'master' into mirceakitsune/multijump Conflicts: qcsrc/server/cl_physics.qc --- 992529cda6e328df91113b580eae2f1b3ef0cdfd diff --cc defaultXonotic.cfg index 9976b8e395,3b585d7237..5944d7e712 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@@ -823,14 -842,16 +842,21 @@@ exec balanceXonotic.cf set g_bloodloss 0 "amount of health below which blood loss occurs" - set g_footsteps 0 "serverside footstep sounds" + set g_footsteps 1 "serverside footstep sounds" - set g_multijump 0 "Number of multiple jumps to allow (jumping again in the air), -1 allows for infinite jumps" - set g_multijump_delay 0.25 "Delay between multiple jumps" - set g_multijump_speed 30 "Minimum vertical speed a player must have in order to jump again" + set g_deathglow 1.25 "when enabled, players stop glowing after they die (the value specifies glow fading speed)" + ++set g_multijump 1 "Number of multiple jumps to allow (jumping again in the air), -1 allows for infinite jumps" ++set g_multijump_add 0 "0 = make the current z velocity equal to jumpvelocity, 1 = add jumpvelocity to the current z velocity" ++set g_multijump_delay 0 "Delay between multiple jumps" ++set g_multijump_speed -999999 "Minimum vertical speed a player must have in order to jump again" + // effects r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints) + r_picmipworld 1 + gl_picmip_world 0 + gl_picmip_sprites 0 + gl_picmip_other 2 // so, picmip -2 is best possible quality r_mipsprites 1 r_mipskins 1 r_shadow_realtime_world_lightmaps 1 diff --cc qcsrc/server/cl_physics.qc index 11d0cbf253,70e702505c..83b2abd4f7 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@@ -57,28 -66,9 +70,33 @@@ void PlayerJump (void return; } - if (!doublejump) - if (!(self.flags & FL_ONGROUND)) - return; + if (cvar("g_multijump")) + { + if ((self.flags & FL_JUMPRELEASED) && !(self.flags & FL_ONGROUND)) + self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again + else if (self.flags & FL_ONGROUND) + { + if (cvar("g_multijump") > 0) + self.multijump_count = 0; + else + self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller + self.multijump_ready = FALSE; + } + } + + if(self.multijump_ready && time > self.multijump_delay && self.multijump_count < cvar("g_multijump") && self.velocity_z > cvar("g_multijump_speed")) + { + if (cvar("g_multijump") > 0) ++ { ++ if (cvar("g_multijump_add") == 0) // in this case we make the z velocity == jumpvelocity ++ self.velocity_z = 0; + self.multijump_count += 1; ++ } + self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump + } - else if (!(self.flags & FL_ONGROUND)) - return; ++ else if (!doublejump) ++ if (!(self.flags & FL_ONGROUND)) ++ return; if(!sv_pogostick) if (!(self.flags & FL_JUMPRELEASED))