31 {
32 if ( !target )
33 return false;
34
35 if ( player.IsPlacingLocal() )
36 return false;
37
38 if (!CfgGameplayHandler.GetDisableColdAreaPlacementCheck() && player.GetInColdArea())
39 return false;
40
41 Object target_object = target.GetObject();
42
45
46 if ( target_object && ( greenHouse || polytunnel ) )
47 {
48 string action_selection = target_object.GetActionComponentName( target.GetComponentIndex() );
49
50 if ( action_selection != "soil" )
51 return false;
52
53
54 ref array<Object> nearest_objects = new array<Object>;
55 ref array<CargoBase> proxy_cargos = new array<CargoBase>;
56 vector pos = target_object.GetPosition();
57 pos[1] = pos[1] - 1;
59
60 for ( int i = 0; i < nearest_objects.Count(); ++i )
61 {
62 Object object = nearest_objects.Get( i );
63
64 if ( object.IsInherited( GardenPlot ) )
65 {
66 return false;
67 }
68 }
69
70 return true;
71 }
72
73 return false;
74 }
class Land_Misc_Greenhouse extends BuildingSuper Land_Misc_Polytunnel()
void Land_Misc_Greenhouse()
proto native void GetObjectsAtPosition3D(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in sphere "radius" around position "pos".
proto native CGame GetGame()