Skip to content

Commit

Permalink
Hopefuly fix progressive inventory when receiving them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee committed Jan 21, 2024
1 parent 983cb33 commit 6063a11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3452,19 +3452,19 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
}
var provider = splitted[0]
var name = splitted[1]
var itemName = splitted[1]
var model = splitted[2]
var quantity = real(splitted[3])
var remoteItemNumber = real(splitted[4])
mw_debug("prov:" + provider + " name:" + name + " model: " + model + " quant: " + string(quantity) + " remote num: " + string(remoteItemNumber))
mw_debug("prov:" + provider + " itemName:" + itemName + " model: " + model + " quant: " + string(quantity) + " remote num: " + string(remoteItemNumber))
if (remoteItemNumber <= global.lastOffworldNumber)
{
mw_debug("We have already received this item. Bailing out. Our current item is " + string(global.lastOffworldNumber))
break;
}
var knownItem = true
active = true // workaround for some scripts
switch (name)
switch (itemName)
{
case "{{ItemEnum.EnergyTank.GetEnumMemberValue()}}":
get_etank()
Expand Down Expand Up @@ -3566,7 +3566,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
get_speed_booster_upgrade(quantity)
break
default:
if (string_count("Metroid DNA", name) > 0)
if (string_count("Metroid DNA", itemName) > 0)
{
get_dna()
break;
Expand All @@ -3575,7 +3575,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
knownItem = false
break;
}
var tempMessage = "Received " + name + " from " + provider
var tempMessage = "Received " + itemName + " from " + provider
if (!knownItem)
tempMessage = "Unknown item from " + provider + "! Please report this!!!"
var upperLimit = 45
Expand All @@ -3589,7 +3589,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
if (knownItem)
{
mw_debug("Item that we received was known to us. Attempting to increase inventory; current: " + string(global.collectedItems))
global.collectedItems += (name + "|" + string(quantity) + ",")
global.collectedItems += (itemName + "|" + string(quantity) + ",")
global.lastOffworldNumber = remoteItemNumber
mw_debug("Inventory and lastoffworld set. offworld: " + string(global.lastOffworldNumber) + " inventory: " + string(global.collectedItems))
}
Expand Down

0 comments on commit 6063a11

Please sign in to comment.