Change OnPlaceEnter to:
Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
AiBirthPlace birthPlace = GetBirthplace(actor);
AiCart cart = actor as AiCart;
if(cart != null)
AvailablePlanes.ForEach(place =>
{
if (place.BirthPlace == birthPlace.Name())
{
place.NumberOfPlanes--;
int numberOfAllAvailablePlanes = CountAvailablePlanes(actor.Army());
if (numberOfAllAvailablePlanes == 5)
{
if(actor.Army() == 1)
GamePlay.gpHUDLogCenter(null, "Attention Reds only {0} Planes are left", new object[] { numberOfAllAvailablePlanes });
if(actor.Army() == 2)
GamePlay.gpHUDLogCenter(null, "Attention Blues only {0} Planes are left", new object[] { numberOfAllAvailablePlanes });
}
if (place.NumberOfPlanes == 0)
{
GamePlay.gpHUDLogCenter(null, "Attention {0} is no longer available", new object[]{place.BirthPlace});
birthPlace.destroy();
}
}
});
}
Edith: Hatte die Seite bei der Meldung nicht berücksichtig.