DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CanPlaceFireplaceInSelectedSpot()

static bool FireplaceIndoor::CanPlaceFireplaceInSelectedSpot ( Object building,
int fire_point_index,
out vector fire_point_pos_world,
out vector fire_point_rot_world )
inlinestaticprotected

См. определение в файле FireplaceIndoor.c строка 104

105 {
106 //Get fire point index position
107 vector fire_point_pos = building.GetSelectionPositionMS( FIREPOINT_FIRE_POSITION + fire_point_index.ToString() );
108 vector fire_point_rot = building.GetSelectionPositionMS( FIREPOINT_PLACE_ROT + fire_point_index.ToString() );
109 fire_point_pos_world = building.ModelToWorld( fire_point_pos );
110 fire_point_rot_world = building.ModelToWorld( fire_point_rot );
111
112 //check if there is any FireplaceIndoor objects near selected fire point
113 ref array<Object> nearest_objects = new array<Object>;
114 ref array<CargoBase> proxy_cargos = new array<CargoBase>;
115 GetGame().GetObjectsAtPosition3D( fire_point_pos_world, 0.25, nearest_objects, proxy_cargos );
116
117 for ( int i = 0; i < nearest_objects.Count(); ++i )
118 {
119 Object object = nearest_objects.Get( i );
120
121 if ( object.IsInherited( FireplaceIndoor ) )
122 {
123 return false;
124 }
125 }
126
127 return true;
128 }
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".
static const string FIREPOINT_PLACE_ROT
Определения FireplaceIndoor.c:10
static const string FIREPOINT_FIRE_POSITION
Определения FireplaceIndoor.c:9
void FireplaceIndoor()
Определения FireplaceIndoor.c:13
class LOD Object
proto native CGame GetGame()

Перекрестные ссылки FireplaceIndoor(), FIREPOINT_FIRE_POSITION, FIREPOINT_PLACE_ROT, GetGame() и CGame::GetObjectsAtPosition3D().

Используется в ActionCreateIndoorFireplace::ActionCondition() и ActionPlaceFireplaceIndoor::ActionCondition().