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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user