[Bug Fix] Fix issue with #suspend (#4314)

* [Bug Fix] Fix issue with #suspend

* Add suspension clearing

* Update character_data_repository.h

* Final push.
This commit is contained in:
Alex King
2024-05-23 16:45:21 -04:00
committed by GitHub
parent e26d17182e
commit e33e076b2a
8 changed files with 85 additions and 47 deletions
@@ -64,6 +64,22 @@ public:
return Strings::ToUnsignedInt(row[0]);
}
static CharacterData FindByName(
Database& db,
const std::string& character_name
)
{
auto l = CharacterDataRepository::GetWhere(
db,
fmt::format(
"`name` = '{}' LIMIT 1",
Strings::Escape(character_name)
)
);
return l.empty() ? CharacterDataRepository::NewEntity() : l.front();
}
};
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H