3 protected float m_SmokePosX;
4 protected float m_SmokePosY;
5 protected float m_SmokePosZ;
8 static const string OVENPOINT_ACTION_SELECTION =
"oven_action";
9 static const string OVENPOINT_FIRE_POSITION =
"oven_point";
10 static const string OVENPOINT_PLACE_ROT =
"oven_rot";
11 static const string OVENPOINT_SMOKE_POSITION =
"oven_smoke";
25 RegisterNetSyncVariableFloat(
"m_SmokePosX", 0, 0, 2 );
26 RegisterNetSyncVariableFloat(
"m_SmokePosY", 0, 0, 2 );
27 RegisterNetSyncVariableFloat(
"m_SmokePosZ", 0, 0, 2 );
28 RegisterNetSyncVariableInt(
"m_FirePointIndex", 0, 9 );
39 super.OnStoreSave( ctx );
45 ctx.Write( m_SmokePosX );
46 ctx.Write( m_SmokePosY );
47 ctx.Write( m_SmokePosZ );
52 if ( !super.OnStoreLoad( ctx, version ) )
64 if ( !ctx.Read( m_SmokePosX ) )
69 if ( !ctx.Read( m_SmokePosY ) )
74 if ( !ctx.Read( m_SmokePosZ ) )
88 static int GetFirePointIndex(
string action_selection )
90 int index_location = action_selection.Length() - 1;
91 return action_selection.Substring( index_location, 1 ).ToInt();
94 void SetFirePointIndex(
int fire_point_index )
99 static bool CanPlaceFireplaceInSelectedSpot(
Object building,
int fire_point_index, out
vector fire_point_pos_world, out
vector fire_point_rot_world )
102 vector fire_point_pos = building.GetSelectionPositionMS( OVENPOINT_FIRE_POSITION + fire_point_index.ToString() );
103 vector fire_point_rot = building.GetSelectionPositionMS( OVENPOINT_PLACE_ROT + fire_point_index.ToString() );
104 fire_point_pos_world = building.ModelToWorld( fire_point_pos );
105 fire_point_rot_world = building.ModelToWorld( fire_point_rot );
110 GetGame().GetObjectsAtPosition3D( fire_point_pos_world, 1, nearest_objects, proxy_cargos );
112 for (
int i = 0; i < nearest_objects.Count(); ++i )
114 Object object = nearest_objects.Get( i );
116 if (
object.IsInherited( OvenIndoor ) )
125 void SetSmokePointPosition(
vector smoke_point_pos )
127 m_SmokePosX = smoke_point_pos[0];
128 m_SmokePosY = smoke_point_pos[1];
129 m_SmokePosZ = smoke_point_pos[2];
137 return Vector( m_SmokePosX, m_SmokePosY, m_SmokePosZ );
162 if (!super.CanReleaseAttachment(attachment))
178 super.EEItemAttached(item, slot_name);
188 bool edible_base_attached =
false;
191 case "DirectCookingA":
193 edible_base_attached =
true;
197 edible_base_attached =
true;
201 edible_base_attached =
true;
206 if (
GetGame().IsServer() && edible_base_attached)
211 if ( edBase.GetFoodStage())
213 edBase.SetCookingTime(0);
223 super.EEItemDetached(item, slot_name);
237 case "DirectCookingA":
254 cooking_pot.RemoveAudioVisualsOnClient();
260 cauldron.RemoveAudioVisualsOnClient();
265 FryingPan frying_pan = FryingPan.Cast(item);
266 frying_pan.RemoveAudioVisualsOnClient();
313 override bool CanIgniteItem(
EntityAI ignite_target = NULL )
323 override bool IsIgnited()
328 override void OnIgnitedTarget(
EntityAI ignited_item )
338 override bool IsThisIgnitionSuccessful(
EntityAI item_source = NULL )