Check for an invalid avatar in a team

This commit is contained in:
KingRainbow44 2023-06-01 20:00:17 -04:00
parent 20f0cda3e0
commit 43f3494073
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -1,12 +1,12 @@
package emu.grasscutter.game.player;
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
import dev.morphia.annotations.Entity;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
@Entity
public final class TeamInfo {
@ -87,6 +87,8 @@ public final class TeamInfo {
for (int i = 0; i < this.getAvatars().size(); i++) {
Avatar avatar = player.getAvatars().getAvatarById(this.getAvatars().get(i));
if (avatar == null) continue;
avatarTeam.addAvatarGuidList(avatar.getGuid());
}