From 7789d3ab64291108c4e42fae9b78e9e91818cef3 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 9 Mar 2016 23:22:32 +0000 Subject: [PATCH] Remove rope flags when rope is detached. --- src/battle/rope.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/battle/rope.c b/src/battle/rope.c index d43dc47..8bb5c65 100644 --- a/src/battle/rope.c +++ b/src/battle/rope.c @@ -31,7 +31,7 @@ void attachRope(void) for (i = 0, e = candidates[i] ; e != NULL ; e = candidates[++i]) { - if ((e->flags & EF_DISABLED) && e->alive == ALIVE_ALIVE) + if ((e->flags & EF_DISABLED) && (e->flags & EF_ROPED_ATTACHED) == 0 && e->alive == ALIVE_ALIVE) { distance = getDistance(e->x, e->y, self->x, self->y); @@ -43,6 +43,7 @@ void attachRope(void) self->aiFlags |= AIF_GOAL_JUMPGATE; e->flags |= EF_RETREATING; + e->flags |= EF_ROPED_ATTACHED; runScriptFunction("TOWING %s", e->name); @@ -97,6 +98,9 @@ void cutRope(Entity *e) { if (e->owner && e->owner->towing == e) { + e->flags &= ~EF_RETREATING; + e->flags &= ~EF_ROPED_ATTACHED; + e->owner->towing = NULL; e->owner->aiFlags &= ~AIF_GOAL_JUMPGATE; e->owner = NULL;