summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d9c01b0fb..777d777a2 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -850,7 +850,13 @@ ACMD_FUNC(speed)
return -1;
}
- sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
+ if (speed < 0) {
+ sd->base_status.speed = DEFAULT_WALK_SPEED;
+ sd->state.permanent_speed = 0; // Remove lock when set back to default speed.
+ } 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.
return 0;