Skip to content

Commit

Permalink
fix costume switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Simplxss committed Dec 22, 2022
1 parent 6ee37a3 commit c88fd29
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/emu/grasscutter/game/entity/EntityAvatar.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ public EntityAvatar(Scene scene, Avatar avatar) {
super(scene);
this.avatar = avatar;
this.avatar.setCurrentEnergy();
if (scene != null)
if (getScene() != null)
{
this.id = getScene().getWorld().getNextEntityId(EntityIdType.AVATAR);

GameItem weapon = this.getAvatar().getWeapon();
if (weapon != null) {
weapon.setWeaponEntityId(getScene().getWorld().getNextEntityId(EntityIdType.WEAPON));
GameItem weapon = getAvatar().getWeapon();
if (weapon != null) {
weapon.setWeaponEntityId(getScene().getWorld().getNextEntityId(EntityIdType.WEAPON));
}
}
}

Expand Down

0 comments on commit c88fd29

Please sign in to comment.