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

◆ GetWeightSpecialized()

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

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

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

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