Skip to content

Commit

Permalink
Map: Fix crash from StatBlocks being corrupted
Browse files Browse the repository at this point in the history
We're using indexToMin() and indexToMax() here, so we expect the index
to map into damage_types.list and not damage_types.count.
  • Loading branch information
dorkster committed Jan 14, 2025
1 parent c02687c commit 0412b44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ int Map::addEventStatBlock(Event &evnt) {

EventComponent *ec_damage = evnt.getComponent(EventComponent::POWER_DAMAGE);
if (ec_damage) {
for (size_t i = 0; i < eset->damage_types.count; ++i) {
for (size_t i = 0; i < eset->damage_types.list.size(); ++i) {
statb->starting[Stats::COUNT + eset->damage_types.indexToMin(i)] = ec_damage->data[0].Float; // min
statb->starting[Stats::COUNT + eset->damage_types.indexToMax(i)] = ec_damage->data[1].Float; // min
}
Expand Down
2 changes: 1 addition & 1 deletion src/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FLARE. If not, see http://www.gnu.org/licenses/

#include <SDL.h>

Version VersionInfo::ENGINE(1, 14, 92);
Version VersionInfo::ENGINE(1, 14, 93);
Version VersionInfo::MIN(0, 0, 0);
Version VersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);

Expand Down

0 comments on commit 0412b44

Please sign in to comment.