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

◆ GetWeightSpecialized()

float Weapon::GetWeightSpecialized ( bool forceRecalc = false)
inlineprotected

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

172 {
173 float baseWeight = GetInventoryAndCargoWeight(forceRecalc);
174 float ammoWeight;
175 float ammoDamage;
176 string bulletTypeName, ammoTypeName;
177
178 int muzzleCount = GetMuzzleCount();
179 #ifdef DEVELOPER
180 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
181 {
182 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
183 data1.SetCalcDetails("TWPN: " + m_ConfigWeight+"(item weight) + " + baseWeight +"(contents weight)" );
184 }
185 #endif
186 for (int muzzleIndex = 0; muzzleIndex < muzzleCount; muzzleIndex++)
187 {
188 //chamber weight
189 if (!IsChamberEmpty(muzzleIndex))
190 {
191 ammoTypeName = GetChamberAmmoTypeName(muzzleIndex);
192 ammoWeight += g_Game.ConfigGetFloat(string.Format("CfgMagazines %1 weight", ammoTypeName));
193
194 #ifdef DEVELOPER
195 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
196 {
197 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
198 data2.AddCalcDetails( g_Game.ConfigGetFloat("CfgMagazines " + ammoTypeName + " weight").ToString() +"(chamber weight)");
199 }
200 #endif
201 }
202
203 //correctly calculates internal magazine weight based on the ammo type of each bullet
204 if (HasInternalMagazine(muzzleIndex))
205 {
206 #ifdef DEVELOPER
207 float debugInternalMagWeight;
208 #endif
209 int cartridgeCount = GetInternalMagazineCartridgeCount(muzzleIndex);
210 for (int cartridgeIndex = 0; cartridgeIndex < cartridgeCount; cartridgeIndex++)
211 {
212 GetInternalMagazineCartridgeInfo(muzzleIndex, cartridgeIndex, ammoDamage, bulletTypeName);
213 ammoWeight += Ammunition_Base.GetAmmoWeightByBulletType(bulletTypeName);
214 #ifdef DEVELOPER
215 debugInternalMagWeight += g_Game.ConfigGetFloat("CfgMagazines " + ammoTypeName + " weight");
216 #endif
217 }
218 #ifdef DEVELOPER
219
220 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
221 {
222 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
223 data3.AddCalcDetails(debugInternalMagWeight.ToString()+ "(internal mag weight)");
224 }
225 #endif
226 }
227
228 }
229 return ammoWeight + baseWeight + GetConfigWeightModified();
230 }
Bolt_Base Ammunition_Base
DayZGame g_Game
Определения DayZGame.c:3868
static float GetAmmoWeightByBulletType(string bulletType)
Определения AmmunitionPiles.c:6
void AddCalcDetails(string details)
Определения Debug.c:822
void SetCalcDetails(string details)
Определения Debug.c:816
proto string ToString(bool simple=true)

Перекрестные ссылки WeightDebugData::AddCalcDetails(), g_Game, Ammunition_Base::GetAmmoWeightByBulletType(), WeightDebugData::SetCalcDetails() и float::ToString().