mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Merge pull request #1852 from Nordsoft91/load-crash
Fix divide by zero crash
This commit is contained in:
@@ -23,6 +23,9 @@ Type Progress::get() const
|
|||||||
if(_step >= _maxSteps)
|
if(_step >= _maxSteps)
|
||||||
return _target;
|
return _target;
|
||||||
|
|
||||||
|
if(!_maxSteps)
|
||||||
|
return _progress;
|
||||||
|
|
||||||
return static_cast<int>(_progress) + _step * static_cast<int>(_target - _progress) / _maxSteps;
|
return static_cast<int>(_progress) + _step * static_cast<int>(_target - _progress) / _maxSteps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user