feat: enemy destroy now removes from physics world before destroying colliders and rigidbody
This commit is contained in:
parent
3756280796
commit
92bf07d050
|
@ -103,11 +103,11 @@ void EnemyDraw(Enemy* self) {
|
||||||
|
|
||||||
void EnemyDestroy(Enemy* self) {
|
void EnemyDestroy(Enemy* self) {
|
||||||
state_machine_destroy(self->behaviour);
|
state_machine_destroy(self->behaviour);
|
||||||
|
physics_world_remove_entity(Enemy_as_PhysicsEntity(self));
|
||||||
collider_destroy(self->collider);
|
collider_destroy(self->collider);
|
||||||
rigidbody_destroy(self->rigidbody);
|
rigidbody_destroy(self->rigidbody);
|
||||||
sprite_destroy(self->sprite);
|
sprite_destroy(self->sprite);
|
||||||
|
|
||||||
physics_world_remove_entity(Enemy_as_PhysicsEntity(self));
|
|
||||||
free(self);
|
free(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue