Remove rope flags when rope is detached.

This commit is contained in:
Steve 2016-03-09 23:22:32 +00:00
parent c9bde77bca
commit 7789d3ab64
1 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,7 @@ void attachRope(void)
for (i = 0, e = candidates[i] ; e != NULL ; e = candidates[++i]) 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); distance = getDistance(e->x, e->y, self->x, self->y);
@ -43,6 +43,7 @@ void attachRope(void)
self->aiFlags |= AIF_GOAL_JUMPGATE; self->aiFlags |= AIF_GOAL_JUMPGATE;
e->flags |= EF_RETREATING; e->flags |= EF_RETREATING;
e->flags |= EF_ROPED_ATTACHED;
runScriptFunction("TOWING %s", e->name); runScriptFunction("TOWING %s", e->name);
@ -97,6 +98,9 @@ void cutRope(Entity *e)
{ {
if (e->owner && e->owner->towing == e) if (e->owner && e->owner->towing == e)
{ {
e->flags &= ~EF_RETREATING;
e->flags &= ~EF_ROPED_ATTACHED;
e->owner->towing = NULL; e->owner->towing = NULL;
e->owner->aiFlags &= ~AIF_GOAL_JUMPGATE; e->owner->aiFlags &= ~AIF_GOAL_JUMPGATE;
e->owner = NULL; e->owner = NULL;