Split Locomotor trait from Mobile
Add GrantConditionOn*Layer traits This allows to - drop some booleans from Locomotor - drop a good part of the subterranean- and jumpjet-specific code/hacks from Mobile - grant more than 1 condition per layer type (via multiple traits) - easily add more traits of this kind for other layers
This commit is contained in:
@@ -161,12 +161,13 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
{
|
||||
var mobiles = cargo != null ? cargo.Passengers.Select(a =>
|
||||
{
|
||||
var mobileInfo = a.Info.TraitInfoOrDefault<MobileInfo>();
|
||||
if (mobileInfo == null)
|
||||
return new Pair<MobileInfo, uint>(null, 0);
|
||||
var mobile = a.TraitOrDefault<Mobile>();
|
||||
if (mobile == null)
|
||||
return new Pair<LocomotorInfo, uint>(null, 0);
|
||||
|
||||
return new Pair<MobileInfo, uint>(mobileInfo, (uint)mobileInfo.GetMovementClass(a.World.Map.Rules.TileSet));
|
||||
}) : new Pair<MobileInfo, uint>[0];
|
||||
var locomotorInfo = mobile.Info.LocomotorInfo;
|
||||
return new Pair<LocomotorInfo, uint>(locomotorInfo, (uint)locomotorInfo.GetMovementClass(a.World.Map.Rules.TileSet));
|
||||
}) : new Pair<LocomotorInfo, uint>[0];
|
||||
|
||||
foreach (var c in transport.World.Map.FindTilesInCircle(destination, dropRange))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user