mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 11:26:07 +00:00
Check active team size, rather than using a 4
constant
This commit is contained in:
parent
5fcfea2b11
commit
df1b65b8a8
@ -513,6 +513,8 @@ public final class TeamManager extends BasePlayerDataManager {
|
|||||||
* @param trialAvatarIds The avatar IDs to remove.
|
* @param trialAvatarIds The avatar IDs to remove.
|
||||||
*/
|
*/
|
||||||
public void removeTrialAvatarTeam(List<Integer> trialAvatarIds) {
|
public void removeTrialAvatarTeam(List<Integer> trialAvatarIds) {
|
||||||
|
var isTeam = trialAvatarIds.size() == this.getActiveTeam().size();
|
||||||
|
|
||||||
var player = this.getPlayer();
|
var player = this.getPlayer();
|
||||||
var scene = player.getScene();
|
var scene = player.getScene();
|
||||||
|
|
||||||
@ -524,7 +526,7 @@ public final class TeamManager extends BasePlayerDataManager {
|
|||||||
this.getActiveTeam().forEach(avatarEntity -> scene
|
this.getActiveTeam().forEach(avatarEntity -> scene
|
||||||
.removeEntity(avatarEntity, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE));
|
.removeEntity(avatarEntity, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE));
|
||||||
|
|
||||||
if (trialAvatarIds.size() == 4) {
|
if (isTeam) {
|
||||||
this.getActiveTeam().clear();
|
this.getActiveTeam().clear();
|
||||||
this.getTrialAvatars().clear();
|
this.getTrialAvatars().clear();
|
||||||
} else {
|
} else {
|
||||||
@ -536,7 +538,7 @@ public final class TeamManager extends BasePlayerDataManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Re-add the avatars to the team.
|
// Re-add the avatars to the team.
|
||||||
if (trialAvatarIds.size() == 4) {
|
if (isTeam) {
|
||||||
// Restores all avatars from the player's avatar storage.
|
// Restores all avatars from the player's avatar storage.
|
||||||
this.getCurrentTeamInfo().getAvatars().forEach(avatarId ->
|
this.getCurrentTeamInfo().getAvatars().forEach(avatarId ->
|
||||||
this.getActiveTeam().add(new EntityAvatar(
|
this.getActiveTeam().add(new EntityAvatar(
|
||||||
|
Loading…
Reference in New Issue
Block a user