MaxSpeed is now somewhat relative to m_Vel but not accurate

Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
GreYFoXGTi 2010-09-22 22:29:01 +03:00
parent a02bceafed
commit fda610aef3

View file

@ -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