Page 1 of 1

[Rseding91] [1.0.0] Mod API: when a unit group with zero members receives the command build_base a crash/hang occurs

Posted: Sun Aug 23, 2020 7:47 am
by Urist_McAurelian
When a unit group with zero members receives a command of type defines.command.build_base a crash (well, moreso the game just hangs) occurs. I've attached my log (although probably not applicable here) and a mod for demonstration purposes. This should work independent of save, so none attached. Just ensure water isn't at x=10, y=10. (not sure if that'd cause an error, but just in case...)

Place down your starting furnace and the script works as the unit group has at least one member, however when you mine it again it crashes as the unit group has no members.

I think I could've done that with console commands, but don't know how, sorry.

This isn't a bug per-say, I suppose, however having some sort of logging when this occurs would be nice... or maybe have set_command return false? I dunno. Don't usually make mods, so don't know what would work best. Just some sort of notification of what's going wrong would be nice, spent a good half day trying to figure out what was causing my game to crash.

Originally found when using rampant, however found independent of all mods besides my test one.

Re: [1.0.0] Mod API: when a unit group with zero members receives the command build_base a crash/hang occurs

Posted: Sun Aug 23, 2020 4:40 pm
by Rseding91
Huh, I thought I fixed this... I guess I never pushed the fix.

Re: [1.0.0] Mod API: when a unit group with zero members receives the command build_base a crash/hang occurs

Posted: Sun Aug 23, 2020 5:01 pm
by Urist_McAurelian
Heh, well thanks then, I guess. Will it be an error popup or just the command being ignored?

Also, is there any way to tell what causes the game to hang without uploading the dump? Would've saved a lot of time.