mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge branch 'master' of github.com:GreYFoXGTi/DDRace into Cleanup
This commit is contained in:
commit
c836c7f1f7
|
@ -834,7 +834,7 @@ void CCharacter::Tick()
|
|||
// handle speedup tiles
|
||||
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;
|
||||
GameServer()->Collision()->GetSpeedup(MapIndex, &Direction, &Force, &MaxSpeed);
|
||||
if(
|
||||
|
@ -845,11 +845,20 @@ void CCharacter::Tick()
|
|||
)
|
||||
m_Core.m_Pos = m_PrevPos;
|
||||
TempVel += Direction * Force;
|
||||
if(TempVel < Direction*(MaxSpeed/5) || !MaxSpeed)
|
||||
m_Core.m_Vel = TempVel;
|
||||
MaxVel = Direction*(MaxSpeed/5);
|
||||
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
|
||||
{
|
||||
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);
|
||||
|
||||
|
|
|
@ -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]))
|
||||
{
|
||||
CCharacter* chr = pSelf->GetPlayerChar(Victim);
|
||||
if(chr)
|
||||
if(chr && !chr->m_Super)
|
||||
{
|
||||
chr->m_Super = true;
|
||||
chr->UnFreeze();
|
||||
|
@ -1877,7 +1877,7 @@ void CGameContext::ConSuperMe(IConsole::IResult *pResult, void *pUserData, int C
|
|||
if (pSelf->m_apPlayers[ClientId])
|
||||
{
|
||||
CCharacter* chr = pSelf->GetPlayerChar(ClientId);
|
||||
if(chr)
|
||||
if(chr && !chr->m_Super)
|
||||
{
|
||||
chr->m_Super = true;
|
||||
chr->UnFreeze();
|
||||
|
|
Loading…
Reference in a new issue