(067f4d694) The recursive version of GetConnectedComponents can traverse between wifi components, use recursive GetConnectedComponents when finding the controller used to operate some item (-> AI characters can now figure out how to operate a turret that's connected to a periscope through wifi components, relays, etc)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
@@ -74,9 +75,9 @@ namespace Barotrauma.Items.Components
|
||||
return HasRequiredContainedItems(true);
|
||||
}
|
||||
|
||||
private List<WifiComponent> GetReceiversInRange()
|
||||
public IEnumerable<WifiComponent> GetReceiversInRange()
|
||||
{
|
||||
return list.FindAll(w => w != this && w.CanReceive(this));
|
||||
return list.Where(w => w != this && w.CanReceive(this));
|
||||
}
|
||||
|
||||
public bool CanReceive(WifiComponent sender)
|
||||
|
||||
Reference in New Issue
Block a user