Skip to content

Commit

Permalink
Prevent people from getting stuck in trees or game ending after duel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisinajar authored May 28, 2017
1 parent b220909 commit a554550
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion game/scripts/vscripts/components/duels/duels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ function Duels:CheckDuelStatus (hero)
if foundIt or player.id ~= playerId then
return
end
if not player.assigned or not player.duelNumber then
return
end

foundIt = true
local scoreIndex = player.team .. 'Living' .. player.duelNumber
DebugPrint('Found dead player on ' .. player.team .. ' team with scoreindex ' .. scoreIndex)
Expand Down Expand Up @@ -421,7 +425,8 @@ function Duels:SavePlayerState (hero)
end

function Duels:RestorePlayerState (hero, state)
hero:SetAbsOrigin(state.location)
self:SafeTeleport(hero, state.location, 150)

if state.hp > 0 then
hero:SetHealth(state.hp)
end
Expand Down

0 comments on commit a554550

Please sign in to comment.