mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #3966
3966: Fix "tee hasn't hit the start line yet" error r=def- a=heinrich5991 It has been happening to all teams. Send `CGameTeams::OnCharacterStart` even if the team has already started. ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
commit
9bfe4ec76a
|
@ -62,8 +62,9 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
|
|||
int FTile4 = GameServer()->Collision()->GetFTileIndex(S4);
|
||||
|
||||
const int PlayerDDRaceState = pChr->m_DDRaceState;
|
||||
bool IsOnStartTile = (m_TileIndex == TILE_START) || (m_TileFIndex == TILE_START) || FTile1 == TILE_START || FTile2 == TILE_START || FTile3 == TILE_START || FTile4 == TILE_START || Tile1 == TILE_START || Tile2 == TILE_START || Tile3 == TILE_START || Tile4 == TILE_START;
|
||||
// start
|
||||
if(((m_TileIndex == TILE_START) || (m_TileFIndex == TILE_START) || FTile1 == TILE_START || FTile2 == TILE_START || FTile3 == TILE_START || FTile4 == TILE_START || Tile1 == TILE_START || Tile2 == TILE_START || Tile3 == TILE_START || Tile4 == TILE_START) && (PlayerDDRaceState == DDRACE_NONE || PlayerDDRaceState == DDRACE_FINISHED || (PlayerDDRaceState == DDRACE_STARTED && !GetPlayerTeam(ClientID) && g_Config.m_SvTeam != 3)))
|
||||
if(IsOnStartTile && PlayerDDRaceState != DDRACE_CHEAT)
|
||||
{
|
||||
if(m_Teams.GetSaving(GetPlayerTeam(ClientID)))
|
||||
{
|
||||
|
|
|
@ -68,6 +68,8 @@ void CGameTeams::OnCharacterStart(int ClientID)
|
|||
CCharacter *pStartingChar = Character(ClientID);
|
||||
if(!pStartingChar)
|
||||
return;
|
||||
if(g_Config.m_SvTeam == 3 && pStartingChar->m_DDRaceState == DDRACE_STARTED)
|
||||
return;
|
||||
if((g_Config.m_SvTeam == 3 || m_Core.Team(ClientID) != TEAM_FLOCK) && pStartingChar->m_DDRaceState == DDRACE_FINISHED)
|
||||
return;
|
||||
if(g_Config.m_SvTeam != 3 &&
|
||||
|
|
Loading…
Reference in a new issue