Fix for knockoff item dupe bug

This commit is contained in:
JappaWakka 2022-09-04 19:23:12 +02:00
parent 9c611b9339
commit e37268ffb5
2 changed files with 30 additions and 17 deletions

View File

@ -1217,11 +1217,24 @@ nextIndex:
If p.hasLeveledUp = True Then If p.hasLeveledUp = True Then
hasLevelUp = True hasLevelUp = True
End If End If
If IsRemoteBattle = True Or IsTrainerBattle = True Then If IsRemoteBattle = True Then
If p.OriginalItem IsNot Nothing Then If p.OriginalItem IsNot Nothing Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " received" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName)
End If
Else
If Not p.OriginalItem Is Nothing Then
If p.Item IsNot Nothing Then
Core.Player.Inventory.AddItem(p.OriginalItem.ID, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1))
Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
End If
p.OriginalItem = Nothing
End If End If
End If End If
p.ResetTemp() p.ResetTemp()
@ -1267,11 +1280,24 @@ nextIndex:
Next Next
Else Else
For Each p As Pokemon In Core.Player.Pokemons For Each p As Pokemon In Core.Player.Pokemons
If IsRemoteBattle = True Or IsTrainerBattle = True Then If IsRemoteBattle = True Then
If p.OriginalItem IsNot Nothing Then If p.OriginalItem IsNot Nothing Then
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "and gave it back to~" & p.GetDisplayName)
End If
Else
If Not p.OriginalItem Is Nothing Then
If p.Item IsNot Nothing Then
Core.Player.Inventory.AddItem(p.OriginalItem.ID, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.originalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.originalItem, 1))
Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
End If
p.OriginalItem = Nothing
End If End If
End If End If
p.ResetTemp() p.ResetTemp()

View File

@ -1042,19 +1042,6 @@ Public Class Pokemon
Me.Ability = Me._originalAbility Me.Ability = Me._originalAbility
If Not Me._originalItem Is Nothing Then
If Me.Item IsNot Nothing Then
Core.Player.Inventory.AddItem(Me._originalItem.ID, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & Me._originalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(_originalItem, 1))
Else
Me.Item = P3D.Item.GetItemByID(Me._originalItem.ID)
Me.Item.AdditionalData = Me._originalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & Me._originalItem.Name & "*and gave it back to~" & Me.GetDisplayName)
End If
Me._originalItem = Nothing
End If
Me.IsTransformed = False Me.IsTransformed = False
Me.CalculateStats() Me.CalculateStats()