🌐Planet Rubia


Discover the wind planet Rubia. Belts and inserters work differently on Rubia, leading to unique building challenges not seen on any other planet. Your whole factory must go with the wind as a never-ending barrage of waste is hurled at your base.

Content
a day ago
2.0
13.0K
Factorio: Space Age Icon Space Age Mod
Planets Logistics Trains Environment Mining Manufacturing Power

b [Resolved] Error on_player_removed

a month ago
(updated a month ago)

I was attempting to remove a player from my multiplayer game using the /admin command, as he had soft-locked himself on a different planet. However, when doing so, I encountered an error:

__rubia__/script/chunk-checker.lua:265: attempt to index local 'player' (a nil value)
stack traceback:
__rubia__/script/chunck_checker.lua:265: in function 'try_update_player_pos'
__rubia__/script/chunck_checker.lua:341: in function 'fun'
__rubia__/lib/event-lib.lua:77: in function <__rubia__/lib/event-lib.lua:75>

Analysis:

The core of the problem is in __rubia__/script/chunck_checker.lua:335 and __rubia__/script/chunck_checker.lua:340. On line 335, you're registering the function to be called in on_player_removed, which happens after the player is removed. Then, on line 340, you attempt to get the player from the player_index of the player that was just removed. game.get_player will then return nil, so on line 341 you erroneously call try_update_player_pos, which expects an existing player. To fix the problem, you should change line 335 to defines.events.on_pre_player_removed which will allow you to access the LuaPlayer before it is deleted.

a month ago

Fixed for next release. Thanks.

New response