mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-05 19:32:25 +00:00
SavePetStats converted to QueryDatabase
This commit is contained in:
parent
364a51b119
commit
ab76783f8b
17
zone/bot.cpp
17
zone/bot.cpp
@ -2707,20 +2707,13 @@ void Bot::SavePet() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 Bot::SavePetStats(std::string petName, uint16 petMana, uint16 petHitPoints, uint32 botPetId) {
|
uint32 Bot::SavePetStats(std::string petName, uint16 petMana, uint16 petHitPoints, uint32 botPetId) {
|
||||||
uint32 Result = 0;
|
|
||||||
|
|
||||||
std::string errorMessage;
|
std::string query = StringFormat("REPLACE INTO botpets SET PetId = %u, BotId = %u, Name = '%s', "
|
||||||
char* Query = 0;
|
"Mana = %u, HitPoints = %u;", botPetId, GetBotID(), petName.c_str(),
|
||||||
char TempErrorMessageBuffer[MYSQL_ERRMSG_SIZE];
|
petMana, petHitPoints);
|
||||||
|
auto results = database.QueryDatabase(query);
|
||||||
|
|
||||||
if(!database.RunQuery(Query, MakeAnyLenString(&Query, "REPLACE INTO botpets SET PetId = %u, BotId = %u, Name = '%s', Mana = %u, HitPoints = %u;", botPetId, GetBotID(), petName.c_str(), petMana, petHitPoints), TempErrorMessageBuffer, 0, 0, &Result)) {
|
return 0;
|
||||||
errorMessage = std::string(TempErrorMessageBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
safe_delete(Query);
|
|
||||||
Query = 0;
|
|
||||||
|
|
||||||
return Result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SavePetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) {
|
void Bot::SavePetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user