Addition of ItemManaTaskManager item owner check.

This commit is contained in:
MobiusDevelopment
2022-01-11 04:18:22 +00:00
parent aabe24f088
commit 4fc9d70c1e
56 changed files with 332 additions and 112 deletions

View File

@ -7368,7 +7368,7 @@ public class Player extends Playable
}
/**
* @return True if the Player is on line.
* @return True if the Player is online.
*/
public boolean isOnline()
{

View File

@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
item.decreaseMana(true);
final Player player = item.getActingPlayer();
if ((player == null) || player.isInOfflineMode())
{
return;
}
item.decreaseMana(item.isEquipped());
}
}