[1.1.67] modding related, flashlight enable/disable on LuaPlayer

This subforum contains all the issues which we already resolved.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

[1.1.67] modding related, flashlight enable/disable on LuaPlayer

Post by Honktown »

Under Luaplayer, enable_flashlight() and disable_flashlight() are listed, but do nothing. is_flashlight_enabled does translate from a character entity (and seems to return true always when there is no character e.g. editor). enable and disable flashlight work as expected on a character entity.
https://lua-api.factorio.com/1.1.67/LuaPlayer.html

I assume enable/disable should work, because they are listed under LuaPlayer and are a LuaControl, following the pattern of a number of other character+player / character entity things.
I have mods! I guess!
Link

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.67] modding related, flashlight enable/disable on LuaPlayer

Post by boskid »

LuaControl::enable/disable_flashlight not working when used through LuaPlayer that points at a player with CharacterController was an issue and is now fixed for 1.1.68.

As for the reason why those methods are in LuaControl, they are here because they are valid for LuaEntity (in case of a Character entity) and valid for LuaPlayer (in case of an EditorController where you can read the flashlight enabled state since it can be turned off using editor's setting "draw cursor light", in case of a GodController a script can enable/disable the cursor light, and after fix the CharacterController can control the flashlight).

Post Reply

Return to “Resolved Problems and Bugs”