forked from mirrors/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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user