mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Reload scaling data on repop
This commit is contained in:
+24
-10
@@ -1408,25 +1408,39 @@ uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16
|
||||
return base_cap;
|
||||
}
|
||||
|
||||
uint32 Database::GetCharacterInfo(const char* iName, uint32* oAccID, uint32* oZoneID, uint32* oInstanceID, float* oX, float* oY, float* oZ) {
|
||||
std::string query = StringFormat("SELECT `id`, `account_id`, `zone_id`, `zone_instance`, `x`, `y`, `z` FROM `character_data` WHERE `name` = '%s'", iName);
|
||||
uint32 Database::GetCharacterInfo(
|
||||
const char *iName,
|
||||
uint32 *oAccID,
|
||||
uint32 *oZoneID,
|
||||
uint32 *oInstanceID,
|
||||
float *oX,
|
||||
float *oY,
|
||||
float *oZ
|
||||
)
|
||||
{
|
||||
std::string query = StringFormat(
|
||||
"SELECT `id`, `account_id`, `zone_id`, `zone_instance`, `x`, `y`, `z` FROM `character_data` WHERE `name` = '%s'",
|
||||
EscapeString(iName).c_str()
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (results.RowCount() != 1)
|
||||
if (results.RowCount() != 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
auto row = results.begin();
|
||||
uint32 charid = atoi(row[0]);
|
||||
if (oAccID){ *oAccID = atoi(row[1]); }
|
||||
if (oZoneID){ *oZoneID = atoi(row[2]); }
|
||||
if (oInstanceID){ *oInstanceID = atoi(row[3]); }
|
||||
if (oX){ *oX = atof(row[4]); }
|
||||
if (oY){ *oY = atof(row[5]); }
|
||||
if (oZ){ *oZ = atof(row[6]); }
|
||||
if (oAccID) { *oAccID = atoi(row[1]); }
|
||||
if (oZoneID) { *oZoneID = atoi(row[2]); }
|
||||
if (oInstanceID) { *oInstanceID = atoi(row[3]); }
|
||||
if (oX) { *oX = atof(row[4]); }
|
||||
if (oY) { *oY = atof(row[5]); }
|
||||
if (oZ) { *oZ = atof(row[6]); }
|
||||
|
||||
return charid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user