Fixed Speeders. Closes #79.

This commit is contained in:
GreYFoXGTi 2010-10-08 16:45:14 +02:00
parent af36c64785
commit 9f7fc48ad7
2 changed files with 6 additions and 7 deletions

View file

@ -649,7 +649,6 @@ void CCollision::GetSpeedup(int Index, vec2 *Dir, int *Force, int *MaxSpeed)
TmpDir.x = (Direction.x*cos(Angle)) - (Direction.y*sin(Angle));
TmpDir.y = (Direction.x*sin(Angle)) + (Direction.y*cos(Angle));
*Dir = TmpDir;
//dbg_msg("GetSpeedup end","Direction %f %f, Force %d, Max Speed %d", (*Dir).x,(*Dir).y, *Force, *MaxSpeed);
}
int CCollision::IsCp(int x, int y)

View file

@ -885,21 +885,21 @@ void CCharacter::HandleTiles(int Index)
m_Core.m_Pos = m_PrevPos;
TempVel += Direction * Force;
MaxVel = Direction*(MaxSpeed/5);
if(TempVel.x < MaxVel.x || TempVel.y < MaxVel.y || !MaxSpeed)
if(absolute(TempVel.x) > MaxVel.x || absolute(TempVel.y) > MaxVel.y || !MaxSpeed)
{
if((int)Direction.x)
if(Direction.x)
m_Core.m_Vel.x = TempVel.x;
if((int)Direction.y)
if(Direction.y)
m_Core.m_Vel.y = TempVel.y;
}
else
{
if((int)Direction.x)
if(Direction.x)
m_Core.m_Vel.x = MaxVel.x + Direction.x;
if((int)Direction.y)
if(Direction.y)
m_Core.m_Vel.y = MaxVel.y + Direction.y;
}
dbg_msg("speedup tile end","%f %f %f %f %f %f",Direction.x,Direction.y,(Direction*Force).x,(Direction*Force).y,m_Core.m_Vel.x,m_Core.m_Vel.y);
dbg_msg("speedup tile end","(Direction*Force) %f %f m_Core.m_Vel%f %f",(Direction*Force).x,(Direction*Force).y,m_Core.m_Vel.x,m_Core.m_Vel.y);
dbg_msg("speedup tile end","Direction %f %f, Force %d, Max Speed %d", (Direction).x,(Direction).y, Force, MaxSpeed);
}
else if(GameServer()->Collision()->IsSpeedup(MapIndex) == TILE_BOOSTS)