diff --git a/assets/assetmissing/assetmissing.dance b/assets/assetmissing/assetmissing.dance new file mode 100644 index 0000000..6070b60 --- /dev/null +++ b/assets/assetmissing/assetmissing.dance @@ -0,0 +1,11 @@ +{ + "name" : "assetmissing", + "states" : ["idle","sit"], + "cycle" : 0.5, + "cyclic" : true, + "duration" : 1.0, + "steps" : [ + // body, frontArm, backArm, headOffset, frontArmOffset, backArmOffset + [ "idle.1", "rotation?flipx", "rotation", [0, 0], [-6, 0], [0, 0] ] + ] +} \ No newline at end of file diff --git a/source/game/StarDanceDatabase.cpp b/source/game/StarDanceDatabase.cpp index 3ad2277..2e81fe5 100644 --- a/source/game/StarDanceDatabase.cpp +++ b/source/game/StarDanceDatabase.cpp @@ -17,7 +17,12 @@ DanceDatabase::DanceDatabase() { } DancePtr DanceDatabase::getDance(String const& name) const { - return m_dances.get(name); + if (auto dance = m_dances.ptr(name)) + return *dance; + else { + Logger::error("Invalid dance '{}', using default", name); + return m_dances.get("assetmissing"); + } } DancePtr DanceDatabase::readDance(String const& path) {