Use pattern matching
This commit is contained in:
committed by
atlimit8
parent
aed2b8afae
commit
2677e9c013
@@ -309,8 +309,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
foreach (var actor in self.World.ActorMap.GetActorsAt(cell))
|
||||
{
|
||||
var move = actor.OccupiesSpace as Mobile;
|
||||
if (move == null || !move.IsTraitEnabled() || !move.IsLeaving())
|
||||
if (!(actor.OccupiesSpace is Mobile move) || !move.IsTraitEnabled() || !move.IsLeaving())
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user