View Single Post
  #1  
Old 08-13-2012, 04:53 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default COMMITTED: Extended Targets Clearing Targets

Targets should be removed after losing aggro with various skills (FM/FD/Escape)

Code:
Index: EQEmuServer/zone/AA.cpp
===================================================================
--- EQEmuServer/zone/AA.cpp     (revision 2184)
+++ EQEmuServer/zone/AA.cpp     (working copy)
@@ -480,7 +480,7 @@
                        break;

                case aaActionFadingMemories:
-                       entity_list.RemoveFromTargets(this);
+                       entity_list.RemoveFromTargets(this, true);
                        SetInvisible(1);
                        break;
Index: EQEmuServer/zone/entity.cpp
===================================================================
--- EQEmuServer/zone/entity.cpp (revision 2184)
+++ EQEmuServer/zone/entity.cpp (working copy)
@@ -1388,8 +1388,12 @@

                m->RemoveFromHateList(mob);

-               if(RemoveFromXTargets && m->IsClient())
-                       m->CastToClient()->RemoveXTarget(mob, false);
+               if(RemoveFromXTargets)
+                       if(m->IsClient())
+                               m->CastToClient()->RemoveXTarget(mob, false);
+                       // FadingMemories calls this function passing the client.
+                       else if(mob->IsClient())
+                               mob->CastToClient()->RemoveXTarget(m, false);

        }
 }
@@ -3231,10 +3235,10 @@
                        // For client targets if the mob that hated us is 35+
                        // there is a 3 outta 5 chance he adds us to feign memory
                        if(targ->IsClient()){
-                               if (iterator.GetData()->GetLevel() >= 35){
-                                       if(MakeRandomInt(1,100)<=60){
-                                               iterator.GetData()->AddFeignMemory(targ->CastToClient());
-                                       }
+                               if (iterator.GetData()->GetLevel() >= 35 && (MakeRandomInt(1,100)<=60)){
+                                       iterator.GetData()->AddFeignMemory(targ->CastToClient());
+                               } else {
+                                       targ->CastToClient()->RemoveXTarget(iterator.GetData(), false);
                                }
                        }
                }
@@ -3249,6 +3253,7 @@
        while(iterator.MoreElements())
        {
                iterator.GetData()->RemoveFromFeignMemory(targ);
+               targ->CastToClient()->RemoveXTarget(iterator.GetData(), false);
                iterator.Advance();
        }
 }

Last edited by cavedude; 09-13-2012 at 01:46 PM..
Reply With Quote