11 override void CreateConditionComponents()
19 if ( !target )
return false;
21 Object target_object = target.GetObject();
22 string action_selection = target_object.GetActionComponentName( target.GetComponentIndex() );
25 if ( target_object && building && action_selection.Contains( FireplaceIndoor.FIREPOINT_ACTION_SELECTION ) )
29 vector fire_point_pos_world, fire_point_rot_world;
30 int fire_point_index = FireplaceIndoor.GetFirePointIndex( action_selection );
31 if ( FireplaceIndoor.CanPlaceFireplaceInSelectedSpot( building, fire_point_index, fire_point_pos_world, fire_point_rot_world ) )
34 if ( building.HasSelection( FireplaceIndoor.FIREPOINT_PLACE_ROT + fire_point_index.ToString() ) )
36 vector diff = fire_point_rot_world - fire_point_pos_world;
39 float dotp =
vector.Dot(
"0 0 1" , diff );
40 rot_deg =
Math.Acos( dotp ) *
Math.RAD2DEG;
41 if ( ( diff[0] < 0 ) && ( diff[2] < 0 ) )
42 rot_deg = 360.0 - rot_deg;
43 else if ( ( diff[0] < 0 ) && ( diff[2] > 0 ) )
44 rot_deg = 360.0 - rot_deg;
49 float fire_point_dist =
vector.Distance( fire_point_pos_world, player.GetPosition() );
50 if ( fire_point_dist <= 2 )
52 player.SetLastFirePoint( fire_point_pos_world );
53 player.SetLastFirePointIndex( fire_point_index );
54 player.SetLastFirePointRot( rot_deg );
63 override void OnExecuteServer(
ActionData action_data )
69 lambda.SetTransferParams(
true,
true,
true );
70 action_data.m_Player.ServerReplaceItemInHandsWithNewElsewhere( lambda );
88 Math3D.MatrixIdentity4( mtx );
90 gnd.SetGround( NULL, mtx );
91 OverrideNewLocation( gnd );
97 vector smoke_point_pos = target.GetSelectionPositionMS( FireplaceIndoor.FIREPOINT_SMOKE_POSITION +
m_FirePointIndex.ToString() );
98 vector smoke_point_pos_world = target.ModelToWorld( smoke_point_pos );
104 super.CopyOldPropertiesToNew( old_item, new_item );
106 FireplaceIndoor fireplace_indoor = FireplaceIndoor.Cast( new_item );
107 if ( fireplace_indoor )
117 fireplace_indoor.SetOrientation( fprot );
120 fireplace_indoor.Synchronize();