Fix player param pass to EID:OnUseSmelter (#914)
This commit is contained in:
1 parent
142d6b1382
commit
17c47791a9
1 file changed
+14
-14
@@ -1084,7 +1084,7 @@ function EID:onGameUpdate()
|
||||
EID:checkPlayersForMissingItems()
|
||||
EID:evaluateQueuedItems()
|
||||
EID:evaluateHeldPill()
|
||||
|
||||
|
||||
EID.TabHeldLastFrame = EID.TabHeldThisFrame
|
||||
EID.TabHeldThisFrame = EID:PlayersActionPressed(EID.Config["BagOfCraftingToggleKey"])
|
||||
|
||||
@@ -1108,14 +1108,14 @@ function EID:onGameUpdate()
|
||||
|
||||
EID.RecheckVoid = true
|
||||
end
|
||||
|
||||
|
||||
-- Check player items for starting items
|
||||
if EID.ShouldCheckStartingItems then
|
||||
EID:UpdateAllPlayerPassiveItems()
|
||||
EID:SetOldestItemIndex()
|
||||
EID.ShouldCheckStartingItems = false
|
||||
end
|
||||
|
||||
|
||||
if EID.isRepentance then
|
||||
EID:WatchForGlitchedCrown()
|
||||
EID:UpdateWildCardEffects()
|
||||
@@ -1205,7 +1205,7 @@ end
|
||||
function EID:CheckPosModifiers()
|
||||
-- HUD offset adjustment, done every frame so it looks nice while changing the option
|
||||
if Options then
|
||||
-- Read the HUD offset from the Options table if it exists.
|
||||
-- Read the HUD offset from the Options table if it exists.
|
||||
-- +3 Y to avoid overlapping with the shadow of the charge bar hud
|
||||
EID:addTextPosModifier("HudOffset", Vector(20, 12) * (Options.HUDOffset - 1) + Vector(0, 3))
|
||||
else
|
||||
@@ -1513,7 +1513,7 @@ function EID:OnRender()
|
||||
EID:addDescriptionToPrint(EID:getDescriptionObj(closest.Type, closest.Variant, closest.SubType+1, closest))
|
||||
-- Handle Card Reading Portals
|
||||
elseif closest.Type == 1000 and closest.Variant == 161 then
|
||||
if closest.SubType <= 2 or (EID.isRepentancePlus and closest.SubType == 3) then
|
||||
if closest.SubType <= 2 or (EID.isRepentancePlus and closest.SubType == 3) then
|
||||
local subtypeToCard = {18, 5, 19}
|
||||
if EID.isRepentancePlus then
|
||||
subtypeToCard = {18, 5, 19, 10}
|
||||
@@ -1538,7 +1538,7 @@ function EID:OnRender()
|
||||
if EID:getEntityData(closest, "EID_DontHide") ~= true then
|
||||
local isHideUncollected = EID.Config["HideUncollectedItemDescriptions"] and EID:requiredForCollectionPage(collectibleID)
|
||||
if (EID.Config["DisableOnCurse"] and EID:hasCurseBlind()) or (isHideUncollected) or (EID.Config["DisableOnAprilFoolsChallenge"] and game.Challenge == Challenge.CHALLENGE_APRILS_FOOL) then
|
||||
local description = isHideUncollected and EID:getDescriptionEntry("CollectionPageInfo") or nil
|
||||
local description = isHideUncollected and EID:getDescriptionEntry("CollectionPageInfo") or nil
|
||||
EID:addQuestionMarkDescription(closest, description)
|
||||
wasHidden = true;
|
||||
end
|
||||
@@ -1720,10 +1720,10 @@ end
|
||||
EID:AddCallback(ModCallbacks.MC_USE_ITEM, OnUseD4, CollectibleType.COLLECTIBLE_D4)
|
||||
|
||||
-- MC_PRE_USE_ITEM callback to watch for smelting trinkets; includes Gulp and Marbles
|
||||
function EID:OnUseSmelter(_, _, _, player)
|
||||
function EID:OnUseSmelter(_, _, player)
|
||||
player = player or EID.player
|
||||
local playerNum = EID:getPlayerID(player, true)
|
||||
|
||||
|
||||
EID.GulpedTrinkets[playerNum] = EID.GulpedTrinkets[playerNum] or {}
|
||||
for i=0,1 do
|
||||
local trinket = player:GetTrinket(i)
|
||||
@@ -1836,7 +1836,7 @@ function EID:OnGameStart(isSave)
|
||||
--Loading Moddata--
|
||||
if EID:HasData() then
|
||||
local savedEIDConfig = json.decode(Isaac.LoadModData(EID))
|
||||
|
||||
|
||||
-- JSON saves integer table keys as strings. we need to transform them back... used in OnGameStart
|
||||
local function ConvertSavedTable(tableName)
|
||||
for playerID, data in pairs(savedEIDConfig[tableName] or {}) do
|
||||
@@ -1851,7 +1851,7 @@ function EID:OnGameStart(isSave)
|
||||
EID[tableName][tonumber(playerID)] = convertedData
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- collection progress
|
||||
EID.CollectedItems = savedEIDConfig["CollectedItems"] or {}
|
||||
if EID.SaveGame and savedEIDConfig["SaveGameNumber"] > 0 then
|
||||
@@ -1878,19 +1878,19 @@ function EID:OnGameStart(isSave)
|
||||
EID.UsedPillColors = savedEIDConfig["UsedPillColors"] or {}
|
||||
EID.absorbedItems = savedEIDConfig["AbsorbedItems"] or {}
|
||||
end
|
||||
|
||||
|
||||
if EID.isRepentance then
|
||||
EID.BoC.BagItems = {}
|
||||
EID.BoC.LearnedRecipes = {}
|
||||
EID.CraneItemType = {}
|
||||
EID.flipItemPositions = {}
|
||||
|
||||
|
||||
if isSave then
|
||||
EID.BoC.BagItems = savedEIDConfig["BagContent"] or {}
|
||||
EID.BoC.LearnedRecipes = savedEIDConfig["BagLearnedRecipes"] or {}
|
||||
EID.BoC.RoomQueries = savedEIDConfig["BagFloorContent"] or {}
|
||||
EID.CraneItemType = savedEIDConfig["CraneItemType"] or {}
|
||||
|
||||
|
||||
-- turn list back into dict because json cant save dict indices.
|
||||
local flipItemTable = {}
|
||||
for _, v in ipairs(savedEIDConfig["FlipItemPositions"]) do
|
||||
@@ -1934,7 +1934,7 @@ function EID:OnGameStart(isSave)
|
||||
EID.UsedPosition = Vector(EID.Config["XPosition"], EID.Config["YPosition"])
|
||||
EID.Scale = EID.Config["Size"]
|
||||
EID.ItemReminderSelectedCategory = EID.Config["ItemReminderDisplayMode"] == "NoOverview" and 1 or 0
|
||||
|
||||
|
||||
EID:AdjustLanguageConfigSetting()
|
||||
EID:fixDefinedFont()
|
||||
EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt")
|
||||
|
||||
Reference in new issue
Block a user