Fix unhandled exception

master
BlockMen 2015-10-14 09:15:35 +02:00
parent d5254a20f5
commit 44d40a92ae
1 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,10 @@ function hud.swap_statbar(player, item1, item2)
local elem1 = hud_id[p_name.."_"..item1]
local elem2 = hud_id[p_name.."_"..item2]
if not elem1 or not elem2 or not elem1.id or not elem2.id then
return false
end
player:hud_change(elem2.id, "offset", def1.offset)
player:hud_change(elem1.id, "offset", def2.offset)