Fix items not being removed from maps

This commit is contained in:
JappaWakka 2024-03-03 20:13:24 +01:00
parent 833916cafb
commit 537fcd93af
1 changed files with 9 additions and 9 deletions

View File

@ -20,8 +20,8 @@
Me.Item = Item.GetItemByID(Me.AdditionalValue.GetSplit(1)) Me.Item = Item.GetItemByID(Me.AdditionalValue.GetSplit(1))
Me.ItemID = CInt(Me.AdditionalValue.GetSplit(0)) Me.ItemID = CInt(Me.AdditionalValue.GetSplit(0))
If Me.AdditionalValue.Split(",").Count > 1 Then If Me.AdditionalValue.Split(",").Count > 2 Then
Me.LevelName = Me.AdditionalValue.GetSplit(2) Me.LevelName = Me.AdditionalValue.GetSplit(2).ToLower()
End If End If
Me.Textures(0) = Me.Item.Texture Me.Textures(0) = Me.Item.Texture
@ -94,7 +94,7 @@
If ItemExists(Me) = True Then If ItemExists(Me) = True Then
If Me.LevelName = "" Then If Me.LevelName = "" Then
Me.LevelName = Screen.Level.LevelFile Me.LevelName = Screen.Level.LevelFile.ToLower()
End If End If
RemoveItem(Me, Me.LevelName) RemoveItem(Me, Me.LevelName)
End If End If
@ -147,7 +147,7 @@
Public Overrides Sub ClickFunction() Public Overrides Sub ClickFunction()
If CanInteractWith Then If CanInteractWith Then
If Me.LevelName = "" Then If Me.LevelName = "" Then
Me.LevelName = Screen.Level.LevelFile Me.LevelName = Screen.Level.LevelFile.ToLower()
End If End If
RemoveItem(Me, Me.LevelName) RemoveItem(Me, Me.LevelName)
If Me.Item.OriginalName.Contains("HM") Then If Me.Item.OriginalName.Contains("HM") Then
@ -184,13 +184,13 @@
If Core.Player.ItemData.Contains(",") = True Then If Core.Player.ItemData.Contains(",") = True Then
Dim IDs() As String = Core.Player.ItemData.ToLower().Split(CChar(",")) Dim IDs() As String = Core.Player.ItemData.ToLower().Split(CChar(","))
If IDs.Contains((Screen.Level.LevelFile & "|" & ItemObject.ItemID.ToString()).ToLower()) = True Then If IDs.Contains((Screen.Level.LevelFile.ToLower() & "|" & ItemObject.ItemID.ToString()).ToLower()) = True Then
Return True Return True
Else Else
Return False Return False
End If End If
Else Else
If Core.Player.ItemData.ToLower() = (Screen.Level.LevelFile & "|" & ItemObject.ItemID.ToString()).ToLower() Then If Core.Player.ItemData.ToLower() = (Screen.Level.LevelFile.ToLower() & "|" & ItemObject.ItemID.ToString()).ToLower() Then
Return True Return True
Else Else
Return False Return False
@ -205,11 +205,11 @@
Screen.Level.Entities.Remove(ItemObject) Screen.Level.Entities.Remove(ItemObject)
If Core.Player.ItemData = "" Then If Core.Player.ItemData = "" Then
Core.Player.ItemData = (LevelName & "|" & ItemObject.ItemID.ToString()).ToLower() Core.Player.ItemData = (LevelName.ToLower() & "|" & ItemObject.ItemID.ToString()).ToLower()
Else Else
Dim IDs() As String = Core.Player.ItemData.Split(CChar(",")) Dim IDs() As String = Core.Player.ItemData.Split(CChar(","))
If IDs.Contains((LevelName & "|" & ItemObject.ItemID.ToString()).ToLower()) = False Then If IDs.Contains((LevelName.ToLower() & "|" & ItemObject.ItemID.ToString()).ToLower()) = False Then
Core.Player.ItemData &= "," & (LevelName & "|" & ItemObject.ItemID.ToString()).ToLower() Core.Player.ItemData &= "," & (LevelName.ToLower() & "|" & ItemObject.ItemID.ToString()).ToLower()
End If End If
End If End If
End Sub End Sub