-
-
Save DrMcCoy/9f629e4c6b9481a043d154d938398261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/graphics/aurora/model_nwn.cpp b/src/graphics/aurora/model_nwn.cpp | |
index e302100..1eaf052 100644 | |
--- a/src/graphics/aurora/model_nwn.cpp | |
+++ b/src/graphics/aurora/model_nwn.cpp | |
@@ -392,6 +392,12 @@ void Model_NWN::addState(ParserContext &ctx) { | |
return; | |
} | |
+ if (_stateMap.find(ctx.state->name) != _stateMap.end()) { | |
+ warning("Duplicate state \"%s\" in model \"%s\"", ctx.state->name.c_str(), _name.c_str()); | |
+ ctx.clear(); | |
+ return; | |
+ } | |
+ | |
for (std::list<ModelNode *>::iterator n = ctx.nodes.begin(); | |
n != ctx.nodes.end(); ++n) { | |
@@ -420,6 +426,11 @@ void Model_NWN::readAnimBinary(ParserContext &ctx, uint32 offset) { | |
ctx.state->name = Common::readStringFixed(*ctx.mdl, Common::kEncodingASCII, 64); | |
+ if (_animationMap.find(ctx.state->name) != _animationMap.end()) { | |
+ warning("Duplicate animation \"%s\" in model \"%s\"", ctx.state->name.c_str(), _name.c_str()); | |
+ return; | |
+ } | |
+ | |
uint32 nodeHeadPointer = ctx.mdl->readUint32LE(); | |
uint32 nodeCount = ctx.mdl->readUint32LE(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment