Fixed issue with non-conversable creature from NPC lair throwing an exception because their location could not be identified (they were probably dead or despawned).

This commit is contained in:
Cekis
2018-03-23 15:58:18 -07:00
committed by CekisSWG
parent 5c9a4f23c5
commit 2137c08bbe
+6
View File
@@ -735,6 +735,9 @@ public class npc_lair_ai extends script.theme_park.poi.base
}
public int handleRequestToConverse(obj_id self, dictionary params) throws InterruptedException
{
if(!isValidId(self) || isIncapacitated(self) || isDead(self) || !exists(self)){
return SCRIPT_CONTINUE;
}
obj_id partner = params.getObjId("converseWith");
if (!isIdValid(partner) || !exists(partner))
{
@@ -744,6 +747,9 @@ public class npc_lair_ai extends script.theme_park.poi.base
utils.setScriptVar(self, "npc_lair.pathingToConverse", true);
location destLoc = new location(getLocation(partner));
location myLoc = getLocation(self);
if(myLoc == null || !isValidLocation(myLoc, 1f)){
return SCRIPT_CONTINUE;
}
if (myLoc.x < destLoc.x)
{
destLoc.x -= 1;