Merge pull request #171 from jokeruarwentto/custom_depot_fix

Fixing custom depot lock bug
This commit is contained in:
fed 2022-07-07 23:24:28 +00:00 committed by GitHub
commit 91438d912a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 17 deletions

View File

@ -319,3 +319,14 @@ MPDepotMenu = function(unk1, unk2)
return depot_menu
end
LUI.MenuBuilder.m_types_build["MPDepotMenu"] = MPDepotMenu
GetLootDataForRef_orig = LUI.InventoryUtils.GetLootDataForRef
LUI.InventoryUtils.GetLootDataForRef = function(f13_arg0, f13_arg1, f13_arg2, f13_arg3, f13_arg4)
local loot_data = GetLootDataForRef_orig(f13_arg0, f13_arg1, f13_arg2, f13_arg3, f13_arg4)
if loot_data and custom_depot.get_function("has_item")(loot_data.guid) then
loot_data.lockState = "Unlocked"
end
return loot_data
end

View File

@ -1,21 +1,7 @@
-- from roundend.lua, dev comments says that the game["round_end"] array contains indexes for this table
local ending_reasons = {
"MP_DRAW",
"LUA_MENU_REPORT_DRAW",
"MP_ROUND_WIN",
"MP_ROUND_LOSS",
"LUA_MENU_REPORT_VICTORY",
"LUA_MENU_REPORT_DEFEAT",
"MP_HALFTIME",
"MP_OVERTIME",
"MP_ROUNDEND",
"MP_INTERMISSION",
"MP_SWITCHING_SIDES",
"MP_MATCH_BONUS_IS",
"MP_MATCH_TIE",
"MP_GAME_END",
"SPLASHES_BLANK"
}
local ending_reasons = {"MP_DRAW", "LUA_MENU_REPORT_DRAW", "MP_ROUND_WIN", "MP_ROUND_LOSS", "LUA_MENU_REPORT_VICTORY",
"LUA_MENU_REPORT_DEFEAT", "MP_HALFTIME", "MP_OVERTIME", "MP_ROUNDEND", "MP_INTERMISSION",
"MP_SWITCHING_SIDES", "MP_MATCH_BONUS_IS", "MP_MATCH_TIE", "MP_GAME_END", "SPLASHES_BLANK"}
local function starts_with(str, start)
return str:sub(1, #start) == start