mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-01 00:52:24 +00:00
Filter starting_items [skip ci]
This commit is contained in:
parent
9fbcd99be2
commit
91c874a310
@ -432,16 +432,25 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
|
|||||||
|
|
||||||
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
|
bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQEmu::InventoryProfile* inv, uint32 si_race, uint32 si_class, uint32 si_deity, uint32 si_current_zone, char* si_name, int admin_level) {
|
||||||
|
|
||||||
const EQEmu::ItemData* myitem;
|
const EQEmu::ItemData *myitem;
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT itemid, item_charges, slot FROM starting_items "
|
std::string query = StringFormat(
|
||||||
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
|
"SELECT itemid, item_charges, slot FROM starting_items "
|
||||||
"(deityid = %i or deityid = 0) AND (zoneid = %i or zoneid = 0) AND "
|
"WHERE (race = %i or race = 0) AND (class = %i or class = 0) AND "
|
||||||
"gm <= %i ORDER BY id",
|
"(deityid = %i or deityid = 0) AND (zoneid = %i or zoneid = 0) AND "
|
||||||
si_race, si_class, si_deity, si_current_zone, admin_level);
|
"gm <= %i %s ORDER BY id",
|
||||||
auto results = QueryDatabase(query);
|
si_race,
|
||||||
if (!results.Success())
|
si_class,
|
||||||
return false;
|
si_deity,
|
||||||
|
si_current_zone,
|
||||||
|
admin_level,
|
||||||
|
ContentFilterCriteria::apply().c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user