Jump to content

Recommended Posts

  • 39 years later...
Posted

What bug does the patch fix? What features does the patch add?

There is an exploit related to loot chests spawned by scripts, like Four Horsemen etc. If the player stands still while looting the chest, chest doesn't disappear after player takes all the loot, and it can be looted again and again, giving new loot, until the player moves.

For which repository revision was the patch created?

8869

Who has been writing this patch? Please include either forum user names or email addresses.

Me, Lutik.

diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 0aa6f7f..4209298 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -431,13 +431,7 @@ void GameObject::Update(uint32 /*p_time*/)
            if(!m_respawnDelayTime)
                return;

-            if(!m_spawnedByDefault)
-            {
-                m_respawnTime = 0;
-                return;
-            }
-
-            m_respawnTime = time(NULL) + m_respawnDelayTime;
+            m_respawnTime = m_spawnedByDefault ? time(NULL) + m_respawnDelayTime : 0;

            // if option not set then object will be saved at grid unload
            if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATLY))

m_spawnedByDefault is false for such chests, and in that case (as you can see in red lines of code) return is called without updating gameobject's visibility (which is located just a few lines below). So, without this patch, the chest remains visible for the player even when it is despawned, until the player moves and visibility update is called for him in some other place.

Posted

Debian Error compile insider42 branche revision 8869

../../../src/game/GameObject.cpp: In member function ‘virtual void GameObject::Update(uint32)’:
../../../src/game/GameObject.cpp:434: error: ‘mSpawnedByDefault’ was not declared in this scope

Posted

- if(!m_spawnedByDefault)

+ m_respawnTime = mSpawnedByDefault ?...

Debian Error compile insider42 branche revision 8869

Yes, just a typo, sorry) Fixed the first post.

  • 4 weeks later...
  • 2 months later...
Posted

This is probably more correct version of the patch:

diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 0bfb0b9..1826608 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -438,7 +438,11 @@ void GameObject::Update(uint32 /*p_time*/)
            if(!m_spawnedByDefault)
            {
                m_respawnTime = 0;
-                return;
+
+                if (IsInWorld())
+                    UpdateObjectVisibility();
+
+                break;
            }

            // since pool system can fail to roll unspawned object, this one can remain spawned, so must set respawn nevertheless

Posted

@alex:

but if the player realy can loot the chests a 2nd time, there is either an exploit that players could loot randomly chests or that the chest isn't despawned from the core point of

view..

or will "updateobjectvisibility" also despawn that gameobject?

  • 2 weeks later...
Posted

I'm using the first version of this patch and it is working, well at least the chest despawn after you loot it, but the chest has like a "free for all" flag to loot, it doesnt respect the loot rules set by the raid leader

  • 1 month later...
  • 3 weeks later...
  • 3 months later...
Posted

Original fix added into [10226]. Thank you.

But note: this fix for visibility refresh but not fix for multi-loot cheating problem as note darkstalker already.

Loot problem must be fixed in normal way how this done for creatures...

Guest
This topic is now closed to further replies.
×
×
  • 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