Skip to content

Commit

Permalink
Added fallback drawing for entities
Browse files Browse the repository at this point in the history
Makes it easier to find entities that are missing any drawing code
Should also indirectly make selecting them easier
  • Loading branch information
Cruor committed Nov 1, 2023
1 parent 75cde13 commit afcdde8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ function entities.getEntityDrawable(name, handler, room, entity, viewport)
end

return drawableSprites

else
-- No drawing defined for the entity, use fallback
-- Make sure the entity doesn't have color or any other special attributes
local position = {
x = entity.x,
y = entity.y
}

return entities.getDrawable(name, missingEntityHandler, room, position, viewport)
end
end

Expand Down

0 comments on commit afcdde8

Please sign in to comment.