mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 16:49:11 +00:00
Fix bug when removing an entity from a sector.
This commit is contained in:
@@ -145,6 +145,11 @@ public final class Sector {
|
||||
*/
|
||||
public boolean removeEntity(Entity entity) {
|
||||
List<Entity> entities = this.entities.get(entity.getPosition());
|
||||
if (entities == null) {
|
||||
this.entities.put(entity.getPosition(), new ArrayList<Entity>());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entities.remove(entity)) {
|
||||
notifyListeners(entity);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user