Skip to content

Commit

Permalink
Merge pull request #866 from AntlerForce/changeteambonusworkaround
Browse files Browse the repository at this point in the history
Workaround handicap bonus amnesia after change team
  • Loading branch information
AntlerForce authored Dec 22, 2024
2 parents b058f6f + fc7b35d commit 9ea4437
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions LuaMenu/widgets/api_user_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,7 @@ local function GetUserControls(userName, opts)
})
elseif selectedName == "Change Team" then
local battleStatus = userControls.lobby:GetUserBattleStatus(userName) or {}
local bonusAmount = battleStatus.handicap
if battleStatus.isSpectator then
return
end
Expand All @@ -1070,6 +1071,9 @@ local function GetUserControls(userName, opts)
userControls.lobby:UpdateAi(userName, {
allyNumber = allyTeamID - 1
})
if not isSingleplayer and bonusAmount ~= (nil or 0) then
lobby:SayBattle("!force "..userName.." bonus ".. tostring(bonusAmount))
end
else
lobby:SayBattle("!force "..userName.." team ".. tostring(allyTeamID)) -- +1 for spads team
end
Expand Down

0 comments on commit 9ea4437

Please sign in to comment.