[Bug Fix] GetBotNameByID Temporary Reference Warning (#4145)

# Notes
- We were getting a warning for returning `std::string()` from this method as it's a temporary reference.
- Change from `const std::string&` to `const std::string` to avoid this.
```
/home/eqemu/source/zone/bot_database.cpp: In member function ‘const std::string& BotDatabase::GetBotNameByID(uint32)’:
/home/eqemu/source/zone/bot_database.cpp:2374:25: warning: returning reference to temporary [-Wreturn-local-addr]
 2374 |         return e.bot_id ? e.name : std::string();
```
This commit is contained in:
Alex King authored and GitHub committed 2024-03-02 15:18:57 -06:00
1 parent 1aa3a4b11a
commit 1d38e473d7
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -2367,7 +2367,7 @@ const uint8 BotDatabase::GetBotLevelByID(const uint32 bot_id)
return e.bot_id ? e.level : 0;
}
const std::string& BotDatabase::GetBotNameByID(const uint32 bot_id)
const std::string BotDatabase::GetBotNameByID(const uint32 bot_id)
{
const auto& e = BotDataRepository::FindOne(database, bot_id);