anchor.diff:        Warfare[WT].Demand := aNeeds[WT];
   
       //Calculate ratios at which warfare should be produced in workshops
  -    OrderRatio[wt_Shield] := aNeeds[wt_Shield] / (aNeeds[wt_Shield] + aNeeds[wt_Armor]);
  -    OrderRatio[wt_Armor]  := aNeeds[wt_Armor]  / (aNeeds[wt_Shield] + aNeeds[wt_Armor]);
  -    OrderRatio[wt_Axe]  := aNeeds[wt_Axe]  / (aNeeds[wt_Axe] + aNeeds[wt_Pike] + aNeeds[wt_Bow]);
  -    OrderRatio[wt_Pike] := aNeeds[wt_Pike] / (aNeeds[wt_Axe] + aNeeds[wt_Pike] + aNeeds[wt_Bow]);
  -    OrderRatio[wt_Bow]  := aNeeds[wt_Bow]  / (aNeeds[wt_Axe] + aNeeds[wt_Pike] + aNeeds[wt_Bow]);
  -
  -    OrderRatio[wt_MetalShield] := aNeeds[wt_MetalShield] / (aNeeds[wt_MetalShield] + aNeeds[wt_MetalArmor]);
  -    OrderRatio[wt_MetalArmor]  := aNeeds[wt_MetalArmor]  / (aNeeds[wt_MetalShield] + aNeeds[wt_MetalArmor]);
  -    OrderRatio[wt_Sword]     := aNeeds[wt_Sword]     / (aNeeds[wt_Sword] + aNeeds[wt_Hallebard] + aNeeds[wt_Arbalet]);
  -    OrderRatio[wt_Hallebard] := aNeeds[wt_Hallebard] / (aNeeds[wt_Sword] + aNeeds[wt_Hallebard] + aNeeds[wt_Arbalet]);
  -    OrderRatio[wt_Arbalet]   := aNeeds[wt_Arbalet]   / (aNeeds[wt_Sword] + aNeeds[wt_Hallebard] + aNeeds[wt_Arbalet]);
  +    OrderRatio[wt_Shield] := aNeeds[wt_Shield] / Max(0.001,(aNeeds[wt_Shield] + aNeeds[wt_Armor]));
  +    OrderRatio[wt_Armor]  := aNeeds[wt_Armor]  / Max(0.001,(aNeeds[wt_Shield] + aNeeds[wt_Armor]));
  +    OrderRatio[wt_Axe]  := aNeeds[wt_Axe]  / Max(0.001,(aNeeds[wt_Axe] + aNeeds[wt_Pike] + aNeeds[wt_Bow]));
  +    OrderRatio[wt_Pike] := aNeeds[wt_Pike] / Max(0.001,(aNeeds[wt_Axe] + aNeeds[wt_Pike] + aNeeds[wt_Bow]));
  +    OrderRatio[wt_Bow]  := aNeeds[wt_Bow]  / Max(0.001,(aNeeds[wt_Axe] + aNeeds[wt_Pike] + aNeeds[wt_Bow]));
  +
  +    OrderRatio[wt_MetalShield] := aNeeds[wt_MetalShield] / Max(0.001,(aNeeds[wt_MetalShield] + aNeeds[wt_MetalArmor]));
  +    OrderRatio[wt_MetalArmor]  := aNeeds[wt_MetalArmor]  / Max(0.001,(aNeeds[wt_MetalShield] + aNeeds[wt_MetalArmor]));
  +    OrderRatio[wt_Sword]     := aNeeds[wt_Sword]     / Max(0.001,(aNeeds[wt_Sword] + aNeeds[wt_Hallebard] + aNeeds[wt_Arbalet]));
  +    OrderRatio[wt_Hallebard] := aNeeds[wt_Hallebard] / Max(0.001,(aNeeds[wt_Sword] + aNeeds[wt_Hallebard] + aNeeds[wt_Arbalet]));
  +    OrderRatio[wt_Arbalet]   := aNeeds[wt_Arbalet]   / Max(0.001,(aNeeds[wt_Sword] + aNeeds[wt_Hallebard] + aNeeds[wt_Arbalet]));
     end;
   end;
   
  
positive.code:   end;
  
    IronConsumption := SteelConsumptionRate; //Any not being used for steel is excess
    IronReserve := gHands[fOwner].Stats.GetWareBalance(wt_IronOre) / IronConsumption;
    IronProduction := IronPerMin + Max(IronReserve - 30, 0);
  
    if IronProduction >= IronConsumption then
  
negative.code: 
      //Current wood consumption
      WoodConsumption := WoodNeed + ShieldsPerMin + WeaponsPerMin * WEAP_COST;
      WoodReserve := gHands[fOwner].Stats.GetWareBalance(wt_Wood) / Max(1,WoodConsumption);
      WoodProduction := WoodPerMin + Max(WoodReserve - 30, 0);
  
      //Wood shares
  