From ba33c15b2d7824013d490953b4232f37f2a42922 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Thu, 31 Mar 2022 18:17:58 -0700 Subject: [PATCH] reputation rewards are now applied to character and not properties --- dGame/dMission/Mission.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/dGame/dMission/Mission.cpp b/dGame/dMission/Mission.cpp index 748bebd4..f7b57071 100644 --- a/dGame/dMission/Mission.cpp +++ b/dGame/dMission/Mission.cpp @@ -518,24 +518,11 @@ void Mission::YieldRewards() { if (info->reward_reputation > 0) { missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_EARN_REPUTATION, 0, 0L, "", info->reward_reputation); - auto character = entity->GetCharacter(); - if (!character) return; - - auto charId = character->GetID(); - auto propertyCloneId = character->GetPropertyCloneID(); - - auto reputationUpdate = Database::CreatePreppedStmt("UPDATE properties SET reputation = reputation + ? where owner_id = ? AND clone_id = ?"); - - reputationUpdate->setInt64(1, info->reward_reputation); - reputationUpdate->setInt(2, charId); - reputationUpdate->setInt64(3, propertyCloneId); - - reputationUpdate->executeUpdate(); - - delete reputationUpdate; - reputationUpdate = nullptr; - - GameMessages::SendUpdateReputation(entity->GetObjectID(), info->reward_reputation, entity->GetSystemAddress()); + auto character = entity->GetComponent(); + if (character) { + character->SetReputation(character->GetReputation() + info->reward_reputation); + GameMessages::SendUpdateReputation(entity->GetObjectID(), character->GetReputation(), entity->GetSystemAddress()); + } } if (info->reward_maxhealth > 0) {