[ruamoko] Clear efrags when destroying an entity

This ensures the rendering system won't attempt to draw the entity after
it has been destroyed.
This commit is contained in:
Bill Currie 2022-05-07 09:53:26 +09:00
parent 91c877b1a1
commit ea8f991bf3

View file

@ -257,6 +257,8 @@ bi_Scene_DestroyEntity (progs_t *pr, void *_res)
pr_ulong_t id = P_ULONG (pr, 0);
entity_t *ent = rua_entity_get (res, id);
pr_ulong_t scene_id = id & 0xffffffff;
R_RemoveEfrags (ent);
// bad scene caught above
rua_scene_t *scene = rua_scene_get (res, scene_id);
Scene_DestroyEntity (scene->scene, ent);