mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
MaxSpeed is now somewhat relative to m_Vel but not accurate
Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
parent
a02bceafed
commit
fda610aef3
|
@ -926,18 +926,17 @@ void CCharacter::Tick()
|
|||
m_Core.m_Vel.y += m_Core.m_Vel.y*1.1;
|
||||
}
|
||||
// handle speedup tiles
|
||||
//TODO:GFX Make MaxSpeed and Speed setters relative to Speedometer of the client
|
||||
if(GameServer()->Collision()->IsSpeedup(MapIndex) == TILE_BOOST)
|
||||
{
|
||||
vec2 Direction, TempVel = m_Core.m_Vel;
|
||||
int Force, MaxSpeed = 0;
|
||||
GameServer()->Collision()->GetSpeedup(MapIndex, &Direction, &Force, &MaxSpeed);
|
||||
TempVel += Direction * Force;
|
||||
if(TempVel < Direction*(MaxSpeed) || !MaxSpeed)
|
||||
if(TempVel < Direction*(MaxSpeed/5) || !MaxSpeed)
|
||||
m_Core.m_Vel = TempVel;
|
||||
else
|
||||
{
|
||||
m_Core.m_Vel = Direction*MaxSpeed;
|
||||
m_Core.m_Vel = Direction*(MaxSpeed/5) + Direction;
|
||||
}
|
||||
//dbg_msg("Direction","%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);
|
||||
|
||||
|
@ -947,7 +946,8 @@ void CCharacter::Tick()
|
|||
vec2 Direction;
|
||||
int Force;
|
||||
GameServer()->Collision()->GetSpeedup(MapIndex, &Direction, &Force, 0);
|
||||
m_Core.m_Vel = Direction*Force;
|
||||
Force/=5;
|
||||
m_Core.m_Vel = Direction*Force + Direction;
|
||||
//dbg_msg("Direction","%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);
|
||||
}
|
||||
m_LastBooster = MapIndex;
|
||||
|
@ -991,7 +991,7 @@ void CCharacter::Tick()
|
|||
if((int)m_Pos.x/32 < -200 || (int)m_Pos.x/32 > GameServer()->Collision()->GetWidth()+200 ||
|
||||
(int)m_Pos.y/32 < -200 || (int)m_Pos.y/32 > GameServer()->Collision()->GetHeight()+200)
|
||||
{
|
||||
;//Die(m_pPlayer->GetCID(), WEAPON_WORLD);
|
||||
Die(m_pPlayer->GetCID(), WEAPON_WORLD);
|
||||
}
|
||||
|
||||
// handle Weapons
|
||||
|
|
Loading…
Reference in a new issue