Skip to content

Commit

Permalink
Merge pull request #872 from AntlerForce/master
Browse files Browse the repository at this point in the history
Fix negative handicap not displaying after cloning
  • Loading branch information
AntlerForce authored Dec 23, 2024
2 parents 2fc72c2 + c8a23d1 commit e0fca07
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LuaMenu/widgets/api_user_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit e0fca07

Please sign in to comment.