Log in

View Full Version : Swarm Pets Not Giving Experience


NatedogEZ
08-14-2013, 09:05 AM
Not sure if this is intended? But swarm pets will allow loot but do not grant experience

Here is what I changed to fix it.

attack.cpp line 2088 (OLD CODE)


if(give_exp && give_exp->HasOwner()) {




attack.cpp line 2088 (REPLACE WITH THIS)


if(give_exp && give_exp->HasOwner() || (give_exp && entity_list.GetMob(give_exp->CastToNPC()->GetSwarmOwner()))) {



Swarmpets do not "HasOwner" so they never passed that check but later in the code it was correct for allowing loot.

With this fix they will correctly give loot and EXP! (if the swarmpet out damages the group that is they are currently Kill stealing EXP ONLY ... loot is fine)

I would submit this myself but my GitHub keeps giving me errors :(

wolfwalkereci
08-14-2013, 10:56 AM
Didn't you say you installed TortoiseGit? Right click the top level folder and choose TortoiseGit->Diff
More people will care if you submit in that format. Cheers mate.

NatedogEZ
08-14-2013, 11:50 AM
Like this? :p



zone/attack.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zone/attack.cpp b/zone/attack.cpp
index 61da974..6886b70 100644
--- a/zone/attack.cpp
+++ b/zone/attack.cpp
@@ -2126,7 +2126,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ski
if(give_exp == nullptr)
give_exp = killer;

- if(give_exp && give_exp->HasOwner()) {
+ if(give_exp && give_exp->HasOwner() || (give_exp && entity_list.GetMob(give_exp->CastToNPC()->GetSwarmOwner()))) {

bool ownerInGroup = false;
if((give_exp->HasGroup() && give_exp->GetGroup()->IsGroupMember(give_exp->GetUltimateOwner()))

wolfwalkereci
08-14-2013, 07:44 PM
Hey you know I dont mind find/replacing but the big boys and girls around here prefer that there .diff/.patch file if you know what I mean ;)

sorvani
08-15-2013, 02:37 AM
Actually, with git, it is better to simply create a pull request. Then the change can be immediately applied by someone with commit rights.