Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
ae31e4fd
Commit
ae31e4fd
authored
May 03, 2022
by
Melledy
Browse files
Weapons/artifacts should not have a count of more than 1
parent
de75b56d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/inventory/Inventory.java
View file @
ae31e4fd
...
...
@@ -164,6 +164,9 @@ public class Inventory implements Iterable<GameItem> {
if
(
tab
.
getSize
()
>=
tab
.
getMaxCapacity
())
{
return
null
;
}
// Duplicates cause problems
item
.
setCount
(
Math
.
max
(
item
.
getCount
(),
1
));
// Adds to inventory
putItem
(
item
,
tab
);
}
else
if
(
type
==
ItemType
.
ITEM_VIRTUAL
)
{
// Handle
...
...
@@ -288,7 +291,11 @@ public class Inventory implements Iterable<GameItem> {
return
false
;
}
item
.
setCount
(
item
.
getCount
()
-
count
);
if
(
item
.
getItemData
().
isEquip
())
{
item
.
setCount
(
0
);
}
else
{
item
.
setCount
(
item
.
getCount
()
-
count
);
}
if
(
item
.
getCount
()
<=
0
)
{
// Remove from inventory tab too
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment