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

◆ OnProjectileStoppedInObject()

void CGame::OnProjectileStoppedInObject ( ObjectCollisionInfo info)
inlineprotected

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

3575 {
3576 string simulation;
3577
3578 g_Game.ConfigGetText("cfgAmmo " + info.GetAmmoType() + " simulation", simulation);
3579 if (simulation == "shotArrow")
3580 {
3581 string pile;
3582 g_Game.ConfigGetText("cfgAmmo " + info.GetAmmoType() + " spawnPileType", pile);
3583
3584 EntityAI arrow = null;
3585 EntityAI ent = EntityAI.Cast(info.GetHitObj());
3586 if (ent)
3587 {
3588 EntityAI parent = ent.GetHierarchyParent();
3589 if (parent && parent.IsPlayer())
3590 {
3591 arrow = EntityAI.Cast(g_Game.CreateObjectEx(pile, parent.GetPosition(), ECE_DYNAMIC_PERSISTENCY));
3592 arrow.PlaceOnSurface();
3593 arrow.SetFromProjectile(info);
3594
3595 return;
3596 }
3597 }
3598
3599 vector pos = info.GetPos();
3600 vector dir = -info.GetInVelocity();
3601
3602 dir.Normalize();
3603 pos -= dir * ARROW_PIERCE_DEPTH;
3604
3605 arrow = EntityAI.Cast(g_Game.CreateObjectEx(pile, pos, ECE_KEEPHEIGHT|ECE_DYNAMIC_PERSISTENCY));
3606 arrow.SetDirection(dir);
3607 arrow.SetFromProjectile(info);
3608
3609 info.GetHitObj().AddArrow(arrow, info.GetComponentIndex(), info.GetHitObjPos(), info.GetHitObjRot());
3610 }
3611 }
class LogManager EntityAI
const int ECE_KEEPHEIGHT
Определения CentralEconomy.c:27
const int ECE_DYNAMIC_PERSISTENCY
Определения CentralEconomy.c:32
DayZGame g_Game
Определения DayZGame.c:3942
const float ARROW_PIERCE_DEPTH
Определения DayZGame.c:3546
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().