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

◆ OnAttachmentRuined()

override void OnAttachmentRuined ( EntityAI attachment)
protected

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

388 {
389 switch (attachment.Type())
390 {
393 int slot = InventorySlots.GetSlotIdFromString("CookingEquipment");
394 EntityAI ent = GetInventory().FindAttachment(slot);
395 if (ent && ent.IsCookware())
396 {
397 vector direction = ent.GetDirection();
398 float dot = vector.Dot(direction, vector.Forward);
399
400 float angle = Math.Acos(dot);
401 if (direction[0] < 0)
402 {
403 angle = -angle;
404 }
405
406 float cos = Math.Cos(angle);
407 float sin = Math.Sin(angle);
408 GetInventory().DropEntityInBounds(InventoryMode.SERVER, this, ent, "2 0 2", angle, cos, sin);
409 }
410
411 attachment.Delete();
412 break;
413 }
414 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
ATTACHMENT_TRIPOD
Определения FireplaceBase.c:199
ATTACHMENT_COOKINGSTAND
Определения FireplaceBase.c:200
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:305
static const vector Forward
Определения EnConvert.c:122
Определения EnConvert.c:119
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().