Closed thomasrudin closed 5 years ago
thankyou
Your code for palm scanner is far simpler than mine, so it's better I guess.
Could you tell more about the crashes ? We have known on another server, so I'd like to have a look a it (I hate when I don't understand ;-) )
For instance : I don't understand what's between the parenthesis :
on_timer = (has_mesecons and toggle_switch)
Someone can explain ?
Your code for palm scanner is far simpler than mine, so it's better I guess.
Could you tell more about the crashes ? We have known on another server, so I'd like to have a look a it (I hate when I don't understand ;-) )
There were some race-conditions in which this code: https://github.com/D00Med/scifi_nodes/blob/4860c82137006533b98ea2668fafb927aa8aabcc/nodeboxes.lua#L1469 got called from a timer without a player value :/
Sorry for refactoring your code, i was in the process of splitting the codebase into multiple files...
The new variant also checks for is_protected()
to allow (for example) multiple players access with the protector_redo
or areas
mod, not just the owner
.
I hope that works for you, if not just tell me i can add a PR with compatibility settings...
It's open source so there's nothing like "my" code, so you did well : thank you for improving our code ;-)
And what about that (has_mesecons and toggle_switch)
It's open source so there's nothing like "my" code, so you did well : thank you for improving our code ;-)
And what about that
(has_mesecons and toggle_switch)
Its basically a "trick" to return the second value if the first is present, or nil if not:
local x = (has_mesecons and 42)
-- has_mesecons == true
local x = 42
-- has_mesecons == false
local x = nil
I try to apply that as sparsely as possible though, as it is not that transparent :confused:
It's handy, once you know about it.
Thank you !
.luacheckrc
mesecons
andbasic_materials
mod.conf
descriptionI can squash that if you like