Changed logging for debugging on player structures.

This commit is contained in:
Cekis
2016-05-28 19:09:45 +01:00
parent 1aa9706549
commit c013266f06
@@ -380,19 +380,7 @@ public class player_structure extends script.base_script
setObjVar(structure, VAR_TEMP_PLACEMENT_HEIGHT, placementHeight);
setDeedTemplate(structure, deed_template);
setObjVar(structure, VAR_DEED_BUILDTIME, build_time);
String scene = null;
try {
scene = getDeedScene(deed);
}
catch(Exception e){
System.out.println("Couldnt get deed scene from deed: " + deed.toString());
System.out.println("Reason: " + e.getMessage());
System.out.println("Deed does " + (exists(deed) ? "" : "not") + " exist.");
System.out.println("Deed is " + (isIdValid(deed) ? "" : "not") + " valid.");
System.out.println("Deed owner: " + getOwner(deed) + " owners name: " + getName(getOwner(deed)));
e.printStackTrace();
return null;
}
String scene = getDeedScene(deed);
setObjVar(structure, VAR_DEED_SCENE, scene);
String cityName = getStringObjVar(deed, "cityName");
if (cityName != null && !cityName.equals(""))
@@ -1340,6 +1328,13 @@ public class player_structure extends script.base_script
}
public static String getDeedScene(obj_id deed) throws InterruptedException
{
if(deed == null || !isIdValid(deed) || !exists(deed) || deed.equals(obj_id.NULL_ID)) {
System.out.println("Couldnt get deed scene from deed: " + deed);
System.out.println("Deed does " + (exists(deed) ? "" : "not") + " exist.");
System.out.println("Deed is " + (isIdValid(deed) ? "" : "not") + " valid.");
System.out.println("Deed owner: " + getOwner(deed) + " owners name: " + getName(getOwner(deed)));
return null;
}
if (!hasObjVar(deed, VAR_DEED_SCENE))
{
return null;