Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hopefuly fix progressive inventory when receiving them. #163

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading