Use pattern matching
This commit is contained in:
committed by
atlimit8
parent
aed2b8afae
commit
2677e9c013
@@ -155,8 +155,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return false;
|
||||
|
||||
// PERF: Mobile implements IPositionable, so we can use 'as' to save a trait look-up here.
|
||||
var mobile = positionable as Mobile;
|
||||
if (mobile != null && !mobile.CanInteractWithGroundLayer(self))
|
||||
if (positionable is Mobile mobile && !mobile.CanInteractWithGroundLayer(self))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user