3 override void CreateActionComponent()
23 m_Text =
"#unmount_barbed_wire";
26 override void CreateConditionComponents()
34 Object targetObject = target.GetObject();
36 if ( targetObject && targetObject.CanUseConstruction() )
39 if (!base_building.IsPlayerInside(player,
""))
42 string selection = targetObject.GetActionComponentName( target.GetComponentIndex() );
44 if ( selection.Length() > 0 )
46 int delimiter_index = selection.IndexOfFrom( 0,
"_mounted" );
47 if ( delimiter_index > -1 )
49 selection = selection.Substring( 0, delimiter_index );
51 BarbedWire barbed_wire = BarbedWire.Cast( base_building.FindAttachmentBySlotName( selection ) );
52 if ( barbed_wire && barbed_wire.IsMounted() )
54 m_SlotName = selection;
65 override void OnFinishProgressServer(
ActionData action_data )
68 BarbedWire barbed_wire = BarbedWire.Cast( base_building.FindAttachmentBySlotName( m_SlotName ) );
71 barbed_wire.SetMountedState(
false );
76 override string GetAdminLogMessage(
ActionData action_data )
78 string message =
string.Format(
"Player %1 Unmounted BarbedWire from %2", action_data.m_Player, action_data.m_Target.GetObject().ClassName() );