Core: Prevent critters from rewarding XP.

Also avoid unnecessary XP rate calculations.

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-09-14 00:09:58 +02:00
parent a6efc4dad5
commit 5bd9afb9fa
+4 -2
View File
@@ -166,7 +166,8 @@ namespace Trinity
if (u->GetTypeId() == TYPEID_UNIT &&
(((Creature*)u)->isTotem() || ((Creature*)u)->isPet() ||
(((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)))
(((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ||
((Creature*)u)->GetCreatureInfo()->type == CREATURE_TYPE_CRITTER))
gain = 0;
else
{
@@ -180,9 +181,10 @@ namespace Trinity
else
gain *= 2;
}
}
gain = uint32(gain * sWorld.getRate(RATE_XP_KILL));
}
sScriptMgr.OnGainCalculation(gain, pl, u);
return gain;
}