Canal Excavator

by jurgy

Introduces a machine that can excavate tiles, extracting stone, and transforms them into water when the dug tile touches another water source

Utilities
3 months ago
1.1
1.52K
Environment Mining Fluids

b Crash with two excavators close to each other

5 months ago

I've gotten a crash while digging a canal. It seemingly came out of nowhere and I can only assume it's because I placed two excavators really close to each other with both finishing at nearly the same time? This caused a part of the script to try and kill an entity that's in the way while the other excavator was already running the same script. A simple if condition checking the validity of the entity should fix this issue:

Really enjoying your mod so far btw! Keep up the good work.

5 months ago
(updated 5 months ago)

Thanks for reporting the error and sorry for the inconvenience! I'll get on this later today but if you're interested in the technical details:

It seems like two neighboring water tiles notified the mod to transition the tile into water at the same time. There was an object (LuaEntity) on the tile which collides with water so it had to be killed/destroyed. The first instance would've gone without a hitch, but when the second notification happened it tried to kill an already dead object, which is why the error calls the entity "invalid".

Your validity check suggestion is indeed correct, but I want to look at the root cause as well. Maybe I can prevent the code being ran twice in the first place.

Anyway, thanks again for reporting and glad you enjoy the mod!

5 months ago

Should be fixed now!

New response