krisan
Recruit
I Register a new campaignbehaviorbase that change the length of size of volunteertypes
And after a while i get an error indexOutOfrange And in recruitment windows still showing 6.
And after a while i get an error indexOutOfrange And in recruitment windows still showing 6.
C#:
int limit = 10;
foreach (Hero hero in Hero.AllAliveHeroes)
{
bool flag = hero.VolunteerTypes.Length != limit;
var before = hero.VolunteerTypes.Length;
if (flag)
{
CharacterObject[] array = new CharacterObject[limit];
for (int i = 0; i < hero.VolunteerTypes.Length; i++)
{
bool flag2 = i < limit;
if (flag2)
{
array[i] = hero.VolunteerTypes[i];
}
}
hero.VolunteerTypes = array;
}
}