Merge pull request #12293 from abcdefg30/swallowNull

Fix null being passed through the INotifyAttack interface
This commit is contained in:
Paul Chote
2017-01-29 16:32:35 +00:00
committed by GitHub
4 changed files with 20 additions and 12 deletions

View File

@@ -156,7 +156,10 @@ namespace OpenRA.Mods.Common.Traits
paxPos[a.Actor].SetVisualPosition(a.Actor, pos + PortOffset(self, port));
var barrel = a.CheckFire(a.Actor, facing.Value, target);
if (barrel != null && a.Info.MuzzleSequence != null)
if (barrel == null)
return;
if (a.Info.MuzzleSequence != null)
{
// Muzzle facing is fixed once the firing starts
var muzzleAnim = new Animation(self.World, paxRender[a.Actor].GetImage(a.Actor), () => muzzleFacing);