From 190d7b7e551da55d4fdb2823620410071398b903 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 12 Nov 2018 22:26:34 +0000 Subject: [PATCH] Fix crash due to running :get_player_name() on a string Fixes #239. @ClobberXD --- mods/ctf_stats/init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/ctf_stats/init.lua b/mods/ctf_stats/init.lua index d932e92b3..b1383d52b 100644 --- a/mods/ctf_stats/init.lua +++ b/mods/ctf_stats/init.lua @@ -346,8 +346,7 @@ ctf.register_on_killedplayer(function(victim, killer) local main, match = ctf_stats.player(killer) if main and match then local reward = calculateKillReward(victim, killer) - local bounty_kill = victim:get_player_name() == - ctf_stats.current_bounty["name"] and true or false + local bounty_kill = (victim == ctf_stats.current_bounty["name"]) and true or false showKillPoints(killer, bounty_kill, reward) main.kills = main.kills + 1 main.score = main.score + reward