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

◆ GetEffectiveAttachmentLength()

float Weapon::GetEffectiveAttachmentLength ( )
inlineprivate

Returns effective length of attachments that influence total weapon length.

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

2007 {
2008 ItemBase attachment;
2009 if (HasBayonetAttached())
2010 {
2011 int bayonetIndex = GetBayonetAttachmentIdx();
2012 attachment = ItemBase.Cast(GetInventory().FindAttachment(bayonetIndex));
2013 }
2014 else
2015 {
2016 attachment = GetAttachedSuppressor();
2017 }
2018
2019 if (attachment)
2020 {
2021 return Math.Max(attachment.m_ItemModelLength + attachment.m_ItemAttachOffset, 0);
2022 }
2023 else
2024 {
2025 return 0;
2026 }
2027 }
class GP5GasMask extends MaskBase ItemBase
override int GetBayonetAttachmentIdx()
Определения Weapon_Base.c:2105
override bool HasBayonetAttached()
Определения Weapon_Base.c:2100

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

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