mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix: Correct control group iteration in ResolveFoundationCollisions
In `CCmpObstruction::ResolveFoundationCollisions`, the nested loop
intended to assign a persistent control group to colliding normal
entities was incorrectly iterating over `normalEnts` instead of
`persistentEnts`.
This caused the function to attempt to clobber default control groups
with other non-persistent groups, completely bypassing the intended
`ControlPersist` logic.
This patch fixes the inner loop to correctly iterate over
`persistentEnts`, ensuring foundations properly inherit persistent
control groups.
Fixes: 9ae084519f
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -819,7 +819,7 @@ public:
|
||||
for (const entity_id_t normalEnt : normalEnts)
|
||||
{
|
||||
CmpPtr<ICmpObstruction> cmpObstruction(GetSimContext(), normalEnt);
|
||||
for (const entity_id_t persistent : normalEnts)
|
||||
for (const entity_id_t persistent : persistentEnts)
|
||||
{
|
||||
entity_id_t group = cmpObstruction->GetControlGroup();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user