mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[0063] Fix a bug with SCRIPT_COMMAND_KILL_CREDIT
This bug can happen if a (group) kill credit is provided without involved creature. Thanks to Atari for pointing!
This commit is contained in:
parent
27fefb1e96
commit
aacb838e60
3 changed files with 10 additions and 3 deletions
|
|
@ -1254,7 +1254,12 @@ void ScriptAction::HandleScriptStep()
|
|||
}
|
||||
|
||||
if (m_script->killCredit.isGroupCredit)
|
||||
pPlayer->RewardPlayerAndGroupAtEvent(creatureEntry, pRewardSource);
|
||||
{
|
||||
WorldObject* pSearcher = pRewardSource ? pRewardSource : (pSource ? pSource : pTarget);
|
||||
if (pSearcher != pRewardSource)
|
||||
sLog.outDebug(" DB-SCRIPTS: Process table `%s` id %u, SCRIPT_COMMAND_KILL_CREDIT called for groupCredit without creature as searcher, script might need adjustment.", m_table, m_script->id);
|
||||
pPlayer->RewardPlayerAndGroupAtEvent(creatureEntry, pSearcher);
|
||||
}
|
||||
else
|
||||
pPlayer->KilledMonsterCredit(creatureEntry, pRewardSource ? pRewardSource->GetObjectGuid() : ObjectGuid());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue