mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
Fix: Changing group parent did not properly update partially-default liveries.
This commit is contained in:
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…
Reference in New Issue
Block a user