From 3a0618b1501bcba21cc1b248624abe6c1b2d35dc Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 10 Mar 2016 11:56:38 +0000 Subject: [PATCH] Rope cutting bug fix. --- src/battle/rope.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/battle/rope.c b/src/battle/rope.c index 8bb5c65..e4a236f 100644 --- a/src/battle/rope.c +++ b/src/battle/rope.c @@ -96,13 +96,18 @@ void drawRope(Entity *e) void cutRope(Entity *e) { + /* thing being towed is dead */ 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; + } + + /* tug is dead - reset thing being tugged */ + if (e->towing) + { + e->towing->flags &= ~EF_RETREATING; + e->towing->flags &= ~EF_ROPED_ATTACHED; + e->towing = NULL; } }