Ejemplo n.º 1
0
 public void FreezeObjectRefs()
 {
     selfTracking    = GameSystems.MapObject.CreateFrozenRef(self.obj);
     targetTracking  = GameSystems.MapObject.CreateFrozenRef(target.obj);
     blockTracking   = GameSystems.MapObject.CreateFrozenRef(block.obj);
     scratchTracking = GameSystems.MapObject.CreateFrozenRef(scratch.obj);
     parentTracking  = GameSystems.MapObject.CreateFrozenRef(parent.obj);
 }
Ejemplo n.º 2
0
    private static bool ValidateObjectRef(ref AnimParam animParam, FrozenObjRef frozenRef)
    {
        if (animParam.obj != null)
        {
            // NOTE: Vanilla also checked that the handle was valid, but we no longer do this
            // since handles never are "really" invalid...
            // This check however could be replaced with a check whether the object still belongs to the
            // currently loaded map or not.
            return(true);
        }

        if (!GameSystems.MapObject.Unfreeze(frozenRef, out var obj))
        {
            Logger.Error("Failed to recover object reference in anim goal");
            animParam.obj = null;
            return(false);
        }

        animParam.obj = obj;
        return(true);
    }