Modify reputation not updating #7939

Closed
gpascualg opened this Issue Oct 1, 2012 · 10 comments

Comments

Projects
None yet
9 participants
@gpascualg
Contributor

gpascualg commented Oct 1, 2012

The command ".mod rep faction value" is not updating the client (relog must be done), though it does modify the reputation on the server side.

Rev: 174deb1
OS: Centos 6 64 bits
TDB 335.49

@SgT-Fatality

This comment has been minimized.

Show comment
Hide comment
@SgT-Fatality

SgT-Fatality Oct 2, 2012

Hello,

Here is a patch to fix your problem :

 src/server/scripts/Commands/cs_modify.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index a88c765..de92dd1 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1237,6 +1237,7 @@ public:
         }

         target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
+       target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
         handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
             handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
         return true;

By the way I think we should use "SetReputation" and not "SetOneFactionReputation". Because in "SetReputation" the function send the new state to client by the "SendState" function. And not in "SetOneFactionReputation".

Hello,

Here is a patch to fix your problem :

 src/server/scripts/Commands/cs_modify.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index a88c765..de92dd1 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1237,6 +1237,7 @@ public:
         }

         target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
+       target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
         handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
             handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
         return true;

By the way I think we should use "SetReputation" and not "SetOneFactionReputation". Because in "SetReputation" the function send the new state to client by the "SendState" function. And not in "SetOneFactionReputation".

@CDawg

This comment has been minimized.

Show comment
Hide comment
@CDawg

CDawg Oct 3, 2012

Contributor

Wow, this has been a problem for a very long time... I figured just relogging the toon to fix the issue. haha

Contributor

CDawg commented Oct 3, 2012

Wow, this has been a problem for a very long time... I figured just relogging the toon to fix the issue. haha

@Subv

This comment has been minimized.

Show comment
Hide comment
@Subv

Subv Oct 3, 2012

Contributor

@SgT-Fatality SetOneFactionReputation ensures that no spillover reputation templates are used (means we only get reputation for the faction we specified, and nothing more).

Contributor

Subv commented Oct 3, 2012

@SgT-Fatality SetOneFactionReputation ensures that no spillover reputation templates are used (means we only get reputation for the faction we specified, and nothing more).

@Expecto

This comment has been minimized.

Show comment
Hide comment
@Expecto

Expecto Oct 4, 2012

@tibbi

This comment has been minimized.

Show comment
Hide comment
@tibbi

tibbi Oct 6, 2012

the suggested fix works fine

tibbi commented Oct 6, 2012

the suggested fix works fine

@SgT-Fatality

This comment has been minimized.

Show comment
Hide comment
@SgT-Fatality

SgT-Fatality Oct 6, 2012

@Subv Alright, thanks a lot for your explanations !

@Subv Alright, thanks a lot for your explanations !

@ghost ghost assigned Star-lion Nov 24, 2012

@Expecto

This comment has been minimized.

Show comment
Hide comment
@Expecto

Expecto Dec 3, 2012

confirm

Expecto commented Dec 3, 2012

confirm

@Nevadas

This comment has been minimized.

Show comment
Hide comment
@Nevadas

Nevadas Jan 2, 2013

Any News about this? Can it pushed?

Nevadas commented Jan 2, 2013

Any News about this? Can it pushed?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 9, 2013

Thx SgT-Fatality, I test and work very fine ^^
pls implement inside the repository :P

ghost commented Feb 9, 2013

Thx SgT-Fatality, I test and work very fine ^^
pls implement inside the repository :P

@SgT-Fatality

This comment has been minimized.

Show comment
Hide comment
@SgT-Fatality

SgT-Fatality Feb 17, 2013

You're welcome ;)

You're welcome ;)

@DDuarte DDuarte closed this in 8e8617c Mar 9, 2013

DDuarte added a commit to raczman/TrinityCore that referenced this issue Apr 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment