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

◆ OnAttachmentRuined()

override void OnAttachmentRuined ( EntityAI attachment)
protected

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

376 {
377 switch (attachment.Type())
378 {
381 int slot = InventorySlots.GetSlotIdFromString("CookingEquipment");
382 EntityAI ent = GetInventory().FindAttachment(slot);
383 if (ent && ent.IsCookware())
384 {
385 vector direction = ent.GetDirection();
386 float dot = vector.Dot(direction, vector.Forward);
387
388 float angle = Math.Acos(dot);
389 if (direction[0] < 0)
390 {
391 angle = -angle;
392 }
393
394 float cos = Math.Cos(angle);
395 float sin = Math.Sin(angle);
396 GetInventory().DropEntityInBounds(InventoryMode.SERVER, this, ent, "2 0 2", angle, cos, sin);
397 }
398
399 attachment.Delete();
400 break;
401 }
402 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
ATTACHMENT_TRIPOD
Определения FireplaceBase.c:198
ATTACHMENT_COOKINGSTAND
Определения FireplaceBase.c:199
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:284
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().