From 4577ff6a20ff0cc8e3aa69220ec015bca6a3c60a Mon Sep 17 00:00:00 2001 From: NotAdam Date: Thu, 7 Mar 2019 22:24:42 +1100 Subject: [PATCH] minor teleport action script cleanup --- src/scripts/action/common/ActionTeleport5.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/scripts/action/common/ActionTeleport5.cpp b/src/scripts/action/common/ActionTeleport5.cpp index 0d0df5c5..e08afda6 100644 --- a/src/scripts/action/common/ActionTeleport5.cpp +++ b/src/scripts/action/common/ActionTeleport5.cpp @@ -23,21 +23,17 @@ public: auto teleportQuery = player->getTeleportQuery(); - if( player->getCurrency( Common::CurrencyType::Gil ) < teleportQuery.cost ) + if( player->getCurrency( Common::CurrencyType::Gil ) < teleportQuery.cost || + teleportQuery.targetAetheryte == 0 ) { action.interrupt(); return; } - if( teleportQuery.targetAetheryte == 0 ) - { - action.interrupt(); - } - player->removeCurrency( Common::CurrencyType::Gil, teleportQuery.cost ); player->setZoningType( Common::ZoneingType::Teleport ); - player->teleport( static_cast< uint16_t >( teleportQuery.targetAetheryte ) ); + player->teleport( teleportQuery.targetAetheryte ); player->clearTeleportQuery(); }