mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +00:00
Delay creation of inverse entity updates
This fixes the recording of projectile updates in a region.
This commit is contained in:
@@ -400,7 +400,7 @@ public final class Region {
|
|||||||
*/
|
*/
|
||||||
private <T extends Entity & GroupableEntity> void record(T entity, EntityUpdateType update) {
|
private <T extends Entity & GroupableEntity> void record(T entity, EntityUpdateType update) {
|
||||||
UpdateOperation<?> operation = entity.toUpdateOperation(this, update);
|
UpdateOperation<?> operation = entity.toUpdateOperation(this, update);
|
||||||
RegionUpdateMessage message = operation.toMessage(), inverse = operation.inverse();
|
RegionUpdateMessage message = operation.toMessage();
|
||||||
|
|
||||||
int height = entity.getPosition().getHeight();
|
int height = entity.getPosition().getHeight();
|
||||||
Set<RegionUpdateMessage> updates = this.updates.get(height);
|
Set<RegionUpdateMessage> updates = this.updates.get(height);
|
||||||
@@ -411,12 +411,12 @@ public final class Region {
|
|||||||
if (update == EntityUpdateType.REMOVE) {
|
if (update == EntityUpdateType.REMOVE) {
|
||||||
removedObjects.get(height).add(message);
|
removedObjects.get(height).add(message);
|
||||||
} else { // TODO should this really be possible?
|
} else { // TODO should this really be possible?
|
||||||
removedObjects.get(height).remove(inverse);
|
removedObjects.get(height).remove(operation.inverse());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update == EntityUpdateType.REMOVE && !type.isTransient()) {
|
if (update == EntityUpdateType.REMOVE && !type.isTransient()) {
|
||||||
updates.remove(inverse);
|
updates.remove(operation.inverse());
|
||||||
}
|
}
|
||||||
|
|
||||||
updates.add(message);
|
updates.add(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user