2
0
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:
Lioncash
2020-04-11 19:32:58 -04:00
parent ff6c1fdd3d
commit fa0dcf5b12
2 changed files with 5 additions and 3 deletions

View File

@@ -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;
}