Move raise in Teleport command so that it gets caught if isInn is true

This commit is contained in:
Yogurt 2019-06-01 00:39:22 -07:00
parent 9cda72f1ab
commit ef117204b3

View File

@ -92,6 +92,14 @@ function onEventStarted(player, actor, triggerName, isTeleport)
if (choice == 1) then if (choice == 1) then
player:PlayAnimation(0x4000FFB); player:PlayAnimation(0x4000FFB);
player:SendGameMessage(worldMaster, 34104, 0x20); player:SendGameMessage(worldMaster, 34104, 0x20);
--bandaid fix for returning while dead, missing things like weakness and the heal number
if (player:GetHP() == 0) then
player:SetHP(player.GetMaxHP());
player:ChangeState(0);
player:PlayAnimation(0x01000066);
end
if (isInn) then if (isInn) then
--Return to Inn --Return to Inn
if (player:GetHomePointInn() == 1) then if (player:GetHomePointInn() == 1) then
@ -107,12 +115,6 @@ function onEventStarted(player, actor, triggerName, isTeleport)
if (destination ~= nil) then if (destination ~= nil) then
randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5); randoPos = getRandomPointInBand(destination[2], destination[4], 3, 5);
rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]); rotation = getAngleFacing(randoPos.x, randoPos.y, destination[2], destination[4]);
--bandaid fix for returning while dead, missing things like weakness and the heal number
if (player:IsDead()) then
player:SetHP(player.GetMaxHP());
player:ChangeState(0);
player:PlayAnimation(0x01000066);
end
GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation); GetWorldManager():DoZoneChange(player, destination[1], nil, 0, 2, randoPos.x, destination[3], randoPos.y, rotation);
end end