19 {
20 if (!target)
21 return false;
22
24 return false;
25
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 if (!building.DoorsDirectionalCheck(player,target.GetComponentIndex()))
36 return false;
37
38 return building.CanDoorBeClosed(doorIndex);
39 }
40 }
41
42 return false;
43 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
bool IsBuilding(ActionTarget target)