Last active
May 31, 2016 08:57
-
-
Save Aessi/9805f2ee61671954174e34d3185cb776 to your computer and use it in GitHub Desktop.
Fix give up issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------- // | |
/** Unspawn a racing player and send him in the outro sequence | |
* | |
* @param _Player The player to unspawn | |
* @param _DisplayScoresTable Display the scores table during the outro | |
*/ | |
Void EndRace(CTmPlayer _Player, Boolean _DisplayScoresTable) { | |
if (_Player == Null) return; | |
declare LibTM2_SpawnStatus for _Player = C_SpawnStatus_Waiting; | |
// @Test start | |
// Don't switch to the outro status if the player was not racing | |
// Force the waiting status in this case | |
// This happens because the give up event can arrive at the | |
// same time or a few milliseconds before the finish event | |
// on the server side | |
declare IsRacing = ( | |
LibTM2_SpawnStatus == C_SpawnStatus_Racing && | |
_Player.IsSpawned == True && | |
_Player.RaceStartTime >= 0 && | |
_Player.RaceStartTime <= Now | |
); | |
if (!IsRacing) { | |
WaitRace(_Player); | |
return; | |
} | |
// @Test end | |
LibTM2_SpawnStatus = C_SpawnStatus_Outro; | |
Private_OutroStart(_Player, _DisplayScoresTable); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment