Fix laser beam blocked by own tile, consolidate enemy-type checks

Beam raycast now skips the tile the turret is mounted on, so
wall-embedded laser turrets can shoot outward.

Extract entity_is_enemy() into engine/entity.c as single source
of truth for enemy-type checks. Replaces triplicated type lists
in level.c, drone.c, and projectile.c that caused the collision
bug when new enemy types were added.
This commit is contained in:
Thomas
2026-03-02 20:56:45 +00:00
parent 196b4f35b9
commit af0a9904c2
6 changed files with 33 additions and 19 deletions

View File

@@ -80,4 +80,8 @@ void entity_register(EntityManager *em, EntityType type,
EntityUpdateFn update, EntityRenderFn render,
EntityDestroyFn destroy);
/* Returns true if the entity is a hostile enemy type.
* Single source of truth — add new enemy types here. */
bool entity_is_enemy(const Entity *e);
#endif /* JNR_ENTITY_H */