--- deliantra/server/common/living.C 2007/08/07 22:57:57 1.76 +++ deliantra/server/common/living.C 2007/11/08 01:14:12 1.79 @@ -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.) @@ -1356,20 +1352,22 @@ * weight limit, then player suffers a speed reduction based on how * much above he is, and what is max carry is */ - f = (carrying / 1000) - max_carry[stats.Str]; - if (f > 0) + float f = (carrying / 1000) - max_carry[stats.Str]; + if (f > 0.f) speed = speed / (1.f + f / max_carry[stats.Str]); } speed += bonus_speed / 10.f; /* Not affected by limits */ + 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. + * 25 ticks or so. This amounts to once every 3 seconds of realtime. */ - speed = speed * speed_reduce_from_disease; + if (speed < 0.04f && type == PLAYER) + speed = 0.04f; - if (speed < 0.01f && type == PLAYER) - speed = 0.01f; + if (speed != old_speed) + set_speed (speed); if (type == PLAYER) { @@ -1411,9 +1409,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. */ @@ -1486,7 +1481,7 @@ level = (int) (level / 5.); /* now set the new title */ - if (pl->contr != NULL) + if (pl->contr) { if (level == 0) sprintf (pl->contr->title, "%s hatchling", attacks[atnr]);