From a0901373af2cbedbdf0fea424c390ef429e793ea Mon Sep 17 00:00:00 2001 From: tankefugl Date: Wed, 27 Jul 2005 22:20:42 +0000 Subject: [PATCH] Mantis 0001094: o Tweaked walljumping - Skulk will no longer walljump when the player is looking at a wall - Skulk will bounce slightly outward (velocity of 25) when jumping from a wall - Fixed bug where skulk could not walljump from sloped walls (ie CC on eclipse) git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@305 67975925-1194-0748-b3d5-c16f83f1a3a1 --- releases/3.1/source/pm_shared/pm_shared.cpp | 23 +++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/releases/3.1/source/pm_shared/pm_shared.cpp b/releases/3.1/source/pm_shared/pm_shared.cpp index 9f12c4b0..495e0fd2 100644 --- a/releases/3.1/source/pm_shared/pm_shared.cpp +++ b/releases/3.1/source/pm_shared/pm_shared.cpp @@ -1471,16 +1471,17 @@ void NS_UpdateWallsticking() if (wallsticking) { // tankefugl: 0000972 - if (/*theSurfaceNormal[2] < 0.95 && */ pmove->waterjumptime == 0) + if (pmove->waterjumptime == 0) { //float dotNormalView = DotProduct(pmove->forward, theSurfaceNormal); vec3_t tempNormal = {0, 0, 0}; bool checkedDownOffset = NS_CheckOffsetFromOrigin(0, 0, theMinPoint[2], tempNormal); - if (/*dotNormalView < 0.7 && */(checkedDownOffset == false)) + VectorNormalize(tempNormal); + if ((checkedDownOffset == false) || (tempNormal[2] < 0.7f && tempNormal[2] > 0.05f)) { VectorCopy(theSurfaceNormal, gSurfaceNormal); - if (/*theSurfaceNormal[2] < 0.7 && */(pmove->cmd.buttons & IN_WALK)) + if (pmove->cmd.buttons & IN_WALK) { vec3_t theDispVect; VectorScale(theSurfaceNormal, theMinPoint[0], theDispVect); @@ -5210,10 +5211,11 @@ void PM_Jump (void) } // tankefugl: 0000972 walljump - if (canWallJump && (GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING) && (pmove->cmd.buttons & IN_JUMP) && !(pmove->oldbuttons & IN_JUMP) && (gSurfaceNormal[2] < 0.3))) + if (canWallJump && (GetHasUpgrade(pmove->iuser4, MASK_WALLSTICKING) && (pmove->cmd.buttons & IN_JUMP) && !(pmove->oldbuttons & IN_JUMP) /*&& (gSurfaceNormal[2] < 0.7)*/)) { vec3_t theDirectionVec; //VectorCopy(pmove->velocity, theDirectionVec); + //VectorAdd(pmove->basevelocity, pmove->forward, theDirectionVec); //if (Length(theDirectionVec) == 0.0f) VectorCopy(pmove->forward, theDirectionVec); @@ -5222,14 +5224,17 @@ void PM_Jump (void) vec3_t novar; if (!NS_CheckOffsetFromOrigin(theDirectionVec[0] * 5, theDirectionVec[1] * 5, theDirectionVec[2] * 5, novar)) { + VectorCopy(pmove->forward, theDirectionVec); + VectorNormalize(theDirectionVec); + VectorScale(theDirectionVec, pmove->maxspeed + 50, pmove->velocity); pmove->velocity[2] += 100; - - //vec3_t theJumpVect; - //VectorScale(gSurfaceNormal, 50, theJumpVect); - //VectorAdd(theJumpVect, pmove->velocity, pmove->velocity); - PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 0.4 ); + vec3_t theJumpVect; + VectorScale(gSurfaceNormal, 25, theJumpVect); + VectorAdd(theJumpVect, pmove->velocity, pmove->velocity); + + PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 0.35 ); pmove->waterjumptime = 100; }