diff --git a/Runtime/Weapon/WeaponCommon.cpp b/Runtime/Weapon/WeaponCommon.cpp index 7c448a2e4..ef6ade659 100644 --- a/Runtime/Weapon/WeaponCommon.cpp +++ b/Runtime/Weapon/WeaponCommon.cpp @@ -134,10 +134,11 @@ void do_sound_event(std::pair& sfxHandle, float& pitch, bool do } } -CAssetId get_asset_id_from_name(const char* name) { +CAssetId get_asset_id_from_name(std::string_view name) { const SObjectTag* tag = g_ResFactory->GetResourceIdByName(name); - if (!tag) + if (!tag) { return {}; + } return tag->id; } diff --git a/Runtime/Weapon/WeaponCommon.hpp b/Runtime/Weapon/WeaponCommon.hpp index 599911708..74c183927 100644 --- a/Runtime/Weapon/WeaponCommon.hpp +++ b/Runtime/Weapon/WeaponCommon.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include "DataSpec/DNACommon/Tweaks/ITweakPlayerGun.hpp" @@ -83,7 +84,7 @@ void get_token_vector(const CAnimData& animData, int animIdx, std::vector& sfxHandle, float& pitch, bool doPitchBend, u32 soundId, float weight, u32 flags, float falloff, float maxDist, float minVol, float maxVol, const zeus::CVector3f& posToCam, const zeus::CVector3f& pos, TAreaId aid, CStateManager& mgr); -CAssetId get_asset_id_from_name(const char* name); +CAssetId get_asset_id_from_name(std::string_view name); CPlayerState::EPlayerSuit get_current_suit(const CStateManager& mgr); CSfxHandle play_sfx(u16 sfx, bool underwater, bool looped, float pan);