Prince
-
Posts
15 -
Joined
-
Last visited
Never -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Posts posted by Prince
-
-
Ok, thanks. I'll think about it and try to give the players in Ahn'kahet the Jedoga additional achievement via Player::UpdateAchievementCriteria...
-
Hello!
I would like to use code like this (Ahn'kahet example) for instance achievements:
if (!onedead) { /* Nicht möglich, da "CompletedAchievement()" privat ist! AchievementEntry const* AE = sAchievementStore.LookupEntry(AchievementVolunteerWork); Map::PlayerList const &PlayerList = instance->GetPlayers(); if (!PlayerList.isEmpty()) { for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) (i->getSource())->GetAchievementMgr().CompletedAchievement(AE); }*/ }
the problem is that CompletedAchievement() is a private function. Couldn't / shouldn't we not simple make it public to let developer use this in instance scripts!? :confused:
-
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...
-
edit: well here it is, if it's get outdated, don't blame me;
of course not. thank you!
-
could someone generate a patch for the latest rev and post it here, thanks?!
-
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).
-
first post updated with the working patch again.
-
"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.
-
" && !cVictim->loot.empty()" seems not to work and looks that the loot is created later somewhere in the source. don't know where atm. :confused: simply remove " && !cVictim->loot.empty()" again out of the patch and it works again.
-
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.
-
-
deeper look -> more simple (correct) fix found. see first post.
-
simple... it was a fast search for the flag and this was the second occurence of this flag and the first place where i could fix it. perhaps i'll look later for a better position...
-
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
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())
Linux crash dumps
in OldBug reports
Posted
could someone finally stop this spamer, thanks?! it can't be that one guy post one crash hundrets of times! :mad: