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

◆ OnProjectileStoppedInObject()

void CGame::OnProjectileStoppedInObject ( ObjectCollisionInfo info)
inlineprotected

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

3704 {
3705 string simulation;
3706
3707 g_Game.ConfigGetText("cfgAmmo " + info.GetAmmoType() + " simulation", simulation);
3708 if (simulation == "shotArrow")
3709 {
3710 string pile;
3711 g_Game.ConfigGetText("cfgAmmo " + info.GetAmmoType() + " spawnPileType", pile);
3712
3713 EntityAI arrow = null;
3714 EntityAI ent = EntityAI.Cast(info.GetHitObj());
3715 if (ent)
3716 {
3717 EntityAI parent = ent.GetHierarchyParent();
3718 if (parent && parent.IsPlayer())
3719 {
3720 arrow = EntityAI.Cast(g_Game.CreateObjectEx(pile, parent.GetPosition(), ECE_DYNAMIC_PERSISTENCY));
3721 arrow.PlaceOnSurface();
3722 arrow.SetFromProjectile(info);
3723
3724 return;
3725 }
3726 }
3727
3728 vector pos = info.GetPos();
3729 vector dir = -info.GetInVelocity();
3730
3731 dir.Normalize();
3732 pos -= dir * ARROW_PIERCE_DEPTH;
3733
3734 arrow = EntityAI.Cast(g_Game.CreateObjectEx(pile, pos, ECE_KEEPHEIGHT|ECE_DYNAMIC_PERSISTENCY));
3735 arrow.SetDirection(dir);
3736 arrow.SetFromProjectile(info);
3737
3738 info.GetHitObj().AddArrow(arrow, info.GetComponentIndex(), info.GetHitObjPos(), info.GetHitObjRot());
3739 }
3740 }
class LogManager EntityAI
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:28
const int ECE_DYNAMIC_PERSISTENCY
Определения CentralEconomy.c:33
DayZGame g_Game
Определения DayZGame.c:4074
const float ARROW_PIERCE_DEPTH
Определения DayZGame.c:3675
proto native vector GetHitObjRot()
proto native Object GetHitObj()
proto native vector GetHitObjPos()
proto native int GetComponentIndex()
proto float Normalize()
Normalizes vector. Returns length.

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