From 37fdcbae655c48e569398d3750d503ffe3bfae66 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 2 Nov 2013 20:25:51 -0200 Subject: Fixed Bug #7786 @speed no longer screws up on map change, modified @speed feedback so its clear whether the permanent speed flag is gone, enhanced @speed by making it capable of bypassing battle_config.max_walk_speed, made status_calc_speed rely on MIN_WALK_SPEED instead of the hardcoded 0, modified MIN_WALK_SPEED from 0 to 20 (it 1) wasnt being respected and 2) less than 20 clips). @speed is now capable of moving the character faster, prior to this commit @speed 0 was equivalent to @speed 50 of this new version, @speed 20 for example is now the new maximum (and moves much faster). http://hercules.ws/board/tracker/issue-7786-speed-bug-when-changing-maps/ Thanks to Mumbles for all the info Signed-off-by: shennetsind --- src/map/atcommand.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 146159c63..758ebb0db 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -766,15 +766,21 @@ ACMD(speed) return false; } - if (speed < 0) { + sd->state.permanent_speed = 0; + + if (speed < 0) sd->base_status.speed = DEFAULT_WALK_SPEED; - sd->state.permanent_speed = 0; // Remove lock when set back to default speed. - } else { + else sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); - sd->state.permanent_speed = 1; // Set lock when set to non-default speed. - } + status_calc_bl(&sd->bl, SCB_SPEED); - clif->message(fd, msg_txt(8)); // Speed changed. + + if( sd->base_status.speed != DEFAULT_WALK_SPEED ) { + sd->state.permanent_speed = 1; // Set lock when set to non-default speed. + clif->message(fd, msg_txt(8)); // Speed changed. + } else + clif->message(fd, msg_txt(172)); //Speed returned to normal. + return true; } -- cgit v1.2.3-60-g2f50