]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/defer.qh
Propagate this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / defer.qh
index 56014121f8936bf128492fcb0a4ac5e35c0754eb..d4c1eadac75db7a4dbbd87a738892b7e0f039565 100644 (file)
                SELFPARAM();
                this.think     = SUB_Remove_self;
                this.nextthink = time;
-               WITHSELF(this.owner, this.use());
+               WITHSELF(this.owner, this.selfthink(this));
        }
 
-/*
-    Execute func() after time + fdelay.
-    self when func is executed = self when defer is called
-*/
-       void defer(entity this, float fdelay, void() func)
+    /**
+     * Execute func() after time + fdelay.
+     * self when func is executed = self when defer is called
+     */
+       void defer(entity this, float fdelay, void(entity this) func)
        {
                entity e    = new_pure(deferred);
                e.owner     = this;
-               e.use       = func;
+               setthink(e, func);
                e.think     = defer_think;
                e.nextthink = time + fdelay;
        }