Merge pull request #1042 from EmosewaMC/FixSkills

Fix SwitchMultiple incorrect handling
This commit is contained in:
Gie "Max" Vanommeslaeghe 2023-04-03 20:52:22 +02:00 committed by GitHub
commit 3202b5a36e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,13 +22,9 @@ void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream*
for (unsigned int i = 0; i < this->m_behaviors.size(); i++) {
const double data = this->m_behaviors.at(i).first;
trigger = i;
if (value <= data) {
trigger = i;
break;
}
if (value <= data) break;
}
auto* behavior = this->m_behaviors.at(trigger).second;