Check active team size, rather than using a 4 constant

This commit is contained in:
KingRainbow44 2023-04-29 02:10:14 -04:00
parent 5fcfea2b11
commit df1b65b8a8
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -513,6 +513,8 @@ public final class TeamManager extends BasePlayerDataManager {
* @param trialAvatarIds The avatar IDs to remove.
*/
public void removeTrialAvatarTeam(List<Integer> trialAvatarIds) {
var isTeam = trialAvatarIds.size() == this.getActiveTeam().size();
var player = this.getPlayer();
var scene = player.getScene();
@ -524,7 +526,7 @@ public final class TeamManager extends BasePlayerDataManager {
this.getActiveTeam().forEach(avatarEntity -> scene
.removeEntity(avatarEntity, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE));
if (trialAvatarIds.size() == 4) {
if (isTeam) {
this.getActiveTeam().clear();
this.getTrialAvatars().clear();
} else {
@ -536,7 +538,7 @@ public final class TeamManager extends BasePlayerDataManager {
}
// Re-add the avatars to the team.
if (trialAvatarIds.size() == 4) {
if (isTeam) {
// Restores all avatars from the player's avatar storage.
this.getCurrentTeamInfo().getAvatars().forEach(avatarId ->
this.getActiveTeam().add(new EntityAvatar(