Fixes hairstyles with more than 4 versions causing players to go bald when swapping hairstyle

This commit is contained in:
chardub
2025-04-17 09:48:45 -04:00
parent 0d5562ffde
commit 65b3c34009
8 changed files with 17 additions and 2 deletions

Binary file not shown.

View File

@@ -148,4 +148,12 @@ class OutfitsMartAdapter < PokemonMartAdapter
def showQuantity?(item)
super
end
def updateVersion(item)
@version = 1 if !currentVersionExists?(item)
end
def currentVersionExists?(item)
return true
end
end

View File

@@ -94,6 +94,7 @@ class ClothesShopView < PokemonMart_Scene
description = @adapter.getSpecialItemDescription(itemwindow.item)
else
description = @adapter.getDescription(itemwindow.item)
@adapter.updateVersion(itemwindow.item)
end
@adapter.updateTrainerPreview(itemwindow.item, @sprites["trainerPreview"])
else

View File

@@ -107,7 +107,6 @@ class HairMartAdapter < OutfitsMartAdapter
def getItemIcon(item)
return Settings::BACK_ITEM_ICON_PATH if !item
itemId = getCurrentHairId(item.id)
return getOverworldHatFilename(item.id)
end
@@ -115,6 +114,7 @@ class HairMartAdapter < OutfitsMartAdapter
item = @previous_item if !item
item = @previous_item if item.is_a?(Symbol)
@previous_item = find_first_item() if !item.is_a?(Symbol)
displayed_hat = @hat_visible ? @worn_hat : nil
displayed_hat2 = @hat_visible ? @worn_hat2 : nil
@@ -200,4 +200,10 @@ class HairMartAdapter < OutfitsMartAdapter
switchVersion(nil,1)
end
def currentVersionExists?(item)
hairId = getCurrentHairId(item.id)
filename = getOverworldHairFilename(hairId)
return pbResolveBitmap(filename)
end
end

View File

@@ -1299,7 +1299,7 @@ end
def exit_pokemart()
pokemart_entrances = {
:PEWTER => [380, 43, 24],
:CERULEAN => [1, 19, 22],
:CERULEAN => [1, 24, 22],
:VERMILLION => [19, 32, 13],
:LAVENDER => [50, 20, 23],
:CELADON => [95, 18, 15], # not a real pokemart

Binary file not shown.

Binary file not shown.

Binary file not shown.