diff options
author | Tim Angus <tim@ngus.net> | 2005-09-02 16:25:20 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-09-02 16:25:20 +0000 |
commit | 65633ae078febacbf6c09ff806cc3bd992eea7c3 (patch) | |
tree | 6d413b4ec0844e3530dfcd11f8a1f8f160bdf895 /src/game | |
parent | 3f65e1b88cdf9348d8dd816f480f16478b959a1b (diff) |
* Added option for changing whether or not the wallwalk control is a toggle or not
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_pmove.c | 26 | ||||
-rw-r--r-- | src/game/bg_public.h | 3 | ||||
-rw-r--r-- | src/game/g_client.c | 8 |
3 files changed, 28 insertions, 9 deletions
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" ); |