Only print Sprite warnings if we have Sprites set
If we don't set Sprites at all or the Sprites were not loaded yet, the warnings can be misleading.
This commit is contained in:
@@ -54,7 +54,9 @@ std::shared_ptr<const SpriteImage> SpriteStore::getSprite(const std::string& nam
|
||||
if (it != sprites.end()) {
|
||||
return it->second;
|
||||
} else {
|
||||
Log::Info(Event::Sprite, "Can't find sprite named '%s'", name.c_str());
|
||||
if (!sprites.empty()) {
|
||||
Log::Info(Event::Sprite, "Can't find sprite named '%s'", name.c_str());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user