mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Merge pull request #1547 from def-/pr-kill-harder
After a char was killed stop processing further tiles
This commit is contained in:
commit
4ed50440a8
|
@ -1442,7 +1442,6 @@ void CCharacter::HandleTiles(int Index)
|
||||||
// start
|
// start
|
||||||
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN) || FTile1 == TILE_BEGIN || FTile2 == TILE_BEGIN || FTile3 == TILE_BEGIN || FTile4 == TILE_BEGIN || Tile1 == TILE_BEGIN || Tile2 == TILE_BEGIN || Tile3 == TILE_BEGIN || Tile4 == TILE_BEGIN) && (m_DDRaceState == DDRACE_NONE || m_DDRaceState == DDRACE_FINISHED || (m_DDRaceState == DDRACE_STARTED && !Team() && g_Config.m_SvTeam != 3)))
|
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN) || FTile1 == TILE_BEGIN || FTile2 == TILE_BEGIN || FTile3 == TILE_BEGIN || FTile4 == TILE_BEGIN || Tile1 == TILE_BEGIN || Tile2 == TILE_BEGIN || Tile3 == TILE_BEGIN || Tile4 == TILE_BEGIN) && (m_DDRaceState == DDRACE_NONE || m_DDRaceState == DDRACE_FINISHED || (m_DDRaceState == DDRACE_STARTED && !Team() && g_Config.m_SvTeam != 3)))
|
||||||
{
|
{
|
||||||
bool CanBegin = true;
|
|
||||||
if(g_Config.m_SvResetPickups)
|
if(g_Config.m_SvResetPickups)
|
||||||
{
|
{
|
||||||
for (int i = WEAPON_SHOTGUN; i < NUM_WEAPONS; ++i)
|
for (int i = WEAPON_SHOTGUN; i < NUM_WEAPONS; ++i)
|
||||||
|
@ -1460,14 +1459,12 @@ void CCharacter::HandleTiles(int Index)
|
||||||
m_LastStartWarning = Server()->Tick();
|
m_LastStartWarning = Server()->Tick();
|
||||||
}
|
}
|
||||||
Die(GetPlayer()->GetCID(), WEAPON_WORLD);
|
Die(GetPlayer()->GetCID(), WEAPON_WORLD);
|
||||||
CanBegin = false;
|
return;
|
||||||
}
|
}
|
||||||
if(CanBegin)
|
|
||||||
{
|
|
||||||
Teams()->OnCharacterStart(m_pPlayer->GetCID());
|
Teams()->OnCharacterStart(m_pPlayer->GetCID());
|
||||||
m_CpActive = -2;
|
m_CpActive = -2;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// finish
|
// finish
|
||||||
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END) || FTile1 == TILE_END || FTile2 == TILE_END || FTile3 == TILE_END || FTile4 == TILE_END || Tile1 == TILE_END || Tile2 == TILE_END || Tile3 == TILE_END || Tile4 == TILE_END) && m_DDRaceState == DDRACE_STARTED)
|
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END) || FTile1 == TILE_END || FTile2 == TILE_END || FTile3 == TILE_END || FTile4 == TILE_END || Tile1 == TILE_END || Tile2 == TILE_END || Tile3 == TILE_END || Tile4 == TILE_END) && m_DDRaceState == DDRACE_STARTED)
|
||||||
|
@ -2118,15 +2115,25 @@ void CCharacter::DDRacePostCoreTick()
|
||||||
|
|
||||||
int CurrentIndex = GameServer()->Collision()->GetMapIndex(m_Pos);
|
int CurrentIndex = GameServer()->Collision()->GetMapIndex(m_Pos);
|
||||||
HandleSkippableTiles(CurrentIndex);
|
HandleSkippableTiles(CurrentIndex);
|
||||||
|
if(!m_Alive)
|
||||||
|
return;
|
||||||
|
|
||||||
// handle Anti-Skip tiles
|
// handle Anti-Skip tiles
|
||||||
std::list < int > Indices = GameServer()->Collision()->GetMapIndices(m_PrevPos, m_Pos);
|
std::list < int > Indices = GameServer()->Collision()->GetMapIndices(m_PrevPos, m_Pos);
|
||||||
if(!Indices.empty())
|
if(!Indices.empty())
|
||||||
|
{
|
||||||
for(std::list < int >::iterator i = Indices.begin(); i != Indices.end(); i++)
|
for(std::list < int >::iterator i = Indices.begin(); i != Indices.end(); i++)
|
||||||
|
{
|
||||||
HandleTiles(*i);
|
HandleTiles(*i);
|
||||||
|
if(!m_Alive)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HandleTiles(CurrentIndex);
|
HandleTiles(CurrentIndex);
|
||||||
|
if(!m_Alive)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// teleport gun
|
// teleport gun
|
||||||
|
|
Loading…
Reference in a new issue