[Cleanup] results variable is assigned but never used in SaveCharacterCreate() (#3180)

# Notes
- This was unnecessary since `QueryDatabase()` runs regardless.
This commit is contained in:
Alex King 2023-04-05 11:17:10 -04:00 committed by GitHub
parent d1b7c675f9
commit 3386d13d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,7 +449,8 @@ bool Database::DeleteCharacter(char *character_name)
return true; return true;
} }
bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp){ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct *pp)
{
std::string query = StringFormat( std::string query = StringFormat(
"REPLACE INTO `character_data` (" "REPLACE INTO `character_data` ("
"id," "id,"
@ -725,10 +726,11 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
pp->guildAutoconsent, // " guild_auto_consent, " pp->guildAutoconsent, // " guild_auto_consent, "
pp->RestTimer // " RestTimer) " pp->RestTimer // " RestTimer) "
); );
auto results = QueryDatabase(query); QueryDatabase(query);
/* Save Bind Points */ /* Save Bind Points */
query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, slot)" query = StringFormat(
"REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, slot)"
" VALUES (%u, %u, %u, %f, %f, %f, %f, %i), " " VALUES (%u, %u, %u, %f, %f, %f, %f, %i), "
"(%u, %u, %u, %f, %f, %f, %f, %i), " "(%u, %u, %u, %f, %f, %f, %f, %i), "
"(%u, %u, %u, %f, %f, %f, %f, %i), " "(%u, %u, %u, %f, %f, %f, %f, %i), "
@ -739,13 +741,18 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
character_id, pp->binds[2].zone_id, 0, pp->binds[2].x, pp->binds[2].y, pp->binds[2].z, pp->binds[2].heading, 2, character_id, pp->binds[2].zone_id, 0, pp->binds[2].x, pp->binds[2].y, pp->binds[2].z, pp->binds[2].heading, 2,
character_id, pp->binds[3].zone_id, 0, pp->binds[3].x, pp->binds[3].y, pp->binds[3].z, pp->binds[3].heading, 3, character_id, pp->binds[3].zone_id, 0, pp->binds[3].x, pp->binds[3].y, pp->binds[3].z, pp->binds[3].heading, 3,
character_id, pp->binds[4].zone_id, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 4 character_id, pp->binds[4].zone_id, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 4
); results = QueryDatabase(query); );
QueryDatabase(query);
/* HoTT Ability */ /* HoTT Ability */
if(RuleB(Character, GrantHoTTOnCreate)) if (RuleB(Character, GrantHoTTOnCreate)) {
{ query = StringFormat(
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%u, %i, %i)", character_id, 14, 1); "INSERT INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%u, %i, %i)",
results = QueryDatabase(query); character_id,
14,
1
);
QueryDatabase(query);
} }
/* Save Skills */ /* Save Skills */
@ -754,14 +761,18 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
if (pp->skills[i] > 0) { if (pp->skills[i] > 0) {
if (firstquery != 1) { if (firstquery != 1) {
firstquery = 1; firstquery = 1;
query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, i, pp->skills[i]); query = StringFormat(
} "REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)",
else{ character_id,
i,
pp->skills[i]
);
} else {
query = query + StringFormat(", (%u, %u, %u)", character_id, i, pp->skills[i]); query = query + StringFormat(", (%u, %u, %u)", character_id, i, pp->skills[i]);
} }
} }
} }
results = QueryDatabase(query); QueryDatabase(query);
/* Save Language */ /* Save Language */
firstquery = 0; firstquery = 0;
@ -769,14 +780,18 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
if (pp->languages[i] > 0) { if (pp->languages[i] > 0) {
if (firstquery != 1) { if (firstquery != 1) {
firstquery = 1; firstquery = 1;
query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, i, pp->languages[i]); query = StringFormat(
} "REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)",
else{ character_id,
i,
pp->languages[i]
);
} else {
query = query + StringFormat(", (%u, %u, %u)", character_id, i, pp->languages[i]); query = query + StringFormat(", (%u, %u, %u)", character_id, i, pp->languages[i]);
} }
} }
} }
results = QueryDatabase(query); QueryDatabase(query);
return true; return true;
} }