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
7254fe16
Commit
7254fe16
authored
Jul 22, 2022
by
Melledy
Browse files
Set `setChooseAvatarGuid` properly
parent
0d17c4a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/player/Player.java
View file @
7254fe16
...
...
@@ -642,6 +642,9 @@ public class Player {
}
public
void
setMainCharacterId
(
int
mainCharacterId
)
{
if
(
this
.
mainCharacterId
!=
0
)
{
return
;
}
this
.
mainCharacterId
=
mainCharacterId
;
}
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDataNotify.java
View file @
7254fe16
...
...
@@ -13,11 +13,11 @@ import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam;
public
class
PacketAvatarDataNotify
extends
BasePacket
{
public
PacketAvatarDataNotify
(
Player
player
)
{
super
(
PacketOpcodes
.
AvatarDataNotify
,
2
);
super
(
PacketOpcodes
.
AvatarDataNotify
,
true
);
AvatarDataNotify
.
Builder
proto
=
AvatarDataNotify
.
newBuilder
()
.
setCurAvatarTeamId
(
player
.
getTeamManager
().
getCurrentTeamId
())
.
setChooseAvatarGuid
(
player
.
getTeamManager
().
getCurrentCharacterGuid
())
//
.setChooseAvatarGuid(player.getTeamManager().getCurrentCharacterGuid())
.
addAllOwnedFlycloakList
(
player
.
getFlyCloakList
())
.
addAllOwnedCostumeList
(
player
.
getCostumeList
());
...
...
@@ -38,6 +38,12 @@ public class PacketAvatarDataNotify extends BasePacket {
proto
.
putAvatarTeamMap
(
entry
.
getKey
(),
avatarTeam
.
build
());
}
// Set main character
Avatar
mainCharacter
=
player
.
getAvatars
().
getAvatarById
(
player
.
getMainCharacterId
());
if
(
mainCharacter
!=
null
)
{
proto
.
setChooseAvatarGuid
(
mainCharacter
.
getGuid
());
}
this
.
setData
(
proto
.
build
());
}
...
...
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