Fix: Changing group parent did not properly update partially-default liveries.

wip-string
Peter Nelson 5 months ago committed by Peter Nelson
parent bfb4254226
commit 5d2ed80c95

@ -466,10 +466,11 @@ CommandCost CmdAlterGroup(DoCommandFlag flags, AlterGroupMode mode, GroupID grou
g->parent = (pg == nullptr) ? INVALID_GROUP : pg->index;
GroupStatistics::UpdateAutoreplace(g->owner);
if (g->livery.in_use == 0) {
if (!HasBit(g->livery.in_use, 0) || !HasBit(g->livery.in_use, 1)) {
/* Update livery with new parent's colours if either colour is default. */
const Livery *livery = GetParentLivery(g);
g->livery.colour1 = livery->colour1;
g->livery.colour2 = livery->colour2;
if (!HasBit(g->livery.in_use, 0)) g->livery.colour1 = livery->colour1;
if (!HasBit(g->livery.in_use, 1)) g->livery.colour2 = livery->colour2;
PropagateChildLivery(g, true);
MarkWholeScreenDirty();

Loading…
Cancel
Save