From 6f80af0426b95970bbaea05ddce85c96abc63f6b Mon Sep 17 00:00:00 2001 From: tankefugl Date: Thu, 16 Jun 2005 19:22:08 +0000 Subject: [PATCH] Mantis 0001065: - Implemented a hybrid wallwalk -- the skulk now only "sticks" if +speed is held down - Added an IN_WALK flag, syncronized with the server state that can be used in the application to check whether a player is walking - Walljump is reverted to only jump in the direction the player is looking again, since a running player jumping from a wall usually wants to strafe inwards to stay on the wall Untickeded bug: - Fixed bug that caused leap to not behave properly from shallow water git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@191 67975925-1194-0748-b3d5-c16f83f1a3a1 --- main/source/cl_dll/input.cpp | 8 +++++++- main/source/common/in_buttons.h | 2 +- main/source/pm_shared/pm_shared.cpp | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/main/source/cl_dll/input.cpp b/main/source/cl_dll/input.cpp index 9a31d67..bf1dd23 100644 --- a/main/source/cl_dll/input.cpp +++ b/main/source/cl_dll/input.cpp @@ -1327,7 +1327,12 @@ int CL_ButtonBits( int bResetState ) { bits |= IN_ATTACK; } - + + if ( in_speed.state & 3 ) + { + bits |= IN_WALK; + } + // tankefugl: duck toggle if ( g_bDuckToggled ) { @@ -1416,6 +1421,7 @@ int CL_ButtonBits( int bResetState ) if ( bResetState ) { in_attack.state &= ~2; + in_speed.state &= ~2; in_duck.state &= ~2; in_jump.state &= ~2; in_forward.state &= ~2; diff --git a/main/source/common/in_buttons.h b/main/source/common/in_buttons.h index 1894b0a..5a499a8 100644 --- a/main/source/common/in_buttons.h +++ b/main/source/common/in_buttons.h @@ -30,7 +30,7 @@ #define IN_MOVELEFT (1 << 9) #define IN_MOVERIGHT (1 << 10) #define IN_ATTACK2 (1 << 11) -#define IN_RUN (1 << 12) +#define IN_WALK (1 << 12) #define IN_RELOAD (1 << 13) #define IN_ALT1 (1 << 14) #define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down diff --git a/main/source/pm_shared/pm_shared.cpp b/main/source/pm_shared/pm_shared.cpp index 9f264d3..fd6c1a3 100644 --- a/main/source/pm_shared/pm_shared.cpp +++ b/main/source/pm_shared/pm_shared.cpp @@ -1469,12 +1469,12 @@ void NS_UpdateWallsticking() { //float dotNormalView = DotProduct(pmove->forward, theSurfaceNormal); vec3_t tempNormal = {0, 0, 0}; - bool checkedDownOffset = NS_CheckOffsetFromOrigin(0, 0, theMinPoint[2] * 2, tempNormal); + bool checkedDownOffset = NS_CheckOffsetFromOrigin(0, 0, theMinPoint[2], tempNormal); if (/*dotNormalView < 0.7 && */(checkedDownOffset == false)) { VectorCopy(theSurfaceNormal, gSurfaceNormal); - if (theSurfaceNormal[2] < 0.7) + if (/*theSurfaceNormal[2] < 0.7 && */(pmove->cmd.buttons & IN_WALK)) { vec3_t theDispVect; VectorScale(theSurfaceNormal, theMinPoint[0], theDispVect); @@ -4366,7 +4366,7 @@ void PM_AlienAbilities() AvHMUGetEnergyCost(AVH_ABILITY_LEAP, theEnergyCost); // tankefugl: 0000972 // Add highjacked "watertime" to release leaping skulk from wall - pmove->waterjumptime = 75; + // pmove->waterjumptime = 75; // :tankefugl } @@ -5207,8 +5207,8 @@ void PM_Jump (void) if (canWallJump && (GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING) && (pmove->cmd.buttons & IN_JUMP) && !(pmove->oldbuttons & IN_JUMP) && (gSurfaceNormal[2] < 0.3))) { vec3_t theDirectionVec; - VectorCopy(pmove->velocity, theDirectionVec); - if (Length(theDirectionVec) == 0.0f) + //VectorCopy(pmove->velocity, theDirectionVec); + //if (Length(theDirectionVec) == 0.0f) VectorCopy(pmove->forward, theDirectionVec); VectorNormalize(theDirectionVec);