Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
No longer check Carryable IsInWorld when Carryall is killed. #15030
This PR concerns issue #14336, it seems the Carryable in a Carryall is always going to have IsInWorld == false since it's removed from the world when it's loaded, so Kill isn't called on the Carryable when the Carryall dies.
I have removed checking IsInWorld when the Carryall dies (I'm fairly confident this is the correct thing to do, as a Cargo doesn't perform this check when it dies and will call Kill on its passengers) and you can now build a Mammoth Mk II again if it's destroyed in a CarryAll.
I assume this would have also been affecting other things that are notified on kill such as exp gain and scores at the end of the game.
P.S. I'm new here (OpenRA, Github, and C#) so any advice/criticism is welcome!
Following the example in INotifyKilled.Killed in the Cargo class I've added the logic to ensure the position of the Carryable reflects that of the Carryall when it dies.
Checked the original fix is still working and the debris of the Carryable now flies off from the correct location when the Carryall is killed.