mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-03-16 01:43:04 +00:00
chore: update all logging to use centralized logging component
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "InfoStringToStructConverter.h"
|
||||
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -63,7 +65,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (fx == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load fx asset \"{}\"\n", value);
|
||||
con::error("Failed to load fx asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,7 +87,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (xmodel == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load xmodel asset \"{}\"\n", value);
|
||||
con::error("Failed to load xmodel asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -107,7 +109,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (material == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load material asset \"{}\"\n", value);
|
||||
con::error("Failed to load material asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -129,7 +131,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (tracer == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load tracer asset \"{}\"\n", value);
|
||||
con::error("Failed to load tracer asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -146,7 +148,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (endPtr != &value[value.size()])
|
||||
{
|
||||
std::cerr << std::format("Failed to parse value \"{}\" as mph\n", value);
|
||||
con::error("Failed to parse value \"{}\" as mph", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -165,7 +167,7 @@ bool InfoStringToStructConverter::ConvertBaseField(const cspField_t& field, cons
|
||||
|
||||
if (collmap == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to load collmap asset \"{}\"\n", value);
|
||||
con::error("Failed to load collmap asset \"{}\"", value);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Game/IW4/Leaderboard/JsonLeaderboardDef.h"
|
||||
#include "Leaderboard/LeaderboardCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -36,7 +37,7 @@ namespace
|
||||
|
||||
if (type != "leaderboard" || version != 1u)
|
||||
{
|
||||
std::cerr << std::format("Tried to load leaderboard \"{}\" but did not find expected type leaderboard of version 1\n", leaderboardDef.name);
|
||||
con::error("Tried to load leaderboard \"{}\" but did not find expected type leaderboard of version 1", leaderboardDef.name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ namespace
|
||||
}
|
||||
catch (const json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to parse json of leaderboard: {}\n", e.what());
|
||||
con::error("Failed to parse json of leaderboard: {}", e.what());
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -125,7 +126,7 @@ namespace
|
||||
const JsonLoader loader(*file.m_stream, m_memory);
|
||||
if (!loader.Load(*leaderboardDef))
|
||||
{
|
||||
std::cerr << std::format("Failed to load leaderboard \"{}\"\n", assetName);
|
||||
con::error("Failed to load leaderboard \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "LightDef/LightDefCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -49,7 +50,7 @@ namespace
|
||||
auto* imageDependency = context.LoadDependency<AssetImage>(imageName);
|
||||
if (!imageDependency)
|
||||
{
|
||||
std::cerr << std::format("Could not load GfxLightDef \"{}\" due to missing image \"{}\"\n", assetName, imageName);
|
||||
con::error("Could not load GfxLightDef \"{}\" due to missing image \"{}\"", assetName, imageName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
registration.AddDependency(imageDependency);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Game/IW4/Material/JsonMaterialLoaderIW4.h"
|
||||
#include "Material/MaterialCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -32,7 +33,7 @@ namespace
|
||||
AssetRegistration<AssetMaterial> registration(assetName, material);
|
||||
if (!LoadMaterialAsJson(*file.m_stream, *material, m_memory, context, registration))
|
||||
{
|
||||
std::cerr << std::format("Failed to load material \"{}\"\n", assetName);
|
||||
con::error("Failed to load material \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Game/IW4/Menu/MenuConverterIW4.h"
|
||||
#include "ObjLoading.h"
|
||||
#include "Parsing/Menu/MenuFileReader.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -88,7 +89,7 @@ namespace
|
||||
const auto alreadyLoadedMenuFile = conversionState.m_menus_by_filename.find(menuFilePath);
|
||||
if (alreadyLoadedMenuFile != conversionState.m_menus_by_filename.end())
|
||||
{
|
||||
std::cout << std::format("Already loaded \"{}\", skipping\n", menuFilePath);
|
||||
con::debug("Already loaded \"{}\", skipping", menuFilePath);
|
||||
for (auto* menu : alreadyLoadedMenuFile->second)
|
||||
{
|
||||
menus.emplace_back(menu->Asset());
|
||||
@@ -100,7 +101,7 @@ namespace
|
||||
const auto file = m_search_path.Open(menuFilePath);
|
||||
if (!file.IsOpen())
|
||||
{
|
||||
std::cerr << std::format("Could not open menu file \"{}\"\n", menuFilePath);
|
||||
con::error("Could not open menu file \"{}\"", menuFilePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -109,12 +110,12 @@ namespace
|
||||
{
|
||||
ProcessParsedResults(menuFilePath, context, *menuFileResult, zoneState, conversionState, menus, registration);
|
||||
if (!menuFileResult->m_menus_to_load.empty())
|
||||
std::cout << std::format("WARNING: Menu file has menus to load even though it is not a menu list, ignoring: \"{}\"\n", menuFilePath);
|
||||
con::warn("Menu file has menus to load even though it is not a menu list, ignoring: \"{}\"", menuFilePath);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
std::cerr << std::format("Could not read menu file \"{}\"\n", menuFilePath);
|
||||
con::error("Could not read menu file \"{}\"", menuFilePath);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -134,12 +135,12 @@ namespace
|
||||
for (const auto& menu : parsingResult.m_menus)
|
||||
totalItemCount += menu->m_items.size();
|
||||
|
||||
std::cout << std::format("Successfully read menu file \"{}\" ({} loads, {} menus, {} functions, {} items)\n",
|
||||
fileName,
|
||||
menuLoadCount,
|
||||
menuCount,
|
||||
functionCount,
|
||||
totalItemCount);
|
||||
con::info("Successfully read menu file \"{}\" ({} loads, {} menus, {} functions, {} items)",
|
||||
fileName,
|
||||
menuLoadCount,
|
||||
menuCount,
|
||||
functionCount,
|
||||
totalItemCount);
|
||||
|
||||
// Add all functions to the zone state to make them available for all menus to be converted
|
||||
for (auto& function : parsingResult.m_functions)
|
||||
@@ -160,7 +161,7 @@ namespace
|
||||
converter->ConvertMenu(*commonMenu, *menuAsset, menuRegistration);
|
||||
if (menuAsset == nullptr)
|
||||
{
|
||||
std::cerr << std::format("Failed to convert menu file \"{}\"\n", commonMenu->m_name);
|
||||
con::error("Failed to convert menu file \"{}\"", commonMenu->m_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Game/IW4/ObjConstantsIW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderPhysPresetIW4.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -30,7 +31,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read phys preset gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read phys preset gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Game/IW4/InfoString/InfoStringToStructConverter.h"
|
||||
#include "Game/IW4/PhysPreset/PhysPresetFields.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -78,7 +79,7 @@ namespace phys_preset
|
||||
infoString, &presetInfo, m_zone.m_script_strings, m_memory, context, registration, phys_preset_fields, std::extent_v<decltype(phys_preset_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse phys preset: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse phys preset: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderPhysPresetIW4.h"
|
||||
#include "PhysPreset/PhysPresetCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -32,7 +33,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_PHYS_PRESET, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "LoaderRawFileIW4.h"
|
||||
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
@@ -58,7 +59,7 @@ namespace
|
||||
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
std::cerr << std::format("Deflate failed for loading rawfile \"{}\"\n", assetName);
|
||||
con::error("Deflate failed for loading rawfile \"{}\"", assetName);
|
||||
deflateEnd(&zs);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Shader/ShaderCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
@@ -29,7 +30,7 @@ namespace
|
||||
|
||||
if (file.m_length % sizeof(uint32_t) != 0)
|
||||
{
|
||||
std::cerr << std::format("Invalid pixel shader \"{}\": Size must be dividable by {}\n", assetName, sizeof(uint32_t));
|
||||
con::error("Invalid pixel shader \"{}\": Size must be dividable by {}", assetName, sizeof(uint32_t));
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Shader/ShaderCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
@@ -29,7 +30,7 @@ namespace
|
||||
|
||||
if (file.m_length % sizeof(uint32_t) != 0)
|
||||
{
|
||||
std::cerr << std::format("Invalid vertex shader \"{}\": Size must be dividable by {}\n", assetName, sizeof(uint32_t));
|
||||
con::error("Invalid vertex shader \"{}\": Size must be dividable by {}", assetName, sizeof(uint32_t));
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Parsing/Graph2D/Graph2DReader.h"
|
||||
#include "Pool/GlobalAssetPool.h"
|
||||
#include "Sound/SoundCurveCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -38,7 +39,7 @@ namespace
|
||||
|
||||
if (sndCurveData->knots.size() > std::extent_v<decltype(SndCurve::knots)>)
|
||||
{
|
||||
std::cerr << std::format("Failed to load SndCurve \"{}\": Too many knots ({})\n", assetName, sndCurveData->knots.size());
|
||||
con::error("Failed to load SndCurve \"{}\": Too many knots ({})", assetName, sndCurveData->knots.size());
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Game/IW4/ObjConstantsIW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderWeaponIW4.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -31,7 +32,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromGdtProperties(*gdtEntry))
|
||||
{
|
||||
std::cerr << std::format("Failed to read weapon gdt entry: \"{}\"\n", assetName);
|
||||
con::error("Failed to read weapon gdt entry: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Game/IW4/InfoString/EnumStrings.h"
|
||||
#include "Game/IW4/InfoString/InfoStringToStructConverter.h"
|
||||
#include "Game/IW4/Weapon/WeaponFields.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/AccuracyGraphLoader.h"
|
||||
|
||||
#include <cassert>
|
||||
@@ -23,13 +24,13 @@ namespace
|
||||
std::vector<std::string> valueArray;
|
||||
if (!ParseAsArray(value, valueArray))
|
||||
{
|
||||
std::cerr << "Failed to parse hide tags as array\n";
|
||||
con::error("Failed to parse hide tags as array");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (valueArray.size() > std::extent_v<decltype(WeaponFullDef::hideTags)>)
|
||||
{
|
||||
std::cerr << std::format("Cannot have more than {} hide tags!\n", std::extent_v<decltype(WeaponFullDef::hideTags)>);
|
||||
con::error("Cannot have more than {} hide tags!", std::extent_v<decltype(WeaponFullDef::hideTags)>);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,14 +86,13 @@ namespace
|
||||
std::vector<std::array<std::string, 2>> pairs;
|
||||
if (!ParseAsArray(value, pairs))
|
||||
{
|
||||
std::cerr << std::format("Failed to parse notetrack{}map as pairs\n", mapName);
|
||||
con::error("Failed to parse notetrack{}map as pairs", mapName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pairs.size() > std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>)
|
||||
{
|
||||
std::cerr << std::format(
|
||||
"Cannot have more than {} notetrack{}map entries!\n", std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>, mapName);
|
||||
con::error("Cannot have more than {} notetrack{}map entries!", std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>, mapName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -267,28 +267,27 @@ namespace
|
||||
void CheckProjectileValues(const WeaponCompleteDef& weaponCompleteDef, const WeaponDef& weaponDef)
|
||||
{
|
||||
if (weaponDef.iProjectileSpeed <= 0)
|
||||
std::cerr << std::format("Projectile speed for WeapType {} must be greater than 0.0", weaponCompleteDef.szDisplayName);
|
||||
con::error("Projectile speed for WeapType {} must be greater than 0.0", weaponCompleteDef.szDisplayName);
|
||||
if (weaponDef.destabilizationCurvatureMax >= 1000000000.0f || weaponDef.destabilizationCurvatureMax < 0.0f)
|
||||
std::cerr << std::format("Destabilization angle for for WeapType {} must be between 0 and 45 degrees", weaponCompleteDef.szDisplayName);
|
||||
con::error("Destabilization angle for for WeapType {} must be between 0 and 45 degrees", weaponCompleteDef.szDisplayName);
|
||||
if (weaponDef.destabilizationRateTime < 0.0f)
|
||||
std::cerr << std::format("Destabilization rate time for for WeapType {} must be non-negative", weaponCompleteDef.szDisplayName);
|
||||
con::error("Destabilization rate time for for WeapType {} must be non-negative", weaponCompleteDef.szDisplayName);
|
||||
}
|
||||
|
||||
void CheckTurretBarrelSpin(const WeaponCompleteDef& weaponCompleteDef, const WeaponDef& weaponDef)
|
||||
{
|
||||
if (weaponDef.weapClass != WEAPCLASS_TURRET)
|
||||
std::cerr << std::format("Rotating barrel set for non-turret weapon {}.", weaponCompleteDef.szInternalName);
|
||||
con::error("Rotating barrel set for non-turret weapon {}.", weaponCompleteDef.szInternalName);
|
||||
|
||||
if (0.0f == weaponDef.turretBarrelSpinSpeed)
|
||||
{
|
||||
std::cerr << std::format(
|
||||
"Rotating barrel spin speed '{}' is invalid for weapon {}.", weaponDef.turretBarrelSpinSpeed, weaponCompleteDef.szInternalName);
|
||||
con::error("Rotating barrel spin speed '{}' is invalid for weapon {}.", weaponDef.turretBarrelSpinSpeed, weaponCompleteDef.szInternalName);
|
||||
}
|
||||
if (0.0f < weaponDef.turretOverheatUpRate && 0.0f >= weaponDef.turretOverheatDownRate)
|
||||
{
|
||||
std::cerr << std::format("Turret overheat Up rate is set, but the down rate '{}' is invalid for weapon {}.",
|
||||
weaponDef.turretOverheatDownRate,
|
||||
weaponCompleteDef.szInternalName);
|
||||
con::error("Turret overheat Up rate is set, but the down rate '{}' is invalid for weapon {}.",
|
||||
weaponDef.turretOverheatDownRate,
|
||||
weaponCompleteDef.szInternalName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,18 +295,18 @@ namespace
|
||||
{
|
||||
if (0.0f != weaponDef.fAdsZoomInFrac)
|
||||
{
|
||||
std::cerr << std::format("Weapon {} ({}) has thermal scope set. ADS Zoom In frac should be 0 to prevent zoom-in blur ({}).\n",
|
||||
weaponCompleteDef.szInternalName,
|
||||
weaponCompleteDef.szDisplayName,
|
||||
weaponDef.fAdsZoomInFrac);
|
||||
con::error("Weapon {} ({}) has thermal scope set. ADS Zoom In frac should be 0 to prevent zoom-in blur ({}).",
|
||||
weaponCompleteDef.szInternalName,
|
||||
weaponCompleteDef.szDisplayName,
|
||||
weaponDef.fAdsZoomInFrac);
|
||||
}
|
||||
|
||||
if (0.0f != weaponDef.fAdsZoomOutFrac)
|
||||
{
|
||||
std::cerr << std::format("Weapon {} ({}) has thermal scope set. ADS Zoom Out frac should be 0 to prevent zoom-out blur ({}).\n",
|
||||
weaponCompleteDef.szInternalName,
|
||||
weaponCompleteDef.szDisplayName,
|
||||
weaponDef.fAdsZoomOutFrac);
|
||||
con::error("Weapon {} ({}) has thermal scope set. ADS Zoom Out frac should be 0 to prevent zoom-out blur ({}).",
|
||||
weaponCompleteDef.szInternalName,
|
||||
weaponCompleteDef.szDisplayName,
|
||||
weaponDef.fAdsZoomOutFrac);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,7 +336,7 @@ namespace
|
||||
weaponDef.fMinDamageRange = 999999.12f;
|
||||
|
||||
if (weaponDef.enemyCrosshairRange > 15000.0f)
|
||||
std::cerr << std::format("Enemy crosshair ranges should be less than {}\n", 15000.0f);
|
||||
con::error("Enemy crosshair ranges should be less than {}", 15000.0f);
|
||||
|
||||
if (weaponDef.weapType == WEAPTYPE_PROJECTILE)
|
||||
CheckProjectileValues(weaponCompleteDef, weaponDef);
|
||||
@@ -350,22 +349,21 @@ namespace
|
||||
|
||||
if (weaponDef.offhandClass && !weaponDef.bClipOnly)
|
||||
{
|
||||
std::cerr << std::format(
|
||||
"Weapon {} ({}) is an offhand weapon but is not set to clip only, which is not supported since we can't reload the offhand slot.\n",
|
||||
weaponCompleteDef.szInternalName,
|
||||
weaponCompleteDef.szDisplayName);
|
||||
con::error("Weapon {} ({}) is an offhand weapon but is not set to clip only, which is not supported since we can't reload the offhand slot.",
|
||||
weaponCompleteDef.szInternalName,
|
||||
weaponCompleteDef.szDisplayName);
|
||||
}
|
||||
|
||||
if (weaponDef.weapType == WEAPTYPE_BULLET)
|
||||
{
|
||||
if (weaponDef.bulletExplDmgMult <= 0.0f)
|
||||
std::cerr << std::format("Detected invalid bulletExplDmgMult of '{}' for weapon '{}'; please update weapon settings.\n",
|
||||
weaponDef.bulletExplDmgMult,
|
||||
weaponCompleteDef.szInternalName);
|
||||
con::error("Detected invalid bulletExplDmgMult of '{}' for weapon '{}'; please update weapon settings.",
|
||||
weaponDef.bulletExplDmgMult,
|
||||
weaponCompleteDef.szInternalName);
|
||||
if (weaponDef.bulletExplRadiusMult <= 0.0f)
|
||||
std::cerr << std::format("Detected invalid bulletExplRadiusMult of '{}' for weapon '{}'; please update weapon settings.\n",
|
||||
weaponDef.bulletExplRadiusMult,
|
||||
weaponCompleteDef.szInternalName);
|
||||
con::error("Detected invalid bulletExplRadiusMult of '{}' for weapon '{}'; please update weapon settings.",
|
||||
weaponDef.bulletExplRadiusMult,
|
||||
weaponCompleteDef.szInternalName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,7 +446,7 @@ namespace weapon
|
||||
infoString, *weaponFullDef, m_zone.m_script_strings, m_memory, context, registration, weapon_fields, std::extent_v<decltype(weapon_fields)>);
|
||||
if (!converter.Convert())
|
||||
{
|
||||
std::cerr << std::format("Failed to parse weapon: \"{}\"\n", assetName);
|
||||
con::error("Failed to parse weapon: \"{}\"", assetName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Game/IW4/ObjConstantsIW4.h"
|
||||
#include "InfoString/InfoString.h"
|
||||
#include "InfoStringLoaderWeaponIW4.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Weapon/WeaponCommon.h"
|
||||
|
||||
#include <cstring>
|
||||
@@ -33,7 +34,7 @@ namespace
|
||||
InfoString infoString;
|
||||
if (!infoString.FromStream(ObjConstants::INFO_STRING_PREFIX_WEAPON, *file.m_stream))
|
||||
{
|
||||
std::cerr << std::format("Could not parse as info string file: \"{}\"\n", fileName);
|
||||
con::error("Could not parse as info string file: \"{}\"", fileName);
|
||||
return AssetCreationResult::Failure();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user