mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 06:07:22 +00:00
Weapons/artifacts should not have a count of more than 1
This commit is contained in:
parent
de75b56d6c
commit
ae31e4fd98
@ -164,6 +164,9 @@ public class Inventory implements Iterable<GameItem> {
|
|||||||
if (tab.getSize() >= tab.getMaxCapacity()) {
|
if (tab.getSize() >= tab.getMaxCapacity()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// Duplicates cause problems
|
||||||
|
item.setCount(Math.max(item.getCount(), 1));
|
||||||
|
// Adds to inventory
|
||||||
putItem(item, tab);
|
putItem(item, tab);
|
||||||
} else if (type == ItemType.ITEM_VIRTUAL) {
|
} else if (type == ItemType.ITEM_VIRTUAL) {
|
||||||
// Handle
|
// Handle
|
||||||
@ -288,7 +291,11 @@ public class Inventory implements Iterable<GameItem> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.getItemData().isEquip()) {
|
||||||
|
item.setCount(0);
|
||||||
|
} else {
|
||||||
item.setCount(item.getCount() - count);
|
item.setCount(item.getCount() - count);
|
||||||
|
}
|
||||||
|
|
||||||
if (item.getCount() <= 0) {
|
if (item.getCount() <= 0) {
|
||||||
// Remove from inventory tab too
|
// Remove from inventory tab too
|
||||||
|
Loading…
Reference in New Issue
Block a user