mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-22 04:37:02 +00:00
Shortened reputation update
This commit is contained in:
parent
f72c2dcaa5
commit
b903c81a0a
@ -524,32 +524,16 @@ void Mission::YieldRewards() {
|
||||
auto charId = character->GetID();
|
||||
auto propertyCloneId = character->GetPropertyCloneID();
|
||||
|
||||
auto properties = Database::CreatePreppedStmt("SELECT reputation FROM properties WHERE owner_id = ? AND clone_id = ?");
|
||||
auto reputationUpdate = Database::CreatePreppedStmt("UPDATE properties SET reputation = reputation + ? where owner_id = ? AND clone_id = ?");
|
||||
|
||||
properties->setInt(1, charId);
|
||||
properties->setInt64(2, propertyCloneId);
|
||||
|
||||
auto results = properties->executeQuery();
|
||||
|
||||
while (results->next()) {
|
||||
const auto oldReputation = results->getInt(1);
|
||||
|
||||
auto reputationUpdate = Database::CreatePreppedStmt("UPDATE properties SET reputation = ? where owner_id = ? AND clone_id = ?");
|
||||
|
||||
reputationUpdate->setInt64(1, oldReputation + info->reward_reputation);
|
||||
reputationUpdate->setInt64(1, info->reward_reputation);
|
||||
reputationUpdate->setInt(2, charId);
|
||||
reputationUpdate->setInt64(3, propertyCloneId);
|
||||
|
||||
reputationUpdate->execute();
|
||||
reputationUpdate->executeUpdate();
|
||||
|
||||
delete reputationUpdate;
|
||||
reputationUpdate = nullptr;
|
||||
}
|
||||
delete results;
|
||||
results = nullptr;
|
||||
|
||||
delete properties;
|
||||
properties = nullptr;
|
||||
|
||||
GameMessages::SendUpdateReputation(entity->GetObjectID(), info->reward_reputation, entity->GetSystemAddress());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user