Skip to content
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

Update nodes.lua #1301

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update nodes.lua #1301

wants to merge 2 commits into from

Conversation

pl608
Copy link
Contributor

@pl608 pl608 commented Jun 7, 2024

  • This PR has been tested locally
    I don't know if the way chests are currently, is intended but this only changes a treasure chest to visited if an item is taken from it.

Comment on lines -243 to +248
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
--[[on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.swap_node(pos, {name = "ctf_map:chest_opened"})
minetest.get_meta(pos):set_string("infotext", chestv)
end
end]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete it, don't comment it out. git/Github will save the old code for you

minetest.swap_node(pos, {name = "ctf_map:chest_opened"})
minetest.get_meta(pos):set_string("infotext", chestv)
end
end]]
}

local ochest_def = table.copy(chest_def)
Copy link
Member

@LoneWolfHT LoneWolfHT Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below this is for the open chest def, below here you should save the old inventory_take function and replace it in the def with one that does the swap checking, and then calls the old function. That way you won't be setting the chest to the open state when it's already in that state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants