summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c26
-rw-r--r--src/game/bg_public.h3
-rw-r--r--src/game/g_client.c8
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" );