38 {
40 if (Class.CastTo(targetIB, target.GetObject()) && targetIB.CanBeDigged())
41 {
42 if (player.IsPlacingLocal())
43 {
44 return false;
45 }
46
47 if (targetIB.IsRuined() || targetIB.GetInventory().IsAttachment())
48 {
49 return false;
50 }
51
52 if (targetIB.GetInventory().IsAttachment())
53 {
54 return false;
55 }
56
57 if (targetIB.IsInherited(UndergroundStash))
58 {
59 return false;
60 }
61
64 if (targetIB.GetInventory().IsInCargo())
65 entityToCheck = player;
66
67
68 array<Object> excludedObjects = new array<Object>();
69 excludedObjects.Insert(targetIB);
70 array<Object> nearbyObjects = new array<Object>();
71
72 if (
GetGame().IsBoxColliding(entityToCheck.GetPosition(), entityToCheck.GetOrientation(),
"2 2 2", excludedObjects, nearbyObjects))
73 {
74 foreach (
Object nearbyObject : nearbyObjects)
75 {
76 if (nearbyObject.IsInherited(UndergroundStash))
77 return false;
78 }
79 }
80
81
82 int liquidType;
83 string surfaceType;
85 if (!
GetGame().IsSurfaceDigable(surfaceType))
86 {
87 return false;
88 }
89 else
90 {
92 vector position = entityToCheck.GetPosition();
93
94 array<vector> positions = new array<vector>;
95 positions.Insert(position + "0.5 0 0.5");
96 positions.Insert(position + "-0.5 0 0.5");
97 positions.Insert(position + "0.5 0 -0.5");
98 positions.Insert(position + "-0.5 0 -0.5");
99
101
103 }
104 }
105
106 return false;
107 }
class GP5GasMask extends MaskBase ItemBase
static float m_DigStashSlopeTolerance
float GetHighestSurfaceYDifference(array< vector > positions)
Returns the largest height difference between the given positions.
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
proto native CGame GetGame()