summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-09-02 16:25:20 +0000
committerTim Angus <tim@ngus.net>2005-09-02 16:25:20 +0000
commit65633ae078febacbf6c09ff806cc3bd992eea7c3 (patch)
tree6d413b4ec0844e3530dfcd11f8a1f8f160bdf895 /src
parent3f65e1b88cdf9348d8dd816f480f16478b959a1b (diff)
* Added option for changing whether or not the wallwalk control is a toggle or not
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/game/bg_pmove.c26
-rw-r--r--src/game/bg_public.h3
-rw-r--r--src/game/g_client.c8
5 files changed, 31 insertions, 9 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index ad44eafc..7af0525b 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1462,6 +1462,7 @@ extern vmCvar_t cg_drawBBOX;
extern vmCvar_t cg_debugAlloc;
extern vmCvar_t cg_wwSmoothTime;
extern vmCvar_t cg_wwFollow;
+extern vmCvar_t cg_wwToggle;
extern vmCvar_t cg_depthSortParticles;
extern vmCvar_t cg_consoleLatency;
extern vmCvar_t cg_lightFlare;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 8a657ab7..fd890426 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -194,6 +194,7 @@ vmCvar_t cg_drawBBOX;
vmCvar_t cg_debugAlloc;
vmCvar_t cg_wwSmoothTime;
vmCvar_t cg_wwFollow;
+vmCvar_t cg_wwToggle;
vmCvar_t cg_depthSortParticles;
vmCvar_t cg_consoleLatency;
vmCvar_t cg_lightFlare;
@@ -298,6 +299,7 @@ static cvarTable_t cvarTable[ ] =
{ &cg_debugAlloc, "cg_debugAlloc", "0", 0 },
{ &cg_wwSmoothTime, "cg_wwSmoothTime", "300", CVAR_ARCHIVE },
{ &cg_wwFollow, "cg_wwFollow", "1", CVAR_ARCHIVE|CVAR_USERINFO },
+ { &cg_wwToggle, "cg_wwToggle", "1", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_depthSortParticles, "cg_depthSortParticles", "1", CVAR_ARCHIVE },
{ &cg_consoleLatency, "cg_consoleLatency", "3000", CVAR_ARCHIVE },
{ &cg_lightFlare, "cg_lightFlare", "3", CVAR_ARCHIVE },
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" );