1
0
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:
nordsoft 2023-04-02 15:28:41 +04:00
parent 4d6b88f10d
commit d63e32841d

View File

@ -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;
}