Skip to content

Commit

Permalink
Update cSpawnRegion.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoduz committed Dec 18, 2023
1 parent 9ff3215 commit e52467f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions source/cSpawnRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,19 +975,19 @@ bool CSpawnRegion::FindCharSpotToSpawn( SI16 &x, SI16 &y, SI08 &z, bool &waterCr
}

// Make sure the chosen spawn location is not in an exclusion area
auto illegalLoc = false;
if( !rValue )
{
for (auto& exclusionArea : exclusionAreas)
{
if( x >= exclusionArea.x1 && x <= exclusionArea.x2 && y >= exclusionArea.y1 && y <= exclusionArea.y2 )
{
// Chosen location is in an exclusion area. Disallow!
illegalLoc = true;
break;
}
}
}
auto illegalLoc = false;
if( !rValue )
{
for( auto &exclusionArea : exclusionAreas )
{
if( x >= exclusionArea.x1 && x <= exclusionArea.x2 && y >= exclusionArea.y1 && y <= exclusionArea.y2 )
{
// Chosen location is in an exclusion area. Disallow!
illegalLoc = true;
break;
}
}
}

// Since our chosen location has not already been validated, lets validate it with a land-based creature in mind
if( !illegalLoc && !waterCreature && Map->ValidSpawnLocation( x, y, z, worldNumber, instanceId ))
Expand Down

0 comments on commit e52467f

Please sign in to comment.