-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement nuke protect, fix move_items #229
Implement nuke protect, fix move_items #229
Conversation
Have only copy_items_stack and move_items_stack
I added the new config, though I'm not sure if this is a good way to do it so that it is "modular". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firstly, I dont see any reason to use tostring
on the keys.
Secondally, if you want to make it modular then you should include the event name in the config:
{
{
inventory = defines.inventory.character_ammo,
event = defines.events.on_player_ammo_inventory_changed,
items = {
["atimic-bomb"] = true
}
}
}
This will alow you to use a for loop within the module code.
for _, area in ipairs(config) do
if #area.items > 0 then
Event.add(area.event, ...)
end
end
Implemented the desired modularity of the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changed _C.move_items* to be _C.copy_items_stack, which copies items, and _C.move_items_stack, which moves items.
Added an addon called
nukeprotect
, which prevents players without a flag from having specific items in their inventories.