Use Null-Propagation Operator

This commit is contained in:
teinarss
2020-08-16 11:38:14 +02:00
committed by Paul Chote
parent 8d27d22100
commit 9c4fd0e3d3
113 changed files with 219 additions and 464 deletions

View File

@@ -105,14 +105,11 @@ namespace OpenRA.Mods.Common.Traits.Render
{
Reverse(self, () =>
{
var wsb = wsbs.FirstEnabledTraitOrDefault();
// HACK: The actor remains alive and active for one tick before the followup activity
// (sell/transform/etc) runs. This causes visual glitches that we attempt to minimize
// by forcing the animation to frame 0 and regranting the make condition.
// These workarounds will break the actor if the followup activity doesn't dispose it!
if (wsb != null)
wsb.DefaultAnimation.PlayFetchIndex(info.Sequence, () => 0);
wsbs.FirstEnabledTraitOrDefault()?.DefaultAnimation.PlayFetchIndex(info.Sequence, () => 0);
token = self.GrantCondition(info.Condition);