QUICK 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //********************************************************************************************************************************
  2. void DoInjuriesAndMatchBans( char GAMEtype, char Team )
  3. {
  4. char LastPlyr, Swapped;
  5. short PlyrIndex, Plyr;
  6. if ( GAMEtype == EURO_championship )
  7. {
  8. LastPlyr = 19;
  9. Swapped = 1;
  10. while ( Swapped !=0 )
  11. {
  12. // **** Find A Spot At The End Of The Squad List For Player To Be Swapped Into ****
  13. PlyrIndex = NormalisePlayer( LastPlyr, Team );
  14. if ( DiscPts[PlyrIndex] > 1 || Fitness[PlyrIndex] < Injured )
  15. {
  16. LastPlyr--;
  17. if ( LastPlyr < 1 ) // **** checked all available players so bomb out and leave player
  18. Swapped = 0; // were he is ****
  19. }
  20. else
  21. {
  22. for ( char s=0; s < 11; s ++ )
  23. {
  24. Swapped = 0;
  25. PlyrIndex = NormalisePlayer( s, Team );
  26. if ( DiscPts[PlyrIndex] > 1 || Fitness[PlyrIndex] < Injured )
  27. {
  28. char p = SquadInfo[ (Team*20)+s ];
  29. SquadInfo[ (Team*20)+s ] = SquadInfo[ (Team*20)+LastPlyr ];
  30. SquadInfo[ (Team*20)+LastPlyr ] = p;
  31. Swapped = 1;
  32. // **** Was This An Ideal Swap ****
  33. // if ( PlayerPosns[ (Team*20)+s ] != PlayerPosns[ (Team*20)+LastPlyr ] )
  34. // {
  35. // }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. //********************************************************************************************************************************