Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Fixed regression in map loader
Browse files Browse the repository at this point in the history
No longer adds nodes attribute where it shouldn't belong.
Made tile renderer no longer fail on bad image paths.
Keys no longer assume they have two nodes when they don't.
  • Loading branch information
Cruor authored and Vexatos committed Feb 19, 2020
1 parent 2a52813 commit 823838c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/celeste_render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ function drawTile(ctx::Cairo.CairoContext, x::Integer, y::Integer, tiles::Tiles,

if tileValue != '0'
quad, sprite, imagePath = getTileData(x, y, tiles, meta, states)
imagePathSprite = getSprite(imagePath, "Gameplay")
imagePathExists = imagePath !== nothing && getSprite(imagePath, "Gameplay") !== Ahorn.Assets.missingImage

if quad !== nothing && imagePathSprite.surface !== Ahorn.Assets.missingImage
if quad !== nothing && imagePathExists
quadX, quadY = quad

if !isempty(sprite)
Expand Down
2 changes: 1 addition & 1 deletion src/entities/key.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sprite = "collectables/key/idle00.png"
function Ahorn.selection(entity::Maple.Key)
x, y = Ahorn.position(entity)

if haskey(entity.data, "nodes")
if haskey(entity.data, "nodes") && length(entity["nodes"]) >= 2
controllX, controllY = Int.(entity.data["nodes"][1])
endX, endY = Int.(entity.data["nodes"][2])

Expand Down

0 comments on commit 823838c

Please sign in to comment.