[0.18.14] player.get_associated_characters() API errors when player has no character

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

[0.18.14] player.get_associated_characters() API errors when player has no character

Post by Muppet9010 »

The documentation implies player.get_associated_characters() should return an empty array when their is no character for a player. Instead it gives an error: No character
https://lua-api.factorio.com/latest/Lua ... characters

Hit when run against a player who is in editor mode and thus has no character.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.14] player.get_associated_characters() API errors when player has no character

Post by Rseding91 »

Thanks for the report however... no it doesn't?

That code path literally can't produce that error. In fact the only error it can produce is "invalid player" if you call it on a deleted LuaPlayer.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

Re: [0.18.14] player.get_associated_characters() API errors when player has no character

Post by Muppet9010 »

ah crap I was caching a function in Factorio global inadvertently, so was running old code.

Post Reply

Return to “Modding help”