mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 03:47:42 +00:00
WeaponCommon: Use string_view with get_asset_id_from_name()
Internal functions expect a std::string_view, so we can just make the parameter a string_view as well to push the responsibility outwards into the caller.
This commit is contained in:
@@ -134,10 +134,11 @@ void do_sound_event(std::pair<u16, CSfxHandle>& 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user