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

◆ OnProjectileStoppedInObject()

void CGame::OnProjectileStoppedInObject ( ObjectCollisionInfo info)
inlineprotected

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

3501 {
3502 string simulation;
3503
3504 GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " simulation", simulation);
3505 if (simulation == "shotArrow")
3506 {
3507 string pile;
3508 GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " spawnPileType", pile);
3509
3510 EntityAI arrow = null;
3511 EntityAI ent = EntityAI.Cast(info.GetHitObj());
3512 if (ent)
3513 {
3514 EntityAI parent = ent.GetHierarchyParent();
3515 if (parent && parent.IsPlayer())
3516 {
3517 arrow = EntityAI.Cast(GetGame().CreateObjectEx(pile, parent.GetPosition(), ECE_DYNAMIC_PERSISTENCY));
3518 arrow.PlaceOnSurface();
3519 arrow.SetFromProjectile(info);
3520
3521 return;
3522 }
3523 }
3524
3525 vector pos = info.GetPos();
3526 vector dir = -info.GetInVelocity();
3527
3528 dir.Normalize();
3529 pos -= dir * ARROW_PIERCE_DEPTH;
3530
3532 arrow.SetDirection(dir);
3533 arrow.SetFromProjectile(info);
3534
3535 info.GetHitObj().AddArrow(arrow, info.GetComponentIndex(), info.GetHitObjPos(), info.GetHitObjRot());
3536 }
3537 }
class LogManager EntityAI
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:27
const int ECE_DYNAMIC_PERSISTENCY
Определения CentralEconomy.c:32
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
const float ARROW_PIERCE_DEPTH
Определения DayZGame.c:3472
proto native vector GetHitObjRot()
proto native Object GetHitObj()
proto native vector GetHitObjPos()
proto native int GetComponentIndex()
proto float Normalize()
Normalizes vector. Returns length.
proto native CGame GetGame()

Перекрестные ссылки ARROW_PIERCE_DEPTH, ConfigGetText(), CreateObjectEx(), ECE_DYNAMIC_PERSISTENCY, ECE_KEEPHEIGHT, ObjectCollisionInfo::GetComponentIndex(), GetGame(), ObjectCollisionInfo::GetHitObj(), ObjectCollisionInfo::GetHitObjPos(), ObjectCollisionInfo::GetHitObjRot() и vector::Normalize().