Remove an unequipped weapon from its weapon groups (Cut 10 fix)
TryUnequip removed a weapon from _weapons but left it in WeaponGroups, so an unequipped weapon could still be fired from its action-bar group and EntitySerializer.Pack wrote -1 for it. The removal mirrors the group toggle in WeaponGroupAssignment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
45f2a97862
commit
890063b8bb
1 changed files with 3 additions and 0 deletions
|
|
@ -504,7 +504,10 @@ public abstract class Entity
|
|||
foreach (var b in item.Behaviors)
|
||||
{
|
||||
if (b is Weapon weapon)
|
||||
{
|
||||
_weapons.Remove(weapon);
|
||||
foreach (var group in WeaponGroups) { group.items.Remove(item); group.weapons.Remove(weapon); }
|
||||
}
|
||||
if (b is Capacitor capacitor)
|
||||
_capacitors.Remove(capacitor);
|
||||
if (b is Reactor reactor)
|
||||
|
|
|
|||
Loading…
Reference in a new issue