trainers must have at least 1 pokemon

other arrays are limited to have at least 1 element, add that limit for trainer teams as well
This commit is contained in:
Haven1433 2022-08-29 20:49:29 -05:00
parent 6bd154ea22
commit ce27bdcd53

View File

@ -514,6 +514,7 @@ namespace HavenSoft.HexManiac.Core.Models.Runs {
var newStructType = model[pointerSource - TrainerFormat_PointerOffset];
var newElementCount = model[pointerSource - TrainerFormat_PointerOffset + TrainerFormat_PokemonCountOffset];
newElementCount = Math.Max(newElementCount, (byte)1);
var newRun = this;
if (newElementCount != ElementCount) newRun = (TrainerPokemonTeamRun)newRun.Append(token, newElementCount - ElementCount);