[boskid][2.0.23] Changing tiles in on_chunk_generated changes landing location

This subforum contains all the issues which we already resolved.
s6x
Inserter
Inserter
Posts: 35
Joined: Fri Nov 15, 2024 8:22 pm
Contact:

[boskid][2.0.23] Changing tiles in on_chunk_generated changes landing location

Post by s6x »

My mod, Void Block, hooks on_chunk_generated to replace almost the entire surface with water/lava/whatever. However, as a consequence, somehow this alters the location where pods land, and they no longer come down at 0,0. This change persists even if the mod is removed.

I ran two tests. The NoMod save is an unmodded Vulcanus, and the pod correctly comes down at 0,0. The ModRemoved one is same seed, same map, but after Void Block has altered the surface, and the pod no longer lands at 0,0. The mod has been removed from the save so none of its code is running but the pod still lands in the wrong place, and as far as I can tell this happens every time.

(Those cliffs near the landing site don't seem to be bothering anything, as they worked fine in the unmodded test, but just to be sure I tried a landing after blowing them up with cliff explosives, and nothing changed there either)

This seems like a bug. Maybe I broke something, so if I've done something wrong in my code, please let me know what it is. I couldn't find anything that seemed to clobber the starting location, or any way to (re-)assert a location for pods to go to.
Attachments
VulcanusLandingTestModRemoved.zip
(2.38 MiB) Downloaded 15 times
VulcanusLandingTestNoMod.zip
(2.69 MiB) Downloaded 14 times
factorio-current.log
(8.3 KiB) Downloaded 13 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3437
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][2.0.23] Changing tiles in on_chunk_generated changes landing location

Post by boskid »

Thanks for the report and for the save file, that helped narrow down the issue significantly faster. The issue is now fixed for 2.0.25.

Issue was that when cargo pod lands with a passenger, it uses character's bounding box and character's collision mask to select a landing spot, however the issue was that this logic was not using collision bounding box from the prototype (that would be centered at {0,0}), but it was using an active bounding box of a character which was shifted based on the position a character was during the flight animation. That introduced a significant shift to the collision box which means the position found was "correct" because the heavily shifted bounding box was over land.
Post Reply

Return to “Resolved Problems and Bugs”