From 3e5f0835339c627a77f73f438c4d29c69a8e7a5e Mon Sep 17 00:00:00 2001 From: Cekis Date: Fri, 20 Jan 2017 18:04:03 +0000 Subject: [PATCH] Fixed issue occurring when a city region location could not decipher into a fictional name. --- .../compiled/game/script/library/locations.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/library/locations.java diff --git a/sku.0/sys.server/compiled/game/script/library/locations.java b/sku.0/sys.server/compiled/game/script/library/locations.java old mode 100644 new mode 100755 index 8acaf8ecf..c0680576a --- a/sku.0/sys.server/compiled/game/script/library/locations.java +++ b/sku.0/sys.server/compiled/game/script/library/locations.java @@ -648,8 +648,11 @@ public class locations extends script.base_script { return null; } - location locGoodLocation = new location(); string_id strFictionalName = utils.unpackString(rgnCity.getName()); + if(strFictionalName == null){ + LOG("mission_spam", "Can't unpack city name (" + rgnCity.getName() + ") to get fictional name."); + return null; + } String strAsciiId = strFictionalName.getAsciiId(); LOG("mission_spam", "strAsciiId is " + strAsciiId); int regionType = regions.getDeliverMissionRegionType(strAsciiId); @@ -658,10 +661,11 @@ public class locations extends script.base_script LOG("mission_spam", "strPlanet is " + strPlanet); if (rgnGoodLocations == null) { - LOG("mission_spam", "No regions were foind of type " + regionType); + LOG("mission_spam", "No regions were found of type " + regionType); return null; } region rgnSpawnRegion = rgnGoodLocations[rand(0, rgnGoodLocations.length - 1)]; + location locGoodLocation = new location(); locGoodLocation = getRegionCenter(rgnSpawnRegion); return locGoodLocation; }