Skip to content

Conversation

@sfan5
Copy link
Contributor

@sfan5 sfan5 commented Nov 13, 2025

fixes #3214

@sfan5 sfan5 changed the title Override /pulverize and /clearinv to require no privs Override /pulverize and /clearinv to require interact Nov 13, 2025
for _, cmd in ipairs({"pulverize", "clearinv"}) do
local def = core.registered_chatcommands[cmd]
if def then
if match_old(def.privs) then
Copy link
Member

@SmallJoker SmallJoker Nov 13, 2025

Choose a reason for hiding this comment

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

This depends on the mod load order. I think it would be more straight-forward to
EITHER:
Use a simple, general logic as possible:

if def.privs.give then
	def.privs.give = nil
	def.privs.interact = true
end

OR:
Execute this in a on_mods_loaded callback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that a problem? If another mod wants to be sure to override it, it should depend on default

Copy link
Member

Choose a reason for hiding this comment

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

🤷. It depends on how the mod manipulates the table, whether an additional priv is added (assuming interact would be there too), or it's overwritten entirely. The code also seemed to me more complicated than it should be.

Anyway. I don't think this really matters, thus 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider overriding /pulverize and /clearinv to only need interact

2 participants