fixed crash using too small list shifttimes

This commit is contained in:
louis 2016-07-30 09:07:34 +02:00
parent b8d055f568
commit dddb273526
1 changed files with 2 additions and 0 deletions

View File

@ -305,6 +305,7 @@ void cShifter::Init(void) {
mode = (eShiftMode)shiftable->ShiftMode();
shiftable->ShiftPositions(&start, &end);
int steps = (double)shifttime / (double)frametime;
if (steps <= 0) steps = 1;
float percentFast = 33.3f;
float distanceFast = 85.0f;
stepsFast = (float)steps * percentFast / 100.0f;
@ -400,6 +401,7 @@ cListShifter::cListShifter(cListShiftable *shiftable) {
distance = shiftable->ShiftDistance();
orientation = shiftable->ShiftOrientation();
int steps = (double)shifttime / (double)frametime;
if (steps <= 0) steps = 1;
step = distance / steps;
shiftin = true;
fromtop = true;