Fixed bots putting inaccessible noted items on GE

This commit is contained in:
RiL 2023-05-15 12:49:32 +00:00 committed by Ryan
parent 9f6e7b49be
commit a04191b11e
2 changed files with 8 additions and 5 deletions

View file

@ -187,7 +187,7 @@ public class ItemDefinition extends Definition<Item> {
private int colourEquip2;
/**
* The note item.
* The note item id if un-noted. The un-noted item id if noted. -1 if no noted counterpart.
*/
private int noteId = -1;

View file

@ -1,17 +1,18 @@
package core.game.ge
import core.ServerConstants
import core.api.*
import core.cache.def.impl.ItemDefinition
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.PlayerDetails
import core.game.node.entity.player.link.audio.Audio
import core.game.system.task.Pulse
import core.ServerConstants
import core.tools.SystemLogger
import core.game.system.command.Privilege
import core.game.system.config.ItemConfigParser
import core.game.system.task.Pulse
import core.game.world.GameWorld
import core.game.world.repository.Repository
import core.tools.Log
import core.tools.SystemLogger
import core.tools.colorize
import java.lang.Integer.max
import java.util.concurrent.LinkedBlockingDeque
@ -203,7 +204,9 @@ class GrandExchange : StartupListener, Commands {
if (!PriceIndex.canTrade(itemID))
return false
val offer = GrandExchangeOffer.createBotOffer(itemID, amount)
// noted offers can not be bought.
val itemDef = ItemDefinition.forId(itemID)
val offer = GrandExchangeOffer.createBotOffer(if (itemDef.isUnnoted) itemID else itemDef.noteId, amount)
pendingOffers.addLast(offer)
return true