mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fixed Speeders. Closes #79.
This commit is contained in:
parent
af36c64785
commit
9f7fc48ad7
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue