Assert optional api results across the scenario modules

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:43 +00:00
co-authored by Claude Opus 5
parent f9ce3c4145
commit 3c0b5069fc
6 changed files with 11 additions and 10 deletions
@@ -26,11 +26,12 @@ local function on_entity_damaged(event)
-- Outputs the message as floating text
if message then
local entity_position = entity.position --[[@as MapPosition.struct]]
local entity_radius = max(1, entity.get_radius())
local offset = (random() - 0.5) * entity_radius * config.damage_location_variance
local position = { x = entity.position.x + offset, y = entity.position.y - entity_radius }
local position = { x = entity_position.x + offset, y = entity_position.y - entity_radius }
local health_percentage = entity.get_health_ratio()
local health_percentage = assert(entity.get_health_ratio())
local color = { r = 1 - health_percentage, g = health_percentage, b = 0 }
FlyingText.create{