Jump to content

[8285][patch] don't show creature as lootable without loot


Auntie Mangos

Recommended Posts

This patch should be accepted becouse:

1. According to http://getmangos.eu/community/showthread.php?p=81340#post81340

there is a chance (small) to have a empty loot with "loot animation".

2. In mangos u can loot everybody (which is wrong)....

Prince patch solve problem with all creatures which havent got loot (not lootable) or summoned etc.... there is no sparkle and finally u cant loot them ^_^

my 2 cents.

Regards.

Link to comment
Share on other sites

  • 39 years later...

because of this bothers me since mangos was born, i wrote this just in the moment... on offi you'll never get lootable animation for creatures without loot.

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

- it prevent to show the lootable animation for creatures without loot

For which repository revision was the patch created?

- rev 8250

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

- I don't believe it... I don't know...

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

- Prince

THE DIFF

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 0b67a2f..0dfda03 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -647,7 +657,8 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
            if(!cVictim->isPet())
            {
                cVictim->DeleteThreatList();
-                cVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
+                if (cVictim->GetCreatureInfo()->lootid)
+                    cVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
            }
            // Call creature just died function
            if (cVictim->AI())

Link to comment
Share on other sites

I thought about that issue once again and came to the conclusion, that this patch won't completly fix the problem:

If a creature has a lootid and the random loot generation function produces an empty loot, the lootable animation will still show up :(

Link to comment
Share on other sites

I thought about that issue once again and came to the conclusion, that this patch won't completly fix the problem:

If a creature has a lootid and the random loot generation function produces an empty loot, the lootable animation will still show up :(

finally first post edit to solve also this problem. ;)

Link to comment
Share on other sites

"loot" is first created here "void Player::SendLoot(uint64 guid, LootType loot_type)" and this is first executed if the player try to loot the creature.

                if (uint32 lootid = creature->GetCreatureInfo()->lootid)
                   loot->FillLoot(lootid, LootTemplates_Creature, recipient, false);

we have no chance to fix arrai's issue without move the above code to unit atm.

Link to comment
Share on other sites

i'm not sure, but maybe this patch doesn't check if a creature/player has only gold as loot

cause bg-loot is:

bones->loot.gold = 123;

maybe a fix could be:

if (cVictim->GetCreatureInfo()->lootid || cVictim->loot.gold)

(but haven't looked if bones are also a Unit and if it compiles and so on.. just a guess :) )

edit: sorry my idea is wrong - cause cVictim is actually a creature.. so i don't know how it could affect player

Link to comment
Share on other sites

maybe a fix could be:

if (cVictim->GetCreatureInfo()->lootid || cVictim->loot.gold)

(but haven't looked if bones are also a Unit and if it compiles and so on.. just a guess :) )

edit: sorry my idea is wrong - cause cVictim is actually a creature.. so i don't know how it could affect player

no. it's the same problem as with arrais issue. the loot is first created if the player try to loot something. you can't check at this place wether the loot is empty (if there is a loot id) nor if there is gold. that's the problem which i wrote above.

my patch is only for creatures (npcs).

Link to comment
Share on other sites

You should better check:

cVictim->GetCreatureInfo()->lootid || cVictim->GetCreatureInfo()->maxgold > 0

Otherwise creatures that have no loot, but can drop gold will never be lootable.

that's right, thanks. will make an update soon...

Link to comment
Share on other sites

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