SAGA2: Fallback for invalid sector deactivation

This commit is contained in:
a/ 2021-06-24 23:00:43 +09:00 committed by Eugene Sandulenko
parent f39036ff8e
commit d39fa6e86e
No known key found for this signature in database
GPG key ID: 014D387312D34F08

View file

@ -3199,8 +3199,13 @@ void ActiveRegion::update(void) {
for (v = region.min.v; v < region.max.v; v++) {
if (uOutOfRange
|| v < newRegion.min.v
|| v >= newRegion.max.v)
world->getSector(u, v)->deactivate();
|| v >= newRegion.max.v) {
if(Sector *sect = world->getSector(u, v))
sect->deactivate();
else
warning("ActiveRegion::update: Invalid Sector (%d, %d)", u, v);
}
}
}