[.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Some mods, made by Bob. Basically streaks every Factroio-area.

Moderator: bobingabout

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

[.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by Nexela »

Bob, Found a bug with using inserters gui in multiplayer.

using game.connected_players the index returned from a for loop is NOT the player index http://lua-api.factorio.com/latest/LuaG ... ed_players
Without this change the gui will close immediately for some players when opening after players in mp disconnect/leave

Fixed code below by replacing index with player.index
on_tick
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by bobingabout »

It's stuff like this that shows I'm pretty much just guessing with the whole thing. If it seems to work, it ships.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by Nexela »

You do a pretty good job of guessing :)

I would have never been able to figure out what the problem was if I had just not used game.connected_players in my own mod.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by bobingabout »

Well, it's done, uploading.

Actually, I fixed the code myself without copying yours, using your description of the issue, and came to the same result. except using variable _ for dummy, I just renamed index to i.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by Nexela »

I like to use _ otherwise luacheck throws warnings about unused variables :)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by bobingabout »

to which I'd say. what the heck is luacheck? :P
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [.14.21] Bob Inserters 0.14.2 Multiplayer Tick bug

Post by Nexela »

https://github.com/mpeterv/luacheck#overview I can't live without it :) I typically use = instead of == in an if statement and luacheck yells at me as soon as I move to the next line.
Post Reply

Return to “Bob's mods”