From: drjaska Date: Fri, 23 Aug 2024 22:22:30 +0000 (+0300) Subject: Give CopyBody a return pointer to the clone X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=181207f83aee51d8dc1fdaf4dcf6a4fe2bcc809f;p=xonotic%2Fxonotic-data.pk3dir.git Give CopyBody a return pointer to the clone --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index faaec731c..e2e97852a 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -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) diff --git a/qcsrc/server/player.qh b/qcsrc/server/player.qh index 10b394502..7181151fb 100644 --- a/qcsrc/server/player.qh +++ b/qcsrc/server/player.qh @@ -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);