anchor.diff:  
   
   function TKMScriptingIdCache.GetGroup(aID:Integer): TKMUnitGroup;
  -var I: Shortint;
  +var I: ShortInt;
   begin
  -  for I := 0 to fGroupCount - 1 do
  -    if fGroupCache[i].ID = aID then
  -    begin
  -      Result := fGroupCache[i].G;
  -      Exit;
  -    end;
  +  for I := Low(fGroupCache) to High(fGroupCache) do
  +  if fGroupCache[I].ID = aID then
  +  begin
  +    Result := fGroupCache[I].G;
  +    Exit;
  +  end;
   
     //Not found so do lookup and add it to the cache
     Result := fPlayers.GetGroupByID(aID);
  
positive.code: 
  
  function TKMScriptingIdCache.GetHouse(aID:Integer): TKMHouse;
  var I: Shortint;
  begin
    for I := 0 to fHouseCount - 1 do
      if fHouseCache[i].ID = aID then
      begin
        Result := fHouseCache[i].H;
        Exit;
      end;
  
    //Not found so do lookup and add it to the cache
    Result := fPlayers.GetHouseByID(aID);
  
negative.code: 
  procedure TKMScriptingIdCache.UpdateState;
  var
    I: ShortInt;
  begin
    //Clear out dead IDs every now and again
    //Leave them in the cache as nils, because we still might need to lookup that ID
    if fGame.GameTickCount mod 11 = 0 then
    begin
      for I := Low(fUnitCache) to High(fUnitCache) do
        if (fUnitCache[I].U <> nil) and fUnitCache[I].U.IsDead then
          fPlayers.CleanUpUnitPointer(fUnitCache[I].U);
  
      for I := Low(fHouseCache) to High(fHouseCache) do
        if (fHouseCache[I].H <> nil) and fHouseCache[I].H.IsDestroyed then
          fPlayers.CleanUpHousePointer(fHouseCache[I].H);
  
      for I := Low(fGroupCache) to High(fGroupCache) do
        if (fGroupCache[I].G <> nil) and fGroupCache[I].G.IsDead then
          fPlayers.CleanUpGroupPointer(fGroupCache[I].G);
    end;
  