Fixed item dupe in GE
This commit is contained in:
@@ -242,17 +242,11 @@ class StockMarket : InterfaceListener {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
var item: Item
|
var item: Item
|
||||||
val amountLeft: Int = offer.amount - amountInInventory(player, offer.itemID)
|
val amountUnnoted = amountInInventory(player, offer.itemID)
|
||||||
val remove = removeItem(player, Item(offer.itemID, offer.amount).also { item = it })
|
val amountLeft = offer.amount - amountUnnoted
|
||||||
var note: Int
|
val removedUnnoted = removeItem(player, Item(offer.itemID, amountUnnoted).also { item = it })
|
||||||
if (amountLeft > 0) {
|
val removeNoted = if (amountLeft > 0) removeItem(player, Item(itemDefinition(offer.itemID).noteId, amountLeft)) else true
|
||||||
if (item.noteChange.also { note = it } > 0) {
|
if (!removedUnnoted || !removeNoted) return
|
||||||
removeItem(player, Item(note, amountLeft))
|
|
||||||
} else if (remove) {
|
|
||||||
addItem(player, offer.itemID, offer.amount - amountLeft)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(GrandExchange.dispatch(player, offer))
|
if(GrandExchange.dispatch(player, offer))
|
||||||
{
|
{
|
||||||
player.removeAttribute("ge-temp")
|
player.removeAttribute("ge-temp")
|
||||||
|
|||||||
Reference in New Issue
Block a user