Fix null being passed through the INotifyAttack interface

This commit is contained in:
abcdefg30
2016-10-23 22:07:03 +02:00
parent 892825aeb9
commit 19549a9068
3 changed files with 17 additions and 8 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);