Fix division by 0 error in PickSpawnPoint

The spawn code should not assume that obstructions will never be
0-sized.

Reported by: Zack
Fixes #6039

Differential Revision: https://code.wildfiregames.com/D3583
This was SVN commit r24945.
This commit is contained in:
wraitii 2021-02-27 10:21:04 +00:00
parent c6f50b253f
commit 52fcee9c91

View File

@ -170,6 +170,9 @@ public:
if (cmpSpawnedObstruction)
{
spawnedRadius = cmpSpawnedObstruction->GetSize();
// Force a positive radius to avoid division by zero errors.
if (spawnedRadius == 0)
spawnedRadius = 1;
spawnedTag = cmpSpawnedObstruction->GetObstruction();
}