Fix missing collision for charger, spawner, and laser turret

All three new entity types were absent from the hardcoded enemy-type
checks in is_enemy() (contact damage + projectile hits), homing
projectile targeting, and drone targeting. Also adds proper death
particle colors for charger (orange) and spawner (purple).
This commit is contained in:
Thomas
2026-03-02 20:50:44 +00:00
parent 5f899f61c6
commit 196b4f35b9
3 changed files with 12 additions and 4 deletions

View File

@@ -35,7 +35,8 @@ static Entity *find_nearest_enemy(Vec2 from, float range) {
Entity *e = &s_em->entities[i];
if (!e->active || e->health <= 0) continue;
if (e->type != ENT_ENEMY_GRUNT && e->type != ENT_ENEMY_FLYER &&
e->type != ENT_TURRET) continue;
e->type != ENT_TURRET && e->type != ENT_ENEMY_CHARGER &&
e->type != ENT_SPAWNER && e->type != ENT_LASER_TURRET) continue;
Vec2 epos = vec2(e->body.pos.x + e->body.size.x * 0.5f,
e->body.pos.y + e->body.size.y * 0.5f);
float dx = epos.x - from.x;