-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix treasure chest chat spam #1327
base: master
Are you sure you want to change the base?
Conversation
Fix spammed messages sent to player when adding an item into treasure chest using Shift+ Item
Hello. Thanks for your interest in contributing to CTF. Please update the PR title with a better more descriptive name. Also I am in favor of removing this message from chat and sending as HUD event message, instead. @LoneWolfHT Opinion(s)? |
hud messages would be hidden by the formspec, the chat gives you a better chance of seeing what went wrong. |
if current_time - last_time_warned > 0.01 then | ||
minetest.chat_send_player(player:get_player_name(), | ||
"You're not allowed to put things in treasure chests!") | ||
meta:set_int("last_chest_time_warned", current_time) |
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.
The timer doesn't need to be chest-specific, so for speed's sake instead of storing the current time in meta I would store it in a local table indexed by playername, when a player leaves their entry is removed.
Are you still interested in finishing this PR or do you want someone to take it over? |
Got answer via Discord, this PR is up for adoption |
Fix spammed messages sent to player when adding an item into treasure chest using Shift+ Item