anchor.diff:        ResIn[I] := ResIn[I] + aCount;
         if aFromScript then
         begin
  -        Inc(fResourceDeliveryCount[I], aCount);
  +        ResDeliveryCnt[I] := ResDeliveryCnt[I] + aCount;
           OrdersRemoved := gHands[fOwner].Deliveries.Queue.TryRemoveDemand(Self, aWare, aCount);
  -        Dec(fResourceDeliveryCount[I], OrdersRemoved);
  +        ResDeliveryCnt[I] := ResDeliveryCnt[I] - OrdersRemoved;
         end;
       end;
   end;
  
positive.code:   for I := 1 to 4 do
      if aWare = gRes.Houses[fType].ResInput[I] then
      begin
        fResourceDeliveryCount[I] := Max(0, fResourceDeliveryCount[I] - 1);
        Exit;
      end;
  end;
  
negative.code:     if not (fType = htTownHall) and not (gRes.Houses[fType].ResInput[I] in [wtAll, wtWarfare, wtNone]) then
      begin
        //Not enough resources ordered, add new demand
        if ResDeliveryCnt[I] < GetResDistribution(I) then
        begin
          Count := GetResDistribution(I) - ResDeliveryCnt[I];
          gHands[fOwner].Deliveries.Queue.AddDemand(
            Self, nil, gRes.Houses[fType].ResInput[I], Count, dtOnce, diNorm);
  
          ResDeliveryCnt[I] := ResDeliveryCnt[I] + Count;
        end;
  
        //Too many resources ordered, attempt to remove demand if nobody has taken it yet
        if ResDeliveryCnt[I] > GetResDistribution(I) then
        begin
          Excess := ResDeliveryCnt[I] - GetResDistribution(I);
          Count := gHands[fOwner].Deliveries.Queue.TryRemoveDemand(Self, gRes.Houses[fType].ResInput[I], Excess);
  
          ResDeliveryCnt[I] := ResDeliveryCnt[I] - Count; //Only reduce it by the number that were actually removed
        end;
  
      end;
  