Disallow transfer of stats if source and destination are same (#554)
This commit is contained in:
parent
05fba3f5ce
commit
f955ac8916
1 changed files with 3 additions and 0 deletions
|
@ -183,6 +183,9 @@ minetest.register_chatcommand("transfer_rankings", {
|
||||||
if not ctf_stats.players[dest] then
|
if not ctf_stats.players[dest] then
|
||||||
return false, "Player '" .. dest .. "' does not exist."
|
return false, "Player '" .. dest .. "' does not exist."
|
||||||
end
|
end
|
||||||
|
if src == dest then
|
||||||
|
return false, "Source name and destination name cannot be the same!"
|
||||||
|
end
|
||||||
|
|
||||||
ctf_stats.players[dest] = ctf_stats.players[src]
|
ctf_stats.players[dest] = ctf_stats.players[src]
|
||||||
ctf_stats.players[src] = nil
|
ctf_stats.players[src] = nil
|
||||||
|
|
Loading…
Reference in a new issue