LuaSurface.can_place_entity{} could use more API details
Posted: Wed May 06, 2020 11:16 am
I was provided a screenshot of an error, and it said I didn't have property "stack" in a line which only had can_place_entity. See attachment.
Some testing revealed ghosts would produce a similar error, that the property "inner_name" was missing.
can_place_entity lists a limited number of key-value pairs for the table to pass, but it appears at least some of the entity-specific information that create_entity lists is required.
I'll be adding exceptions for anything that probably needs it. A ghost's inner-name makes sense for can_place_entity to check, but the property "stack" looks to be from an item-entity, which are all the same size (1/4 tile by 1/4 on ground, unless I am mistaken).
Some testing revealed ghosts would produce a similar error, that the property "inner_name" was missing.
can_place_entity lists a limited number of key-value pairs for the table to pass, but it appears at least some of the entity-specific information that create_entity lists is required.
I'll be adding exceptions for anything that probably needs it. A ghost's inner-name makes sense for can_place_entity to check, but the property "stack" looks to be from an item-entity, which are all the same size (1/4 tile by 1/4 on ground, unless I am mistaken).