--- deliantra/server/common/living.C 2007/08/07 22:57:57 1.76 +++ deliantra/server/common/living.C 2007/08/07 23:38:12 1.77 @@ -939,12 +939,8 @@ slot[i].used += tmp->slot[i].info; if (tmp->type == SYMPTOM) - { - speed_reduce_from_disease = tmp->last_sp / 100.f; - - if (speed_reduce_from_disease == 0) - speed_reduce_from_disease = 1; - } + speed_reduce_from_disease = + min (speed_reduce_from_disease, tmp->last_sp ? tmp->last_sp / 100.f : 1.f); /* Pos. and neg. protections are counted seperate (-> pro/vuln). * (Negative protections are calculated exactly like positive.) @@ -1363,14 +1359,17 @@ speed += bonus_speed / 10.f; /* Not affected by limits */ + speed = speed * speed_reduce_from_disease; + /* Put a lower limit on speed. Note with this speed, you move once every * 100 ticks or so. This amounts to once every 12 seconds of realtime. */ - speed = speed * speed_reduce_from_disease; - if (speed < 0.01f && type == PLAYER) speed = 0.01f; + if (speed != old_speed) + set_speed (speed); + if (type == PLAYER) { /* (This formula was made by vidarl@ifi.uio.no) @@ -1411,9 +1410,6 @@ else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) move_type &= ~MOVE_WALK; - if (speed != old_speed) - set_speed (speed); - /* It is quite possible that a player's spell costing might have changed, * so we will check that now. */