mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[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:
parent
1aa3a4b11a
commit
1d38e473d7
@ -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);
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ public:
|
||||
const uint8 GetBotGenderByID(const uint32 bot_id);
|
||||
std::vector<uint32> GetBotIDsByCharacterID(const uint32 character_id, uint8 class_id = Class::None);
|
||||
const uint8 GetBotLevelByID(const uint32 bot_id);
|
||||
const std::string& GetBotNameByID(const uint32 bot_id);
|
||||
const std::string GetBotNameByID(const uint32 bot_id);
|
||||
const uint16 GetBotRaceByID(const uint32 bot_id);
|
||||
|
||||
class fail {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user