Fixed client crash when buffs clear on corpse

Corpse despawn now
Patrolling NPCs dont despawn, still fixing it
This commit is contained in:
CharonInferar
2014-08-25 00:33:51 +02:00
parent a0d5a85aca
commit 55c5219dd0
5 changed files with 89 additions and 52 deletions
+8 -7
View File
@@ -604,18 +604,19 @@ public class ObjectService implements INetworkDispatch {
@Override
public void run() {
try {
// Commented for now until found where the respawn is always set to 60 for any NPC
// try {
// // Commented for now until found where the respawn is always set to 60 for any NPC
// CreatureObject newObject = NGECore.getInstance().spawnService.spawnCreature(Template, 0, planet.getName(), cellId, spawnPosition.x, spawnPosition.y, spawnPosition.z, orientation.w, orientation.x, orientation.y, orientation.z, level);
// AIActor newAIActor = (AIActor)newObject.getAttachment("AI");
// newAIActor.cloneActor(((AIActor) object.getAttachment("AI")));
//object.setAttachment("AI", null);
} catch (Exception e) {
e.printStackTrace();
}
// //object.setAttachment("AI", null);
// } catch (Exception e) {
// e.printStackTrace();
// }
}
}, ((AIActor) object.getAttachment("AI")).getMobileTemplate().getRespawnTime(), TimeUnit.SECONDS);
//}, ((AIActor) object.getAttachment("AI")).getMobileTemplate().getRespawnTime(), TimeUnit.SECONDS);
}, 20, TimeUnit.SECONDS);
}
String filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", "") + object.getTemplate().split("shared_" , 2)[1].replace(".iff", "") + ".py";