19 {
20 if (!target)
21 return false;
22
24 return false;
25
26 Building building;
27 if (Class.CastTo(building, target.GetObject()))
28 {
29 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
30 if (doorIndex != -1)
31 {
32 if (!
IsInReach(player, target, UAMaxDistances.DEFAULT))
33 return false;
34
35 return building.CanDoorBeClosed(doorIndex);
36 }
37 }
38
39 return false;
40 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
bool IsBuilding(ActionTarget target)