Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter not works in Tilemap.get_used_cells_by_id() #80718

Closed
zincles opened this issue Aug 17, 2023 · 8 comments · Fixed by #80729
Closed

filter not works in Tilemap.get_used_cells_by_id() #80718

zincles opened this issue Aug 17, 2023 · 8 comments · Fixed by #80729
Assignees
Milestone

Comments

@zincles
Copy link

zincles commented Aug 17, 2023

Godot version

4.2.dev3.official[013e8e3]

System information

Godot v4.2.dev3 - Arch Linux #1 SMP PREEMPT_DYNAMIC Fri, 11 Aug 2023 11:03:36 +0000 - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 2060 (nvidia; 535.98) - Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (16 Threads)

Issue description

TileMap.get_used_cells_by_id() seems not work as expected.
It seems that this method will return the same result as "TileMap.get_used_cells()" since Godot 4.2dev2.
The arguments (source_id: int, atlas_coords: Vector2i, alternative_tile: int) of get_used_cells_by_id() seems not make the filter working as expected. It would only return the same result as get_used_cells(), contains all the tiles on the layer.

Steps to reproduce

  1. create a tilemap scene
  2. attach a tileset, that contains at least 2 tiles , paint some tiles.
  3. calls Tilemap.get_used_cells_by_id(layer, source_id, atlas_coords,alternative_tile)
  4. run it

Minimal reproduction project

run tile_map.tscn by Godot4dev3 (or custom build)
tilemap_debug.zip

@AThousandShips
Copy link
Member

Appears to be an oversight, will look into a fix

@TerryCavanagh
Copy link

Hey, just to say as a passer by: I updated to Godot 4.2-dev3 today, and it broke my map parsing code. I've been digging into it and the cause seems to be that tilemap.get_used_cells_by_id is just returning every used tile in the tilemap - so I don't think this is fixed yet. (I'll roll back to dev1 for now)

@AThousandShips
Copy link
Member

AThousandShips commented Aug 31, 2023

That's because this isn't in dev3, please make sure the version you're using actually includes a fix before commenting

Note that the bug report is for dev3 so the bug fix is obviously not in dev3

@TerryCavanagh
Copy link

sheesh, my mistake, whatever. I found this issue by searching the godot discord!

@akien-mga
Copy link
Member

akien-mga commented Aug 31, 2023

No worry, it's easy to overlook. And it's better to report it twice than none ;)
4.2-dev4 should be published soon and will include this fix :)

@AThousandShips
Copy link
Member

Thank you for reporting, and sorry for my curt reply

@TerryCavanagh
Copy link

no worries, sorry for my overly dramatic response 😅

@AThousandShips
Copy link
Member

Thank you! And sorry for mine, I think I was a bit tired today, thank you for your positive response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants