Jump to content

[fix typo][7375] Unit::GetDynObject


pasdVn

Recommended Posts

This function currently returns only the first element of the list or NULL. Fixing this will make it e.g possible to let one unit have more than one persistent area auras. In detail this are spells like Hurricane orFrost Trap (or of course casting more spells with those auras at once).

From c024a2c84d1886a1fa1a05a1fca74247dbfb8e82 Mon Sep 17 00:00:00 2001
From: pasdVn <[email protected]>
Date: Tue, 3 Mar 2009 14:57:17 +0100
Subject: [PATCH] fixed typo in Unit::GetDynObject

---
src/game/Unit.cpp |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index aaeece8..f9a4f48 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4034,7 +4034,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId, uint32 effIndex)
{
    for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end()
    {
-        DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*m_dynObjGUIDs.begin());
+        DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*i);
        if(!dynObj)
        {
            i = m_dynObjGUIDs.erase(i);
-- 
1.6.0.2.1172.ga5ed0

Note for people who want to try this: I know that you will see now (e.g. for the frost trap effect) three times the buff icon at the target. That is another bug ;) I think every spell shoul only have one dynObject (maximum), even if it uses more than one persistent area aura (so just one container for all auras).

Link to comment
Share on other sites

Agree, fixes can applied step by step without dependent if in general view something lookup as step back.

General program correctness is sum of local correct code patchs. In defferent "just work by chance" way.

Applied in [7375] and mangos-0.12. Thank you :)

Note: in reallity this need fix in 3 functions instead single ;)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use