EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Swarm Pets Not Giving Experience (https://www.eqemulator.org/forums/showthread.php?t=37175)

NatedogEZ 08-14-2013 09:05 AM

Swarm Pets Not Giving Experience
 
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)
Code:


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


attack.cpp line 2088 (REPLACE WITH THIS)
Code:


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


Code:

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.


All times are GMT -4. The time now is 12:49 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.