Jump to content

[fix] TemporarySummons


pasdVn

Recommended Posts

Having a look at the description of TempSummonTypes in Object.h and the calculation of the despawn time in TemporarySummon::Update, you may notice that TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN and TEMPSUMMON_TIMED_OR_DEAD_DESPAWN doing not the same as the description says. Looks like somebody copy'n'pasted here and forgot to modify!?

From 6944453630754217f38115e1118c5b9ac3ef2160 Mon Sep 17 00:00:00 2001
From: pasdVn <[email protected]>
Date: Fri, 12 Mar 2010 18:34:11 +0100
Subject: [PATCH] Fixed despawn logic of some temporary summons.

---
src/game/TemporarySummon.cpp |   30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp
index 09c0661..7977eb9 100644
--- a/src/game/TemporarySummon.cpp
+++ b/src/game/TemporarySummon.cpp
@@ -104,18 +104,13 @@ void TemporarySummon::Update( uint32 diff )
                return;
            }

-            if (!isInCombat())
+            if (m_timer <= diff)
            {
-                if (m_timer <= diff)
-                {
-                    UnSummon();
-                    return;
-                }
-                else
-                    m_timer -= diff;
+                UnSummon();
+                return;
            }
-            else if (m_timer != m_lifetime)
-                m_timer = m_lifetime;
+            else
+                m_timer -= diff;
            break;
        }
        case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
@@ -127,18 +122,13 @@ void TemporarySummon::Update( uint32 diff )
                return;
            }

-            if (!isInCombat() && isAlive() )
+            if (m_timer <= diff)
            {
-                if (m_timer <= diff)
-                {
-                    UnSummon();
-                    return;
-                }
-                else
-                    m_timer -= diff;
+                UnSummon();
+                return;
            }
-            else if (m_timer != m_lifetime)
-                m_timer = m_lifetime;
+            else
+                m_timer -= diff;
            break;
        }
        default:
-- 
1.6.5.1.1367.gcd48

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