mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Fixed empty reasons
This commit is contained in:
@@ -132,7 +132,7 @@ function Reports.report_player(player, by_player_name, reason)
|
|||||||
if not player then return end
|
if not player then return end
|
||||||
local player_name = player.name
|
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]
|
local reports = user_reports[player_name]
|
||||||
if not reports then
|
if not reports then
|
||||||
|
|||||||
@@ -72,9 +72,10 @@ Gui.element{
|
|||||||
}
|
}
|
||||||
:style(Gui.sprite_style(30, -1, { left_margin = -2, right_margin = -1 }))
|
:style(Gui.sprite_style(30, -1, { left_margin = -2, right_margin = -1 }))
|
||||||
:on_click(function(player, element)
|
: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 action_name = SelectedAction:get(player)
|
||||||
local reason_callback = config.buttons[action_name].reason_callback
|
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)
|
reason_callback(player, reason)
|
||||||
SelectedPlayer:remove(player)
|
SelectedPlayer:remove(player)
|
||||||
SelectedAction:remove(player)
|
SelectedAction:remove(player)
|
||||||
|
|||||||
Reference in New Issue
Block a user