News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

tile_x.is_empty() says false with water.

Started by Yona-TYT, May 29, 2018, 05:16:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

I have a problem with the logic of climate, water is an object? or is it a climate?

the tile_x.is_empty() function returns false when the climate is water, is this an error?

Yona-TYT

I need a function that indicates if the tile is empty, and that it works in the water and on land.

Dwachs

you can use the following check

return tile.is_water()  &&  (tile.find_object(mo_building)==null)  &&  (tile.find_object(mo_depot_water)==null)

on water tiles, and is_empty() for all other tiles.
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on May 29, 2018, 06:21:35 PMyou can use the following check return tile.is_water()  &&  (tile.find_object(mo_building)==null)  &&  (tile.find_object(mo_depot_water)==null) on water tiles, and is_empty() for all other tiles.
Thanks, although I confess that I would like it to be practical, using only one function.  ;)
Edit.
This works well:tile.get_objects().get_count() != 0