444 {
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
469 }
470 }
471 }
PluginBase GetPlugin(typename plugin_type)
override ScriptCallQueue GetCallQueue(int call_category)
int GetSlotIndexBySelection(string selection_component)
static const float CREATE_PLANT_DELAY
ref array< ref Slot > m_Slots
void CreatePlant(Slot slot)
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto native CGame GetGame()