mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-29 08:23:34 +00:00
Fix formating in ZoneDatabase::GetDecayTimes()
This commit is contained in:
parent
2c0714b5d8
commit
aae316c171
@ -1860,23 +1860,22 @@ bool Zone::RemoveSpawnGroup(uint32 in_id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes)
|
||||||
// Added By Hogie
|
{
|
||||||
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes) {
|
const std::string query =
|
||||||
|
"SELECT varname, value FROM variables WHERE varname LIKE 'decaytime%%' ORDER BY varname";
|
||||||
const std::string query = "SELECT varname, value FROM variables WHERE varname LIKE 'decaytime%%' ORDER BY varname";
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
|
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
|
||||||
Seperator sep(row[0]);
|
Seperator sep(row[0]);
|
||||||
npcCorpseDecayTimes[index].minlvl = atoi(sep.arg[1]);
|
npcCorpseDecayTimes[index].minlvl = atoi(sep.arg[1]);
|
||||||
npcCorpseDecayTimes[index].maxlvl = atoi(sep.arg[2]);
|
npcCorpseDecayTimes[index].maxlvl = atoi(sep.arg[2]);
|
||||||
|
|
||||||
npcCorpseDecayTimes[index].seconds = std::min(7200, atoi(row[1]));
|
npcCorpseDecayTimes[index].seconds = std::min(7200, atoi(row[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user