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

◆ OnAttachmentRuined()

override void OnAttachmentRuined ( EntityAI attachment)
protected

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

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