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 -4
View File
@@ -224,7 +224,8 @@ public class BuffService implements INetworkDispatch {
public void run() {
try {
removeBuffFromCreature(target, buff);
if (target!=null && buff != null)
removeBuffFromCreature(target, buff);
} catch (Exception e) {
e.printStackTrace();
}
@@ -243,10 +244,12 @@ public class BuffService implements INetworkDispatch {
public void run() {
try {
if (buffer == null || buffer.getClient() == null)
removeBuffFromCreature(target, buff);
if (target!=null && buff != null)
removeBuffFromCreature(target, buff);
if (target.getWorldPosition().getDistance2D(buffer.getWorldPosition()) > 80) {
removeBuffFromCreature(target, buff);
if (target!=null && buff != null)
removeBuffFromCreature(target, buff);
}
} catch (Exception e) {
e.printStackTrace();
@@ -388,7 +391,8 @@ public class BuffService implements INetworkDispatch {
if(buff.getRemainingDuration() > 0 && buff.getDuration() > 0) {
ScheduledFuture<?> task = scheduler.schedule(() -> {
try {
removeBuffFromCreature(creature, buff);
if (creature!=null && buff != null)
removeBuffFromCreature(creature, buff);
} catch (Exception e) {
e.printStackTrace();
}