]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give CopyBody a return pointer to the clone
authordrjaska <drjaska83@gmail.com>
Fri, 23 Aug 2024 22:22:30 +0000 (01:22 +0300)
committerdrjaska <drjaska83@gmail.com>
Fri, 23 Aug 2024 22:22:30 +0000 (01:22 +0300)
qcsrc/server/player.qc
qcsrc/server/player.qh

index faaec731c48e893706024b23de40d0a5fec637d7..e2e97852a6335538be6d4db998617de1f7796428 100644 (file)
@@ -61,10 +61,10 @@ void CopyBody_Think(entity this)
        CSQCMODEL_AUTOUPDATE(this);
        this.nextthink = time;
 }
-void CopyBody(entity this, float keepvelocity)
+entity CopyBody(entity this, float keepvelocity)
 {
        if (this.effects & EF_NODRAW)
-               return;
+               return NULL;
        entity clone = new(body);
        clone.enemy = this;
        clone.lip = this.lip;
@@ -141,6 +141,8 @@ void CopyBody(entity this, float keepvelocity)
        IL_PUSH(g_clones, clone);
 
        MUTATOR_CALLHOOK(CopyBody, this, clone, keepvelocity);
+
+       return clone;
 }
 
 void player_setupanimsformodel(entity this)
index 10b394502e531df8df2d09c25566bb021681d5df..7181151fbdf74af8086edf39037679220d0379bd 100644 (file)
@@ -30,7 +30,7 @@ float autocvar_sv_gibhealth;
 .float CopyBody_nextthink;
 .void(entity this) CopyBody_think;
 void CopyBody_Think(entity this);
-void CopyBody(entity this, float keepvelocity);
+entity CopyBody(entity this, float keepvelocity);
 
 void player_setupanimsformodel(entity this);