From ea8f991bf37ac4b6505ac85ac0371c20426e7346 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 7 May 2022 09:53:26 +0900 Subject: [PATCH] [ruamoko] Clear efrags when destroying an entity This ensures the rendering system won't attempt to draw the entity after it has been destroyed. --- libs/ruamoko/rua_scene.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ruamoko/rua_scene.c b/libs/ruamoko/rua_scene.c index c5daeb45f..fc42fab61 100644 --- a/libs/ruamoko/rua_scene.c +++ b/libs/ruamoko/rua_scene.c @@ -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);