mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-24 17:48:20 +00:00
[Mercenaries] Convert Mercenaries to Repositories (#3947)
* [Mercenaries] Convert Mercenaries to Repositories - Convert all Mercenary methods to repositories aside from inner join queries that cannot be converted. * Update base_merc_subtypes_repository.h * Update base_merc_subtypes_repository.h * Regenerate repositories
This commit is contained in:
@@ -44,7 +44,23 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static MercsRepository::Mercs GetMercenaryBySlot(Database& db, Client* c)
|
||||
{
|
||||
const auto& l = MercsRepository::GetWhere(
|
||||
db,
|
||||
fmt::format(
|
||||
"`OwnerCharacterID` = {} AND `Slot` = {}",
|
||||
c->CharacterID(),
|
||||
c->GetMercSlot()
|
||||
)
|
||||
);
|
||||
|
||||
if (l.empty()) {
|
||||
return MercsRepository::NewEntity();
|
||||
}
|
||||
|
||||
return l[0];
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_MERCS_REPOSITORY_H
|
||||
|
||||
Reference in New Issue
Block a user