mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
minor changes
This commit is contained in:
parent
0a08e1ca06
commit
e0bb8731a7
|
@ -404,14 +404,14 @@ int CCollision::IsSpeedup(int Index)
|
|||
return false;
|
||||
|
||||
if(m_pSpeedup[Index].m_Force > 0)
|
||||
return m_pSpeedup[Index].m_Type;
|
||||
return Index;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CCollision::GetSpeedup(int Index, vec2 *Dir, int *Force, int *MaxSpeed)
|
||||
{
|
||||
if(Index < 0)
|
||||
if(Index < 0 || !m_pSpeedup)
|
||||
return;
|
||||
vec2 Direction = vec2(1, 0);
|
||||
float Angle = m_pSpeedup[Index].m_Angle * (pi / 180.0f);
|
||||
|
|
|
@ -95,7 +95,8 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
|||
if(m_pPlayer->m_RconFreeze) Freeze(-1);
|
||||
GameServer()->m_pController->OnCharacterSpawn(this);
|
||||
|
||||
if(GetPlayer()->m_IsUsingDDRaceClient) {
|
||||
if(GetPlayer()->m_IsUsingDDRaceClient)
|
||||
{
|
||||
Controller->m_Teams.SendTeamsState(GetPlayer()->GetCID());
|
||||
}
|
||||
|
||||
|
@ -839,19 +840,20 @@ void CCharacter::Tick()
|
|||
}
|
||||
|
||||
// handle tiles
|
||||
int CurrentIndex = GameServer()->Collision()->GetPureMapIndex(m_Pos);
|
||||
std::list < int > Indices = GameServer()->Collision()->GetMapIndices(m_PrevPos, m_Pos);
|
||||
if(!Indices.empty())
|
||||
for(std::list < int >::iterator i = Indices.begin(); i != Indices.end(); i++)
|
||||
HandleTiles(*i);
|
||||
else
|
||||
HandleTiles(GameServer()->Collision()->GetPureMapIndex(m_Pos));
|
||||
HandleTiles(CurrentIndex);
|
||||
// handle speedup tiles
|
||||
if(GameServer()->Collision()->IsSpeedup(GameServer()->Collision()->GetPureMapIndex(m_Pos)) == TILE_BOOST)
|
||||
if(GameServer()->Collision()->IsSpeedup(CurrentIndex))
|
||||
{
|
||||
vec2 Direction, MaxVel, TempVel = m_Core.m_Vel;
|
||||
int Force, MaxSpeed = 0;
|
||||
float TeeAngle, SpeederAngle, DiffAngle, SpeedLeft, TeeSpeed;
|
||||
GameServer()->Collision()->GetSpeedup(GameServer()->Collision()->GetPureMapIndex(m_Pos), &Direction, &Force, &MaxSpeed);
|
||||
GameServer()->Collision()->GetSpeedup(CurrentIndex, &Direction, &Force, &MaxSpeed);
|
||||
if(Force == 255 && MaxSpeed)
|
||||
{
|
||||
m_Core.m_Vel = Direction * (MaxSpeed/5);
|
||||
|
@ -916,7 +918,6 @@ void CCharacter::Tick()
|
|||
//dbg_msg("speedup tile end","Direction %f %f, Force %d, Max Speed %d", (Direction).x,(Direction).y, Force, MaxSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
// handle Weapons
|
||||
HandleWeapons();
|
||||
|
||||
|
|
Loading…
Reference in a new issue