Skip to content

Commit

Permalink
server: Fix strange artifacts with objects disappearing out of nowhere
Browse files Browse the repository at this point in the history
  • Loading branch information
tchx84 committed Feb 22, 2024
1 parent e7af523 commit 9475882
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/gameeky/server/game/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,8 @@ def remove(self, entity_id: int) -> None:
def prepare_for_entity_id(self, entity_id: int) -> CommonScene:
entity = self._entity_by_id[entity_id]

x = TILES_X / 2
y = TILES_Y / 2

distance_x = math.ceil(x) if entity.horizontally else math.floor(x)
distance_y = math.ceil(y) if entity.vertically else math.floor(y)
distance_x = math.ceil(TILES_X / 2)
distance_y = math.ceil(TILES_Y / 2)

entities = self._partition.find_by_distance(
target=entity,
Expand Down

0 comments on commit 9475882

Please sign in to comment.