anchor.diff:  //For caching unit/house/group IDs. Shared between States and Actions.
   //Because scripts runs the same on every computer (i.e. no access to gMySpectator)
   //we can safely use pointers within the cache
  +
  +// We cache nil objects too, cos our goal is to resolve UID asap, no matter its state.
  +// Hence UID can be valid and pointer = nil when the object is dying
   const
     CACHE_SIZE = 16; //Too big means caching becomes slow
   
  
positive.code: 
  
  function TKMScriptingIdCache.GetUnit(aUID: Integer): TKMUnit;
  var I: ShortInt;
  begin
    for I := Low(fUnitCache) to High(fUnitCache) do
      if fUnitCache[I].UID = aUID then
  
negative.code: 
  procedure TKMScriptingIdCache.UpdateState;
  var
    I: Integer;
  begin
    //Clear out dead IDs every now and again
    //Leave them in the cache as nils, because we still might need to lookup that UID
  