Narrow the gui player lookups

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 3c0b5069fc
commit 231c3a9ea0
4 changed files with 14 additions and 12 deletions
+5 -5
View File
@@ -44,7 +44,7 @@ function FlyingText.create_above_entity(options)
local entity = assert(options.target_entity, "A target entity is required")
local bounding_box = entity.bounding_box --[[@as ExpUtil_AABB.Box]]
local size_y = bounding_box.left_top.y - bounding_box.right_bottom.y
local position = entity.position --[[@as MapPosition.struct]]
local position = entity.position --[[@as MapPosition.struct]]
local offset = options.offset or { x = 0, y = 0 }
options.position = {
@@ -64,9 +64,9 @@ end
function FlyingText.create_above_player(options)
local player = assert(options.target_player, "A target player is required")
local entity = player.character; if not entity then return end
local bounding_box = entity.bounding_box --[[@as ExpUtil_AABB.Box]]
local bounding_box = entity.bounding_box --[[@as ExpUtil_AABB.Box]]
local size_y = bounding_box.left_top.y - bounding_box.right_bottom.y
local position = entity.position --[[@as MapPosition.struct]]
local position = entity.position --[[@as MapPosition.struct]]
local offset = options.offset or { x = 0, y = 0 }
options.position = {
@@ -86,9 +86,9 @@ end
function FlyingText.create_as_player(options)
local player = assert(options.target_player, "A target player is required")
local entity = player.character; if not entity then return end
local bounding_box = entity.bounding_box --[[@as ExpUtil_AABB.Box]]
local bounding_box = entity.bounding_box --[[@as ExpUtil_AABB.Box]]
local size_y = bounding_box.left_top.y - bounding_box.right_bottom.y
local position = entity.position --[[@as MapPosition.struct]]
local position = entity.position --[[@as MapPosition.struct]]
local offset = options.offset or { x = 0, y = 0 }
options.color = player.chat_color