From 65633ae078febacbf6c09ff806cc3bd992eea7c3 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 2 Sep 2005 16:25:20 +0000 Subject: * Added option for changing whether or not the wallwalk control is a toggle or not --- src/game/bg_pmove.c | 26 ++++++++++++++++++-------- src/game/bg_public.h | 3 ++- src/game/g_client.c | 8 ++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index bceba335..6fbc059b 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -1997,18 +1997,28 @@ static void PM_GroundTrace( void ) if( BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_WALLCLIMBER ) ) { - //toggle wall climbing if holding crouch - if( pm->cmd.upmove < 0 && !( pm->ps->pm_flags & PMF_CROUCH_HELD ) ) + if( pm->ps->persistant[ PERS_STATE ] & PS_WALLCLIMBINGTOGGLE ) { - if( !( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) + //toggle wall climbing if holding crouch + if( pm->cmd.upmove < 0 && !( pm->ps->pm_flags & PMF_CROUCH_HELD ) ) + { + if( !( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) ) + pm->ps->stats[ STAT_STATE ] |= SS_WALLCLIMBING; + else if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) + pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; + + pm->ps->pm_flags |= PMF_CROUCH_HELD; + } + else if( pm->cmd.upmove >= 0 ) + pm->ps->pm_flags &= ~PMF_CROUCH_HELD; + } + else + { + if( pm->cmd.upmove < 0 ) pm->ps->stats[ STAT_STATE ] |= SS_WALLCLIMBING; - else if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) + else if( pm->cmd.upmove >= 0 ) pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; - - pm->ps->pm_flags |= PMF_CROUCH_HELD; } - else if( pm->cmd.upmove >= 0 ) - pm->ps->pm_flags &= ~PMF_CROUCH_HELD; if( pm->ps->pm_type == PM_DEAD ) pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 5055a632..b67eaac2 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -264,7 +264,8 @@ typedef enum } persEnum_t; #define PS_WALLCLIMBINGFOLLOW 0x00000001 -#define PS_NONSEGMODEL 0x00000002 +#define PS_WALLCLIMBINGTOGGLE 0x00000002 +#define PS_NONSEGMODEL 0x00000004 // entityState_t->eFlags #define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD diff --git a/src/game/g_client.c b/src/game/g_client.c index 7c564be9..d137b9bb 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1052,6 +1052,14 @@ void ClientUserinfoChanged( int clientNum ) else client->ps.persistant[ PERS_STATE ] &= ~PS_WALLCLIMBINGFOLLOW; + // wallwalk toggle + s = Info_ValueForKey( userinfo, "cg_wwToggle" ); + + if( atoi( s ) ) + client->ps.persistant[ PERS_STATE ] |= PS_WALLCLIMBINGTOGGLE; + else + client->ps.persistant[ PERS_STATE ] &= ~PS_WALLCLIMBINGTOGGLE; + // teamInfo s = Info_ValueForKey( userinfo, "teamoverlay" ); -- cgit