From fc7b35d604daa9bfa0e2bc5ed1442d582c1c2d2d Mon Sep 17 00:00:00 2001 From: Moose <124457076+AntlerForce@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:15:01 -0700 Subject: [PATCH] Workaround handicap bonus amnesia after change team --- LuaMenu/widgets/api_user_handler.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LuaMenu/widgets/api_user_handler.lua b/LuaMenu/widgets/api_user_handler.lua index 7e3d78320..fd0e27159 100644 --- a/LuaMenu/widgets/api_user_handler.lua +++ b/LuaMenu/widgets/api_user_handler.lua @@ -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 @@ -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