[2.0.76] Error when writing to LuaPlayer::mining_state

Place to report issues and suggest improvements to the API documentation.
User avatar
Cooldude2606
Fast Inserter
Fast Inserter
Posts: 114
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

[2.0.76] Error when writing to LuaPlayer::mining_state

Post by Cooldude2606 »

tl;dr No error while reading, but error when attempting to write to LuaPlayer::mining_state when in ghost controller.

When a player is in certain controllers, such as ghost when waiting to respawn, the property "mining_state" is readable but not writable. From the API docs it is not clear what the full criteria for having a "manual miner" are, so it is not possible to check if the property is writable. That first part feels like a doc issue, but I am reporting it as a bug because the different behaviours between readining and writing when there is no "manual miner". Because of the read behaviour, I would expect it to only error when attempting to set mining to true, and for this to be documented; although you may decide it better to error on read and document which check to perform before accessing the property.

Reproduction:

Code: Select all

/c game.player.ticks_to_respawn = 7200
/c game.player.mining_state = { mining = false }
--- Developer for Explosive Gaming and Clusterio. Please contact me via our Discord. ---
Rseding91
Factorio Staff
Factorio Staff
Posts: 16694
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.76] Error when writing to LuaPlayer::mining_state

Post by Rseding91 »

Moving to documentation improvement requests. Manual miner exists for the controller types of:

* Character
* God
* Editor
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Documentation Improvement Requests”