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
f45e106b
Commit
f45e106b
authored
May 12, 2022
by
AnimeGitB
Committed by
Melledy
May 11, 2022
Browse files
Fix immutable lists
parent
b787c70c
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/managers/InventoryManager.java
View file @
f45e106b
...
@@ -696,7 +696,7 @@ public class InventoryManager {
...
@@ -696,7 +696,7 @@ public class InventoryManager {
}
}
// Pay materials and mora if possible
// Pay materials and mora if possible
List
<
ItemParamData
>
costs
=
proudSkill
.
getCostItems
();
// Can this be null?
List
<
ItemParamData
>
costs
=
new
ArrayList
<
ItemParamData
>(
proudSkill
.
getCostItems
()
)
;
// Can this be null?
if
(
proudSkill
.
getCoinCost
()
>
0
)
{
if
(
proudSkill
.
getCoinCost
()
>
0
)
{
costs
.
add
(
new
ItemParamData
(
202
,
proudSkill
.
getCoinCost
()));
costs
.
add
(
new
ItemParamData
(
202
,
proudSkill
.
getCoinCost
()));
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java
View file @
f45e106b
...
@@ -56,7 +56,7 @@ public class HandlerBuyGoodsReq extends PacketHandler {
...
@@ -56,7 +56,7 @@ public class HandlerBuyGoodsReq extends PacketHandler {
return
;
return
;
}
}
List
<
ItemParamData
>
costs
=
sg
.
getCostItemList
();
// Can this even be null?
List
<
ItemParamData
>
costs
=
new
ArrayList
<
ItemParamData
>(
sg
.
getCostItemList
()
)
;
// Can this even be null?
costs
.
add
(
new
ItemParamData
(
202
,
sg
.
getScoin
()));
costs
.
add
(
new
ItemParamData
(
202
,
sg
.
getScoin
()));
costs
.
add
(
new
ItemParamData
(
201
,
sg
.
getHcoin
()));
costs
.
add
(
new
ItemParamData
(
201
,
sg
.
getHcoin
()));
costs
.
add
(
new
ItemParamData
(
203
,
sg
.
getMcoin
()));
costs
.
add
(
new
ItemParamData
(
203
,
sg
.
getMcoin
()));
...
...
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