roippi
Developer
Two major issues with your patch:
1) It adds a bunch of useless server hits. Putting
where you did means that every item that gets to that point in retrieveItem will have its mall price retrieved. There's no reason to do it there since you could have just put it at the end of the if() statement. Java uses short-circuiting Boolean operations so putting it there will protect it from being run on non-hermit items.
retrieveItem gets called a LOT so you have to be extra vigilant about not doing bad things there even when making small changes.
2) Your Travoltan math is bad.
In java, this-
returns 0.
1) It adds a bunch of useless server hits. Putting
Code:
int mallPrice = StoreManager.getMallPrice( item, 7.0f );
where you did means that every item that gets to that point in retrieveItem will have its mall price retrieved. There's no reason to do it there since you could have just put it at the end of the if() statement. Java uses short-circuiting Boolean operations so putting it there will protect it from being run on non-hermit items.
retrieveItem gets called a LOT so you have to be extra vigilant about not doing bad things there even when making small changes.
2) Your Travoltan math is bad.
Code:
public static int currentWorthlessItemCost()
{
AdventureResult trousers = new AdventureResult(ItemPool.TRAVOLTAN_TROUSERS, 0);
int travoltanModifier = KoLConstants.inventory.contains( trousers) ? 95 : 100;
int x = InventoryManager.getStarterItemCount();
return (int) Math.ceil( 12.5 *(travoltanModifier/100)* ( 17 - x ) );
}
In java, this-
Code:
int x = 95;
int y = 100;
return (x/y);
returns 0.