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

◆ OnAttachmentRuined()

override void OnAttachmentRuined ( EntityAI attachment)
protected

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

372 {
373 switch (attachment.Type())
374 {
377 int slot = InventorySlots.GetSlotIdFromString("CookingEquipment");
378 EntityAI ent = GetInventory().FindAttachment(slot);
379 if (ent && ent.IsCookware())
380 {
381 vector direction = ent.GetDirection();
382 float dot = vector.Dot(direction, vector.Forward);
383
384 float angle = Math.Acos(dot);
385 if (direction[0] < 0)
386 {
387 angle = -angle;
388 }
389
390 float cos = Math.Cos(angle);
391 float sin = Math.Sin(angle);
392 GetInventory().DropEntityInBounds(InventoryMode.SERVER, this, ent, "2 0 2", angle, cos, sin);
393 }
394
395 attachment.Delete();
396 break;
397 }
398 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
ATTACHMENT_TRIPOD
Определения FireplaceBase.c:197
ATTACHMENT_COOKINGSTAND
Определения FireplaceBase.c:198
Определения Building.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
Определения InventorySlots.c:6
Определения EnMath.c:7
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:271
static const vector Forward
Определения EnConvert.c:109
Определения EnConvert.c:106
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Sin(float angle)
Returns sinus of angle in radians.

Перекрестные ссылки Math::Acos(), ATTACHMENT_COOKINGSTAND, ATTACHMENT_TRIPOD, Math::Cos(), vector::Dot(), vector::Forward, InventorySlots::GetSlotIdFromString() и Math::Sin().