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

◆ PlantSeed()

void ItemBase::PlantSeed ( ItemBase seed,
string selection_component )
inlineprivate

Adjust slot water

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

444 {
445 int slot_index = GetSlotIndexBySelection( selection_component );
446
447 if ( slot_index != -1 )
448 {
449 PluginHorticulture module_horticulture = PluginHorticulture.Cast( GetPlugin( PluginHorticulture ) );
450 string plant_type = module_horticulture.GetPlantType( seed );
451
452 Slot slot = m_Slots.Get( slot_index );
453 slot.SetState(eGardenSlotState.STATE_PLANTED);
454 slot.m_PlantType = plant_type;
455 slot.SetSeed(seed);
456
457 if ( !slot.NeedsWater() || slot.GetWateredState() == eWateredState.WET)
458 {
460 if (slot.GetWateredState() == eWateredState.WET && slot.NeedsWater())
461 {
462 int waterMax = slot.GetWaterMax();
463 slot.SetWater(waterMax);
464 }
465
466 seed.LockToParent();
467 //Take some small amount of time before making a plant out of seeds
468 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(CreatePlant, CREATE_PLANT_DELAY, false, slot);
469 }
470 }
471 }
DayZGame g_Game
Определения DayZGame.c:3942
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:325
int GetSlotIndexBySelection(string selection_component)
Определения GardenBase.c:720
static const float CREATE_PLANT_DELAY
Определения GardenBase.c:23
ref array< ref Slot > m_Slots
Определения GardenBase.c:26
void CreatePlant(Slot slot)
Определения GardenBase.c:474
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8

Перекрестные ссылки CALL_CATEGORY_SYSTEM, CREATE_PLANT_DELAY, CreatePlant(), g_Game, GetPlugin(), GetSlotIndexBySelection() и m_Slots.

Используется в EEItemAttached().