mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +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
|
// 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);
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue