Fix off-by-one panic in tile_info

This commit is contained in:
Tobias Berger 2022-11-08 21:01:11 +01:00
parent 6420866b3d
commit 23eed81343
Signed by: toby
GPG key ID: 2D05EFAB764D6A88

View file

@ -30,7 +30,7 @@ impl WindowSystem for TileInfo<'_, '_> {
let world_manager = world.resource::<WorldManager>(); let world_manager = world.resource::<WorldManager>();
if cursor_x >= 0 if cursor_x >= 0
&& cursor_x <= world_manager.world().width.try_into().unwrap() && cursor_x < world_manager.world().width.try_into().unwrap()
&& cursor_y >= 0 && cursor_y >= 0
&& cursor_y < world_manager.world().height.try_into().unwrap() && cursor_y < world_manager.world().height.try_into().unwrap()
{ {