forked from 2009Scape/Server
removeItem now validates item quantities prior to attempting removal
This commit is contained in:
parent
6d96611d69
commit
d58d4857b0
1 changed files with 2 additions and 0 deletions
|
|
@ -330,6 +330,8 @@ public class Container {
|
|||
*/
|
||||
@CheckReturnValue
|
||||
public boolean remove(Item item, int slot, boolean fireListener) {
|
||||
if (!contains(item.getId(), item.getAmount()))
|
||||
return false;
|
||||
Item oldItem = items[slot];
|
||||
if (oldItem == null || oldItem.getId() != item.getId()) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue