From 25ac379c83f79c6218354195751c9ab71e3090c4 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Sat, 29 Jul 2023 18:01:46 -0700 Subject: [PATCH] FX_Corpse: Add server-side animation code for the model --- src/shared/fx_corpse.qc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shared/fx_corpse.qc b/src/shared/fx_corpse.qc index 0231ba2..1f6c6eb 100644 --- a/src/shared/fx_corpse.qc +++ b/src/shared/fx_corpse.qc @@ -44,6 +44,16 @@ FX_Corpse_Next(void) return r; } +void +FX_Corpse_Update(void) +{ + NSEntity meSelf = (NSEntity)self; + meSelf.frame1time += frametime; + + if (meSelf.frame1time < 10.0) + meSelf.ScheduleThink(FX_Corpse_Update, 0.0f); +} + entity FX_Corpse_Spawn(player pl, float anim) { @@ -58,6 +68,7 @@ FX_Corpse_Spawn(player pl, float anim) body_next.velocity = (pl.velocity) + [0,0,120]; body_next.colormap = pl.colormap; body_next.SetFrame(anim); + body_next.ScheduleThink(FX_Corpse_Update, 0.0f); return (entity)body_next; } #endif