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

◆ GetEffectiveAttachmentLength()

float Weapon::GetEffectiveAttachmentLength ( )
inlineprivate

Returns effective length of attachments that influence total weapon length.

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

2001 {
2002 ItemBase attachment;
2003 if (HasBayonetAttached())
2004 {
2005 int bayonetIndex = GetBayonetAttachmentIdx();
2006 attachment = ItemBase.Cast(GetInventory().FindAttachment(bayonetIndex));
2007 }
2008 else
2009 {
2010 attachment = GetAttachedSuppressor();
2011 }
2012
2013 if (attachment)
2014 {
2015 ItemBaseType itemBaseType = ItemBaseType.Cast(attachment.GetEntityType());
2016 return Math.Max(itemBaseType.m_ItemModelLength + itemBaseType.m_ItemAttachOffset, 0);
2017 }
2018 else
2019 {
2020 return 0;
2021 }
2022 }
class GP5GasMask extends MaskBase ItemBase
float m_ItemModelLength float m_ItemAttachOffset
Определения ItemBaseType.c:45
override int GetBayonetAttachmentIdx()
Определения Weapon_Base.c:2100
override bool HasBayonetAttached()
Определения Weapon_Base.c:2095

Перекрестные ссылки GetBayonetAttachmentIdx(), HasBayonetAttached(), ItemBaseType::m_ItemAttachOffset и Math::Max().

Используется в GetObstructionPenetrationDistance() и LiftWeaponCheckEx().