mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-18 15:58:21 +00:00
added min/max expansion range to missing queries
This commit is contained in:
+6
-4
@@ -182,8 +182,9 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
|
||||
}
|
||||
|
||||
if (has_home == 0 || has_bind == 0) {
|
||||
cquery = StringFormat("SELECT `zone_id`, `bind_id`, `x`, `y`, `z` FROM `start_zones` WHERE `player_class` = %i AND `player_deity` = %i AND `player_race` = %i AND %i & expansions = expansions",
|
||||
cse->Class, cse->Deity, cse->Race, RuleI(World, ExpansionSettings));
|
||||
auto latest_expansion = EQEmu::expansions::ConvertExpansionBitToExpansion(RuleI(World, ExpansionSettings));
|
||||
cquery = StringFormat("SELECT `zone_id`, `bind_id`, `x`, `y`, `z` FROM `start_zones` WHERE `player_class` = %i AND `player_deity` = %i AND `player_race` = %i AND min_expansion <= %i AND max_expansion >= %i",
|
||||
cse->Class, cse->Deity, cse->Race, latest_expansion, latest_expansion);
|
||||
auto results_bind = database.QueryDatabase(cquery);
|
||||
for (auto row_d = results_bind.begin(); row_d != results_bind.end(); ++row_d) {
|
||||
/* If a bind_id is specified, make them start there */
|
||||
@@ -356,10 +357,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
|
||||
|
||||
in_pp->x = in_pp->y = in_pp->z = in_pp->heading = in_pp->zone_id = 0;
|
||||
in_pp->binds[0].x = in_pp->binds[0].y = in_pp->binds[0].z = in_pp->binds[0].zoneId = in_pp->binds[0].instance_id = 0;
|
||||
auto latest_expansion = EQEmu::expansions::ConvertExpansionBitToExpansion(RuleI(World, ExpansionSettings));
|
||||
// see if we have an entry for start_zone. We can support both titanium & SOF+ by having two entries per class/race/deity combo with different zone_ids
|
||||
std::string query = StringFormat("SELECT x, y, z, heading, start_zone, bind_id, bind_x, bind_y, bind_z FROM start_zones WHERE zone_id = %i "
|
||||
"AND player_class = %i AND player_deity = %i AND player_race = %i AND %i & expansions = expansions",
|
||||
in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race, RuleI(World, ExpansionSettings));
|
||||
"AND player_class = %i AND player_deity = %i AND player_race = %i AND min_expansion <= %i AND max_expansion >= %i",
|
||||
in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race, latest_expansion, latest_expansion);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user