Fix ship-owners when control is given

This commit is contained in:
Enno Rehling 2012-05-17 10:31:58 -07:00
parent 9cbdaea27f
commit 43f5770694
2 changed files with 4 additions and 0 deletions

View File

@ -638,6 +638,9 @@ static void give_control(unit * u, unit * u2)
} }
} }
} }
if (u->ship) {
u->ship->owner = u2;
}
freset(u, UFL_OWNER); freset(u, UFL_OWNER);
fset(u2, UFL_OWNER); fset(u2, UFL_OWNER);
} }

View File

@ -812,6 +812,7 @@ void leave_ship(unit * u)
fset(owner, UFL_OWNER); fset(owner, UFL_OWNER);
} }
} }
assert(sh->owner!=u);
} }
void leave_building(unit * u) void leave_building(unit * u)