MeleeTriggerActionPlayerLeft
- comment
- patch
1.00
- Source
- Blizzard.j (raise an issue to discuss on Github or submit a PR)
- return type
nothing- Source code
function MeleeTriggerActionPlayerLeft takes nothing returns nothing local player thePlayer = GetTriggerPlayer() // Just show game over for observers when they leave if (IsPlayerObserver(thePlayer)) then call RemovePlayerPreserveUnitsBJ(thePlayer, PLAYER_GAME_RESULT_NEUTRAL, false) return endif call CachePlayerHeroData(thePlayer) // This is the same as defeat except the player generates the message // "player left the game" as opposed to "player was defeated". if (MeleeGetAllyCount(thePlayer) > 0) then // If at least one ally is still alive and kicking, share units with // them and proceed with death. call ShareEverythingWithTeam(thePlayer) call MeleeDoLeave(thePlayer) else // If no living allies remain, swap all units and buildings over to // neutral_passive and proceed with death. call MakeUnitsPassiveForTeam(thePlayer) call MeleeDoLeave(thePlayer) endif call MeleeCheckForLosersAndVictors() endfunction