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

◆ ActionCondition()

override bool ActionRemoveSeed::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

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

22 {
23 if ( player.GetCommand_Vehicle() )
24 return false;
25
26 GardenBase garden_base;
27 if ( Class.CastTo( garden_base, target.GetObject() ) )
28 {
29 Slot slot;
30
31 array<string> selections = new array<string>;
32 garden_base.GetActionComponentNameList( target.GetComponentIndex(), selections );
33 string selection;
34
35 for (int s = 0; s < selections.Count(); s++)
36 {
37 selection = selections[s];
38 slot = garden_base.GetSlotBySelection( selection );
39 if ( slot )
40 break;
41 }
42
43 //Can only remove seed if slot is not watered to prevent VME
44 if ( slot && slot.GetSeed() )
45 {
46 if ( slot.GetWateredState() != eWateredState.DRY)
47 return false;
48
49 m_Seed = SeedBase.Cast( slot.GetSeed() );
50
51 if ( m_Seed )
52 {
53 if ( player.GetInventory().CanAddEntityIntoInventory( m_Seed ) && m_Seed.GetHierarchyRootPlayer() != player )
54 return true;
55 else
56 return player.GetInventory().CanAddEntityIntoHands( m_Seed );
57 }
58 }
59 }
60 return false;
61 }
SeedBase m_Seed
Определения ActionRemoveSeed.c:3

Перекрестные ссылки ActionTarget, Class::CastTo() и m_Seed.