mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fix divide by zero crash
This commit is contained in:
parent
4d6b88f10d
commit
d63e32841d
@ -23,6 +23,9 @@ Type Progress::get() const
|
||||
if(_step >= _maxSteps)
|
||||
return _target;
|
||||
|
||||
if(!_maxSteps)
|
||||
return _progress;
|
||||
|
||||
return static_cast<int>(_progress) + _step * static_cast<int>(_target - _progress) / _maxSteps;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user