forked from 0ad/0ad
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:
parent
c6f50b253f
commit
52fcee9c91
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user