Fix zmc crashing when zones are no good bby decreasing n_zone before continuing

This commit is contained in:
Isaac Connor 2017-03-16 10:55:13 -04:00
parent 9681a444b4
commit 6a447194eb
1 changed files with 2 additions and 0 deletions

View File

@ -990,12 +990,14 @@ int Zone::Load( Monitor *monitor, Zone **&zones )
Polygon polygon;
if ( !ParsePolygonString( Coords, polygon ) ) {
Error( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s, ignoring", Coords, Id, Name, monitor->Name() );
n_zones -= 1;
continue;
}
if ( polygon.LoX() < 0 || polygon.HiX() >= (int)monitor->Width()
|| polygon.LoY() < 0 || polygon.HiY() >= (int)monitor->Height() ) {
Error( "Zone %d/%s for monitor %s extends outside of image dimensions, (%d,%d), (%d,%d), ignoring", Id, Name, monitor->Name(), polygon.LoX(), polygon.LoY(), polygon.HiX(), polygon.HiY() );
n_zones -= 1;
continue;
}