Added logging and prevented null pointer issue when attack ships could not be spawned on destroy duty missions.

This commit is contained in:
Cekis
2018-03-23 16:02:48 -07:00
committed by CekisSWG
parent 2ad9e06ea3
commit ef6e09698f
+4
View File
@@ -352,6 +352,10 @@ public class destroy_duty extends script.base_script
gloc = gloc.move_p(vd);
}
obj_id newship = space_create.createShipHyperspace(ships[j][ship], gloc);
if(!isValidId(newship) || !isGameObjectTypeOf(getGameObjectType(newShip),GOT_ship)) {
LOG("DESIGNER_FATAL","QUEST: spacequest/" + questType + "/" + questName + " New ship (" + ships[j][ship] + ":" + newship + ") which " + (isGameObjectTypeOf(getGameObjectType(newship),GOT_ship) ? "is" : "is not") + " a ship could not be created.");
continue;
}
ship_ai.unitSetLeashDistance(newship, 16000);
if (count > 3)
{