mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 08:40:03 +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) {
|
public boolean removeEntity(Entity entity) {
|
||||||
List<Entity> entities = this.entities.get(entity.getPosition());
|
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)) {
|
if (entities.remove(entity)) {
|
||||||
notifyListeners(entity);
|
notifyListeners(entity);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user