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

Fix potential uninitialized access - setupSteps depends on not yet

initialized members
This commit is contained in:
Ivan Savenko 2023-12-23 21:31:17 +02:00
parent 20ede710c2
commit 7732f39556

View File

@ -13,14 +13,16 @@
using namespace Load; using namespace Load;
Progress::Progress(): _progress(std::numeric_limits<Type>::min()) Progress::Progress()
{ : Progress(100)
setupSteps(100); {}
}
Progress::Progress(int steps): _progress(std::numeric_limits<Type>::min()) Progress::Progress(int steps)
: _progress(std::numeric_limits<Type>::min())
, _target(std::numeric_limits<Type>::max())
, _step(std::numeric_limits<Type>::min())
, _maxSteps(steps)
{ {
setupSteps(steps);
} }
Type Progress::get() const Type Progress::get() const