Skip to content

Commit

Permalink
[12442] Reorder handling in Creature::SetDeathState(JUST_ALIVE) case
Browse files Browse the repository at this point in the history
This will behave more logical in case of root/stunn or similar auras which are to be loaded by _addon tables
  • Loading branch information
Schmoozerd committed Apr 6, 2013
1 parent e91ad73 commit 097f902
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/game/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,21 +1551,16 @@ void Creature::SetDeathState(DeathState s)

if (s == JUST_ALIVED)

This comment has been minimized.

Copy link
@DasBlub

DasBlub Apr 7, 2013

Member

"ALIVED"? ouch! renglish?

This comment has been minimized.

Copy link
@DomGries

DomGries Apr 7, 2013

Contributor

renglish? we dont have that.. https://gist.github.com/stfx/3390562 *cough

{
CreatureInfo const* cinfo = GetCreatureInfo();
clearUnitState(UNIT_STAT_ALL_STATE);

Unit::SetDeathState(ALIVE);

SetHealth(GetMaxHealth());
SetLootRecipient(NULL);
SetWalk(true, true);

if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
ClearTemporaryFaction();

Unit::SetDeathState(ALIVE);

clearUnitState(UNIT_STAT_ALL_STATE);
i_motionMaster.Initialize();

SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
SetMeleeDamageSchool(SpellSchools(GetCreatureInfo()->dmgschool));

// Dynamic flags may be adjusted by spells. Clear them
// first and let spell from *addon apply where needed.
Expand All @@ -1574,8 +1569,11 @@ void Creature::SetDeathState(DeathState s)

// Flags after LoadCreatureAddon. Any spell in *addon
// will not be able to adjust these.
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
SetUInt32Value(UNIT_NPC_FLAGS, GetCreatureInfo()->npcflag);
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);

SetWalk(true, true);
i_motionMaster.Initialize();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12441"
#define REVISION_NR "12442"
#endif // __REVISION_NR_H__

0 comments on commit 097f902

Please sign in to comment.