renoth / factorio-alien-module

A mod for factorio
MIT License
14 stars 16 forks source link

Crash on start of server #98

Open vfinn opened 4 months ago

vfinn commented 4 months ago

This is not reproduceable in a single player game or hosted by a local server, only on a dedi - so debugging is very difficult. The fix is easy, but cause is a little sketchy - it could be the global.modulelevel array is uninitialized.

   5.603 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "The mod Alien Loot Economy (1.4.9) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event alien-module::on_init()
__alien-module__/control.lua:52: attempt to perform arithmetic on field '?' (a nil value)
stack traceback:
        __alien-module__/control.lua:52: in function 'init_gui'
        __alien-module__/control.lua:7: in function <__alien-module__/control.lua:1>"
   5.603 Info ServerMultiplayerManager.cpp:814: updateTick(4294967295) changing state from(CreatingGame) to(InitializationFailed)
   5.603 Info CommandLineMultiplayer.cpp:219: Exit point.
   5.606 Info ServerMultiplayerManager.cpp:154: Quitting multiplayer connection.
   5.606 Info ServerMultiplayerManager.cpp:814: updateTick(4294967295) changing state from(InitializationFailed) to(Closed)
   5.629 Info UDPSocket.cpp:233: Closing socket
   5.630 Goodbye
[AleForge]: Server is offline

Thank you, JustGoFly

vfinn commented 4 months ago

Here's the fix:

add verifyCountersForForce(player.force.name) before player.gui.top.alienmodule.killbar.value = math.max(roundModuleLevel(player.force.name) - global.modulelevel[player.force.name], 0)

in control.lua init_gui()

This has been tested on my server, but unable to play with many players until you post it. Enjoy...

EmuLegs commented 3 months ago

image

we are also running mod "TeamCoop"

renoth commented 3 months ago

Thanks for the fix, i was on vacation, will patch it this week.

renoth commented 3 months ago

should be fixed. Please test 1.4.10