From c8a23d1729e776f021f89fdd499f136538b7f58a Mon Sep 17 00:00:00 2001 From: Moose <124457076+AntlerForce@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:28:13 -0700 Subject: [PATCH] Fix negative handicap not displaying after cloning --- LuaMenu/widgets/api_user_handler.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LuaMenu/widgets/api_user_handler.lua b/LuaMenu/widgets/api_user_handler.lua index b052e8768..408f06d20 100644 --- a/LuaMenu/widgets/api_user_handler.lua +++ b/LuaMenu/widgets/api_user_handler.lua @@ -1072,7 +1072,7 @@ local function GetUserControls(userName, opts) userControls.lobby:UpdateAi(userName, { allyNumber = allyTeamID - 1 }) - if not isSingleplayer and bonusAmount ~= (nil or 0) then + if not isSingleplayer and bonusAmount and bonusAmount ~= 0 then lobby:SayBattle("!force "..userName.." bonus ".. tostring(bonusAmount)) end else @@ -1157,7 +1157,8 @@ local function GetUserControls(userName, opts) aiSettings.aiOptions, aiSettings.battleStatusOptions ) - if isSingleplayer ~= true and aiSettings.battleStatusOptions.handicap ~= (nil or 0) then + + if not isSingleplayer and aiSettings.battleStatusOptions.handicap and aiSettings.battleStatusOptions.handicap ~= 0 then lobby:SayBattle("!force " .. aiName .. " bonus ".. tostring(aiSettings.battleStatusOptions.handicap)) end end @@ -1493,6 +1494,8 @@ local function GetUserControls(userName, opts) local handicaptxt = '' if bs.handicap and bs.handicap > 0 then handicaptxt = '+'..tostring(bs.handicap) + elseif bs.handicap and bs.handicap < 0 then + handicaptxt = tostring(bs.handicap) end userControls.lblHandicap = Label:New{ name = "lblHandicap",