mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
unsuper me now returns you to the previous team
forgot some dbgmsg
This commit is contained in:
parent
301a9d6953
commit
d20b7360b8
|
@ -150,8 +150,8 @@ std::list<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, int MaxIndices)
|
|||
nx = clamp((int)Tmp.x/32, 0, m_Width-1);
|
||||
ny = clamp((int)Tmp.y/32, 0, m_Height-1);
|
||||
Index = ny*m_Width+nx;
|
||||
dbg_msg("lastindex","%d",LastIndex);
|
||||
dbg_msg("index","%d",Index);
|
||||
//dbg_msg("lastindex","%d",LastIndex);
|
||||
//dbg_msg("index","%d",Index);
|
||||
if(
|
||||
(
|
||||
(m_pTiles[ny*m_Width+nx].m_Index >= TILE_FREEZE && m_pTiles[ny*m_Width+nx].m_Index < TILE_TELEIN) ||
|
||||
|
@ -168,7 +168,7 @@ std::list<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, int MaxIndices)
|
|||
if(MaxIndices && Indices.size() > MaxIndices) return Indices;
|
||||
Indices.push_back(Index);
|
||||
LastIndex = Index;
|
||||
dbg_msg("pushed","%d",Index);
|
||||
//dbg_msg("pushed","%d",Index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
|
|||
m_BroadCast = true;
|
||||
m_EyeEmote = true;
|
||||
m_Fly = true;
|
||||
m_TeamBeforeSuper = 0;
|
||||
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
||||
m_Core.Init(&GameServer()->m_World.m_Core, GameServer()->Collision(), &Controller->m_Teams.m_Core);
|
||||
m_Core.m_Pos = m_Pos;
|
||||
|
@ -672,7 +673,7 @@ void CCharacter::Tick()
|
|||
{
|
||||
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
||||
std::list < int > Indices = GameServer()->Collision()->GetMapIndices(m_PrevPos, m_Pos);
|
||||
dbg_msg("Indices","%d",Indices.size());
|
||||
//dbg_msg("Indices","%d",Indices.size());
|
||||
if(m_pPlayer->m_ForceBalanced)
|
||||
{
|
||||
char Buf[128];
|
||||
|
|
|
@ -110,6 +110,7 @@ public:
|
|||
|
||||
int m_HammerType;
|
||||
bool m_Super;
|
||||
int m_TeamBeforeSuper;
|
||||
bool m_Fly;
|
||||
|
||||
//DDRace
|
||||
|
|
|
@ -1881,6 +1881,8 @@ void CGameContext::ConSuper(IConsole::IResult *pResult, void *pUserData, int Cli
|
|||
{
|
||||
chr->m_Super = true;
|
||||
chr->UnFreeze();
|
||||
chr->m_TeamBeforeSuper = chr->Team();
|
||||
dbg_msg("Teamb4super","%d",chr->m_TeamBeforeSuper = chr->Team());
|
||||
chr->Teams()->SetCharacterTeam(Victim, TEAM_SUPER);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
|
@ -1899,6 +1901,7 @@ void CGameContext::ConUnSuper(IConsole::IResult *pResult, void *pUserData, int C
|
|||
if(chr)
|
||||
{
|
||||
chr->m_Super = false;
|
||||
chr->Teams()->SetForceCharacterTeam(Victim, chr->m_TeamBeforeSuper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1914,6 +1917,8 @@ void CGameContext::ConSuperMe(IConsole::IResult *pResult, void *pUserData, int C
|
|||
{
|
||||
chr->m_Super = true;
|
||||
chr->UnFreeze();
|
||||
chr->m_TeamBeforeSuper = chr->Team();
|
||||
dbg_msg("Teamb4super","%d",chr->m_TeamBeforeSuper = chr->Team());
|
||||
chr->Teams()->SetCharacterTeam(ClientId, TEAM_SUPER);
|
||||
if(!g_Config.m_SvCheatTime)
|
||||
chr->m_RaceState = RACE_CHEAT;
|
||||
|
@ -1931,6 +1936,7 @@ void CGameContext::ConUnSuperMe(IConsole::IResult *pResult, void *pUserData, int
|
|||
if(chr)
|
||||
{
|
||||
chr->m_Super = false;
|
||||
chr->Teams()->SetForceCharacterTeam(ClientId, chr->m_TeamBeforeSuper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue