Fixed index assignment
Thanks to @Everade
This commit is contained in:
parent
6ddf1a3224
commit
3e43860efc
@ -4240,13 +4240,22 @@ bool MobDatabase::parseDropNode(const std::string& nodeName, const YAML::Node& n
|
||||
}
|
||||
}
|
||||
} else {
|
||||
index = i++;
|
||||
// Find next empty slot
|
||||
for( ; i < max; i++ ){
|
||||
if( drops[i].nameid == 0 ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (index >= max) {
|
||||
// No empty slots anymore
|
||||
if (i >= max) {
|
||||
this->invalidWarning(dropit, "Maximum of %d monster %s met, skipping.\n", max, nodeName.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
// Use free index and increment it for the next entry
|
||||
index = i++;
|
||||
|
||||
if( this->nodeExists( dropit, "Clear" ) ){
|
||||
bool clear;
|
||||
|
||||
@ -4256,10 +4265,13 @@ bool MobDatabase::parseDropNode(const std::string& nodeName, const YAML::Node& n
|
||||
|
||||
if( clear ){
|
||||
// Clear all
|
||||
for( uint8 i = 0; i < max; i++ ){
|
||||
drops[i] = {};
|
||||
for( uint8 j = 0; j < max; j++ ){
|
||||
drops[j] = {};
|
||||
}
|
||||
|
||||
// Reset current index for next entry
|
||||
i = 0;
|
||||
|
||||
if( !this->nodeExists( dropit, "Item" ) ){
|
||||
// Continue with next yaml node
|
||||
continue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user