Changeset - r28346:2c6059d740b4
[Not reviewed]
master
0 1 0
Peter Nelson - 11 months ago 2023-12-27 20:25:38
peter1138@openttd.org
Fix: Changing group parent did not properly update partially-default liveries.
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/group_cmd.cpp
Show inline comments
 
@@ -466,10 +466,11 @@ CommandCost CmdAlterGroup(DoCommandFlag 
 
			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();
0 comments (0 inline, 0 general)