From 07ee157e2a4069b0afa4df79532303cb7b8d1e3a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 10 Feb 2004 10:49:21 +0000 Subject: [PATCH] (move_ground): explore() used endsect without initialized in certain cases, e.g. `expl X,Y N X,Y'. Other callers might have had similar problems. Fix: always assign to *END. Thanks to Marc Olzheim for help with debugging and fixing this. --- src/lib/subs/move.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/subs/move.c b/src/lib/subs/move.c index e435d03b4..d20175e74 100644 --- a/src/lib/subs/move.c +++ b/src/lib/subs/move.c @@ -76,6 +76,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end, s_char prompt[128]; s_char buf[1024]; + *end = *start; if (mobility <= 0.0) return -1; *dam = 0; @@ -101,7 +102,6 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end, } if ((total_mcost * weight) > mobility) { pr("Not enough mobility to go all the way. Nothing moved.\n"); - *end = *start; return -1; } } -- 2.43.0