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