Merge branch 'master' of github.com:GreYFoXGTi/DDRace into Cleanup

This commit is contained in:
GreYFoXGTi 2010-10-07 04:02:49 +02:00
commit c836c7f1f7
2 changed files with 15 additions and 6 deletions

View file

@ -834,7 +834,7 @@ void CCharacter::Tick()
// handle speedup tiles // handle speedup tiles
if(GameServer()->Collision()->IsSpeedup(MapIndex) == TILE_BOOST) if(GameServer()->Collision()->IsSpeedup(MapIndex) == TILE_BOOST)
{ {
vec2 Direction, TempVel = m_Core.m_Vel; vec2 Direction, MaxVel, TempVel = m_Core.m_Vel;
int Force, MaxSpeed = 0; int Force, MaxSpeed = 0;
GameServer()->Collision()->GetSpeedup(MapIndex, &Direction, &Force, &MaxSpeed); GameServer()->Collision()->GetSpeedup(MapIndex, &Direction, &Force, &MaxSpeed);
if( if(
@ -845,11 +845,20 @@ void CCharacter::Tick()
) )
m_Core.m_Pos = m_PrevPos; m_Core.m_Pos = m_PrevPos;
TempVel += Direction * Force; TempVel += Direction * Force;
if(TempVel < Direction*(MaxSpeed/5) || !MaxSpeed) MaxVel = Direction*(MaxSpeed/5);
m_Core.m_Vel = TempVel; if(TempVel.x < MaxVel.x || TempVel.y < MaxVel.y || !MaxSpeed)
{
if((int)Direction.x)
m_Core.m_Vel.x = TempVel.x;
if((int)Direction.y)
m_Core.m_Vel.y = TempVel.y;
}
else else
{ {
m_Core.m_Vel = Direction*(MaxSpeed/5) + Direction; if((int)Direction.x)
m_Core.m_Vel.x = MaxVel.x + Direction.x;
if((int)Direction.y)
m_Core.m_Vel.y = MaxVel.y + Direction.y;
} }
//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); //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);

View file

@ -1841,7 +1841,7 @@ void CGameContext::ConSuper(IConsole::IResult *pResult, void *pUserData, int Cli
if (pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim])) if (pSelf->m_apPlayers[Victim] && compare_players(pSelf->m_apPlayers[ClientId],pSelf->m_apPlayers[Victim]))
{ {
CCharacter* chr = pSelf->GetPlayerChar(Victim); CCharacter* chr = pSelf->GetPlayerChar(Victim);
if(chr) if(chr && !chr->m_Super)
{ {
chr->m_Super = true; chr->m_Super = true;
chr->UnFreeze(); chr->UnFreeze();
@ -1877,7 +1877,7 @@ void CGameContext::ConSuperMe(IConsole::IResult *pResult, void *pUserData, int C
if (pSelf->m_apPlayers[ClientId]) if (pSelf->m_apPlayers[ClientId])
{ {
CCharacter* chr = pSelf->GetPlayerChar(ClientId); CCharacter* chr = pSelf->GetPlayerChar(ClientId);
if(chr) if(chr && !chr->m_Super)
{ {
chr->m_Super = true; chr->m_Super = true;
chr->UnFreeze(); chr->UnFreeze();