Skip to content

Commit d945e03

Browse files
Updated Unload() to check if animCount is 0 before unloading.
1 parent d4cf1eb commit d945e03

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

include/ModelAnimation.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ class ModelAnimation : public ::ModelAnimation {
7272
/**
7373
* Unload animation data
7474
*/
75-
void Unload() { ::UnloadModelAnimations(this, animCount); }
75+
void Unload() {
76+
if(animCount <= 0) {
77+
throw std::runtime_error("ModelAnimation::Unload() called on an object that was not loaded with any animations.");
78+
}
79+
80+
::UnloadModelAnimations(this, animCount);
81+
}
7682

7783
/**
7884
* Update model animation pose

0 commit comments

Comments
 (0)