1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Merge pull request #1852 from Nordsoft91/load-crash

Fix divide by zero crash
This commit is contained in:
Ivan Savenko 2023-04-02 20:07:09 +03:00 committed by GitHub
commit 141443b319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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