--- deliantra/server/common/living.C 2007/08/07 22:36:18 1.75 +++ deliantra/server/common/living.C 2007/08/07 23:38:12 1.77 @@ -916,8 +916,7 @@ continue; for (int i = 0; i < NUM_STATS; i++) - if (expect_false (tmp->stats.stat (i))) - stat_sum [i] = clamp (stat_sum [i] + tmp->stats.stat (i), MIN_STAT, MAX_STAT); + stat_sum [i] = stat_sum [i] + tmp->stats.stat (i); if (digest_types [tmp->type]) { @@ -940,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.) @@ -1364,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) @@ -1412,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. */