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:
commit
141443b319
@ -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