Skip to content

Commit

Permalink
Merge pull request #303 from Spartan322/fix/asset-manager-crashes
Browse files Browse the repository at this point in the history
Fix `AssetManager::get_currency_texture` crashes
  • Loading branch information
Hop311 authored Nov 26, 2024
2 parents ad5067e + 1e978de commit bbcf5f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion extension/src/openvic-extension/singletons/AssetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ Error AssetManager::preload_textures() {
return ERR(ret);
}

Ref<GFXSpriteTexture> const& AssetManager::get_currency_texture(real_t height) const {
Ref<GFXSpriteTexture> AssetManager::get_currency_texture(real_t height) const {
ERR_FAIL_NULL_V(currency_texture_big, Ref<GFXSpriteTexture>());
ERR_FAIL_NULL_V(currency_texture_medium, Ref<GFXSpriteTexture>());
if (height > currency_texture_big->get_height()) {
return currency_texture_big;
} else if (height > currency_texture_medium->get_height()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace OpenVic {
godot::Error preload_textures();

/* Get the largest currency texture with height less than the specified font height. */
godot::Ref<GFXSpriteTexture> const& get_currency_texture(real_t height) const;
godot::Ref<GFXSpriteTexture> get_currency_texture(real_t height) const;
};
}

Expand Down

0 comments on commit bbcf5f6

Please sign in to comment.