Fixed empty reasons

This commit is contained in:
Cooldude2606
2021-04-05 22:50:16 +01:00
parent 5328a5bb1c
commit 3c718fa081
2 changed files with 3 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ function Reports.report_player(player, by_player_name, reason)
if not player then return end
local player_name = player.name
reason = reason or 'Non given.'
if reason == nil or not reason:find("/S") then reason = 'Non given' end
local reports = user_reports[player_name]
if not reports then

View File

@@ -72,9 +72,10 @@ Gui.element{
}
:style(Gui.sprite_style(30, -1, { left_margin = -2, right_margin = -1 }))
:on_click(function(player, element)
local reason = element.parent.entry.text or 'Non Given'
local reason = element.parent.entry.text
local action_name = SelectedAction:get(player)
local reason_callback = config.buttons[action_name].reason_callback
if reason == nil or not reason:find("/S") then reason = 'no reason given' end
reason_callback(player, reason)
SelectedPlayer:remove(player)
SelectedAction:remove(player)