This commit is contained in:
parent
e9b55a9197
commit
d704a0fd92
1 changed files with 33 additions and 20 deletions
|
@ -2823,7 +2823,6 @@ int CPlayer::moveVertical(int _moveDistance)
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int checkside=+1;
|
||||
int CPlayer::moveHorizontal(int _moveDistance)
|
||||
{
|
||||
int hitWall;
|
||||
|
@ -2890,6 +2889,20 @@ int CPlayer::moveHorizontal(int _moveDistance)
|
|||
{
|
||||
// SB touching ground on at least one edge
|
||||
colHeight=getHeightFromGround(x,pos.vy,16);
|
||||
|
||||
// Head collision ( a bit of a hack )
|
||||
int oktomove=false;
|
||||
switch ( CGameScene::getCollision()->getCollisionBlock( x, pos.vy-HEIGHT_FOR_HEAD_COLLISION ) & COLLISION_TYPE_MASK )
|
||||
{
|
||||
case COLLISION_TYPE_NORMAL:
|
||||
oktomove=true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(oktomove)
|
||||
{
|
||||
if(colHeight>=-2&&colHeight<=2)
|
||||
{
|
||||
// Move along the ground
|
||||
|
@ -2912,7 +2925,7 @@ int CPlayer::moveHorizontal(int _moveDistance)
|
|||
{
|
||||
// Moved off edge of ledge
|
||||
pos.vx+=dirToMove;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue