From 8a0742bb6a59c8cf1e56ebdc72ebd97ddaa57d20 Mon Sep 17 00:00:00 2001 From: Cekis Date: Mon, 23 May 2016 22:59:09 +0100 Subject: [PATCH] Fixed issue where space mission was unable to remove waypoint from datapad (likely because it has already been removed or quest was completed). --- .../script/space/quest_logic/recovery.java | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/space/quest_logic/recovery.java diff --git a/sku.0/sys.server/compiled/game/script/space/quest_logic/recovery.java b/sku.0/sys.server/compiled/game/script/space/quest_logic/recovery.java old mode 100644 new mode 100755 index 3e2c5b88d..cac5bf1b5 --- a/sku.0/sys.server/compiled/game/script/space/quest_logic/recovery.java +++ b/sku.0/sys.server/compiled/game/script/space/quest_logic/recovery.java @@ -1,21 +1,7 @@ package script.space.quest_logic; import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.space_create; -import script.library.space_quest; -import script.library.space_utils; -import script.library.space_crafting; -import script.library.space_transition; -import script.library.utils; -import script.library.ship_ai; -import script.library.prose; +import script.library.*; public class recovery extends script.base_script { @@ -494,6 +480,9 @@ public class recovery extends script.base_script } public int updateTargetWaypoint(obj_id self, dictionary params) throws InterruptedException { + if(self == null || self == obj_id.NULL_ID || !isIdValid(self)){ + return SCRIPT_CONTINUE; + } obj_id player = getObjIdObjVar(self, space_quest.QUEST_OWNER); obj_id ship = getObjIdObjVar(self, "target"); obj_id waypoint = getObjIdObjVar(self, "waypoint"); @@ -520,11 +509,12 @@ public class recovery extends script.base_script } public void clearMissionWaypoint(obj_id self) throws InterruptedException { - obj_id player = getObjIdObjVar(self, space_quest.QUEST_OWNER); - obj_id waypoint = getObjIdObjVar(self, "waypoint"); - if (isIdValid(waypoint)) - { - destroyWaypointInDatapad(waypoint, player); + if(isIdValid(self)) { + obj_id player = getObjIdObjVar(self, space_quest.QUEST_OWNER); + obj_id waypoint = getObjIdObjVar(self, "waypoint"); + if (isIdValid(waypoint) && isIdValid(player)) { + destroyWaypointInDatapad(waypoint, player); + } } } public void questCompleted(obj_id self) throws InterruptedException