Fixed 2x and 1.5x boosters

Removed Unused Vars

Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
GreYFoXGTi 2010-08-24 03:30:22 +02:00
parent 8000f91ec7
commit ed575f9b0c
4 changed files with 13 additions and 13 deletions

View file

@ -79,7 +79,6 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
GameServer()->m_World.InsertEntity(this);
m_Alive = true;
dbg_msg("m_RconFreeze","%d",m_pPlayer->m_RconFreeze);
if(m_pPlayer->m_RconFreeze) Freeze(-1);
GameServer()->m_pController->OnCharacterSpawn(this);
@ -729,58 +728,61 @@ void CCharacter::Tick()
{
if(m_PrevPos.x-m_Pos.x<0)
m_Core.m_Vel.x += m_Core.m_Vel.x *-0.5;
else
else if(m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2)
m_Core.m_Vel.x += m_Core.m_Vel.x*0.5;
}
if (TileIndex1 == TILE_BOOST_R || TileIndex2 == TILE_BOOST_R)
{
if(m_PrevPos.x-m_Pos.x>0)
m_Core.m_Vel.x += m_Core.m_Vel.x *-0.5;
else
else if(m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2)
m_Core.m_Vel.x += m_Core.m_Vel.x*0.5;
}
if (TileIndex1 == TILE_BOOST_D || TileIndex2 == TILE_BOOST_D)
{
if(m_PrevPos.y-m_Pos.y>0)
m_Core.m_Vel.y += m_Core.m_Vel.y *-0.5;
else
else if(m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2)
m_Core.m_Vel.y += m_Core.m_Vel.y*0.5;
}
if (TileIndex1 == TILE_BOOST_U || TileIndex2 == TILE_BOOST_U)
{
if(m_PrevPos.y-m_Pos.y<0)
m_Core.m_Vel.y += m_Core.m_Vel.y *-0.5;
else
else if(m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2)
m_Core.m_Vel.y += m_Core.m_Vel.y*0.5;
}
if (TileIndex1 == TILE_BOOST_L2 || TileIndex2 == TILE_BOOST_L2)
if ((TileIndex1 == TILE_BOOST_L2 || TileIndex2 == TILE_BOOST_L2) && (m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2))
{
if(m_PrevPos.x-m_Pos.x<0)
m_Core.m_Vel.x = m_Core.m_Vel.x *-1.1;
else
m_Core.m_Vel.x += m_Core.m_Vel.x*1.1;
}
if (TileIndex1 == TILE_BOOST_R2|| TileIndex2 == TILE_BOOST_R2)
if ((TileIndex1 == TILE_BOOST_R2|| TileIndex2 == TILE_BOOST_R2) && (m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2))
{
if(m_PrevPos.x-m_Pos.x>0)
m_Core.m_Vel.x = m_Core.m_Vel.x *-1.1;
else
m_Core.m_Vel.x += m_Core.m_Vel.x*1.1;
}
if (TileIndex1 == TILE_BOOST_D2 || TileIndex2 == TILE_BOOST_D2)
if ((TileIndex1 == TILE_BOOST_D2 || TileIndex2 == TILE_BOOST_D2) && (m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2))
{
if(m_PrevPos.y-m_Pos.y>0)
m_Core.m_Vel.y = m_Core.m_Vel.y *-1.1;
else
m_Core.m_Vel.y += m_Core.m_Vel.y*1.1;
}
if (TileIndex1 == TILE_BOOST_U2 || TileIndex2 == TILE_BOOST_U2)
if ((TileIndex1 == TILE_BOOST_U2 || TileIndex2 == TILE_BOOST_U2) && (m_LastBooster != TileIndex1 || m_LastFBooster != TileIndex2))
{
if(m_PrevPos.y-m_Pos.y<0)
m_Core.m_Vel.y = m_Core.m_Vel.y *-1.1;
else
m_Core.m_Vel.y += m_Core.m_Vel.y*1.1;
}
m_LastBooster = TileIndex1;
m_LastFBooster = TileIndex2;
// handle speedup tiles
if(GameServer()->Collision()->IsSpeedup((int)m_Core.m_Pos.x, (int)m_Core.m_Pos.y))
{
vec2 Direction;

View file

@ -161,7 +161,8 @@ public:
int m_StartTime;
int m_RefreshTime;
int m_LastSpeedup;
int m_LastBooster;
int m_LastFBooster;
vec2 m_PrevPos;
// checkpoints

View file

@ -248,7 +248,6 @@ void CPlayer::LoadCharacter() {
Character->m_Armor = m_PauseInfo.m_Armor;
Character->m_PlayerState = m_PauseInfo.m_PlayerState;
Character->m_LastMove = m_PauseInfo.m_LastMove;
Character->m_LastSpeedup = m_PauseInfo.m_LastSpeedup;
Character->m_PrevPos = m_PauseInfo.m_PrevPos;
Character->m_ActiveWeapon = m_PauseInfo.m_ActiveWeapon;
Character->m_LastWeapon = m_PauseInfo.m_LastWeapon;
@ -276,7 +275,6 @@ void CPlayer::SaveCharacter()
m_PauseInfo.m_Armor = Character->m_Armor;
m_PauseInfo.m_PlayerState = Character->m_PlayerState;
m_PauseInfo.m_LastMove = Character->m_LastMove;
m_PauseInfo.m_LastSpeedup = Character->m_LastSpeedup;
m_PauseInfo.m_PrevPos = Character->m_PrevPos;
m_PauseInfo.m_ActiveWeapon = Character->m_ActiveWeapon;
m_PauseInfo.m_LastWeapon = Character->m_LastWeapon;

View file

@ -48,7 +48,6 @@ public:
int m_Armor;
int m_PlayerState;
int m_LastMove;
int m_LastSpeedup;
vec2 m_PrevPos;
int m_ActiveWeapon;
int m_LastWeapon;