Bluebuild rewritten

by gheift

Allows automatic blueprint building and deconstruction without bots. Once a blueprint is placed, nearby entities will be auto-placed as long as you have the objects in your inventory and are standing still. Once items are marked for deconstruction, they will be auto-removed and put into your inventory as long as you are standing still. Deconstruction speed is based on the mining time and the currently used tool. Press SHIFT+K to toggle building, press SHIFT+L to toggle deconstruction.

Utilities
6 years ago
0.15
15

b 0.15.16 Multiplayer Incompatible

6 years ago

When someone disconnects and tried to reconnect, server crashes and throws this error.
47.616 Info ServerMultiplayerManager.cpp:754: mapTick(666492) received stateCh
anged peerID(1) oldState(ConnectedDownloadingMap) newState(ConnectedLoadingMap)
47.620 Error MainLoop.cpp:859: Exception at tick 666492: Error while running e
vent ght-bluebuild::on_tick (ID 0)
ght-bluebuild/control.lua:1026: attempt to perform arithmetic on local 'last
_action' (a nil value)
47.622 Error ServerMultiplayerManager.cpp:94: MultiplayerManager failed: "Erro
r while running event ght-bluebuild::on_tick (ID 0)
ght-bluebuild/control.lua:1026: attempt to perform arithmetic on local 'last
_action' (a nil value)"
47.624 Info ServerMultiplayerManager.cpp:670: mapTick(666492) changing state f
rom(InGame) to(Failed)

It appears the mod is trying to access information relative to the connecting players last action that is not present because they are just joining after disconnecting.

6 years ago

I was able to repair your mod.
Add these three lines of code to line 1025:

if not last_action then
last_action = 0
end

This will make it so if last_action is nil, it will convert it to 0 so that it can be used in the next arithmetic condition.

6 years ago

Should be fixed in version 0.1.5.

New response