Цитата:
Сообщение от Deazer
showObjectsToPlayer не ? и делаем addVisibleObject в newRegion ну и не забываем removeVisibleObject в oldRegion
|
Проверил, всё вроде нормально
Код:
/**
* Put the given object into WorldRegion objects map. If it's a player, increment the counter (used for region activation/desactivation).
* @param object : The object to register into this region.
*/
public void addVisibleObject(WorldObject object)
{
if (object == null)
return;
_objects.put(object.getObjectId(), object);
if (object instanceof Player)
_playersCount.incrementAndGet();
}
Код:
if (newRegion != null)
{
newRegion.addVisibleObject(this);
newAreas = newRegion.getSurroundingRegions();
}
Код:
if (_region != null)
{
_region.removeVisibleObject(this);
oldAreas = _region.getSurroundingRegions();
}