FX_Corpse: Add server-side animation code for the model

This commit is contained in:
Marco Cawthorne 2023-07-29 18:01:46 -07:00
parent aaf15a3f28
commit 25ac379c83
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 11 additions and 0 deletions

View File

@ -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