mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 10:37:01 +00:00
[11356] Some cleanup of JUST_ALIVED for creature and add comments.
Also restore npcflags after LoadCreatureAddon. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
adcb84a325
commit
520f420aed
2 changed files with 14 additions and 5 deletions
|
|
@ -1489,13 +1489,12 @@ void Creature::SetDeathState(DeathState s)
|
||||||
|
|
||||||
if (s == JUST_ALIVED)
|
if (s == JUST_ALIVED)
|
||||||
{
|
{
|
||||||
|
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||||
|
|
||||||
SetHealth(GetMaxHealth());
|
SetHealth(GetMaxHealth());
|
||||||
SetLootRecipient(NULL);
|
SetLootRecipient(NULL);
|
||||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
|
||||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
|
||||||
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
|
||||||
AddSplineFlag(SPLINEFLAG_WALKMODE);
|
AddSplineFlag(SPLINEFLAG_WALKMODE);
|
||||||
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
|
||||||
|
|
||||||
if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
|
if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
|
||||||
ClearTemporaryFaction();
|
ClearTemporaryFaction();
|
||||||
|
|
@ -1504,8 +1503,18 @@ void Creature::SetDeathState(DeathState s)
|
||||||
|
|
||||||
clearUnitState(UNIT_STAT_ALL_STATE);
|
clearUnitState(UNIT_STAT_ALL_STATE);
|
||||||
i_motionMaster.Clear();
|
i_motionMaster.Clear();
|
||||||
|
|
||||||
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
||||||
|
|
||||||
|
// Dynamic flags may be adjusted by spells. Clear them
|
||||||
|
// first and let spell from *addon apply where needed.
|
||||||
|
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||||
LoadCreatureAddon(true);
|
LoadCreatureAddon(true);
|
||||||
|
|
||||||
|
// Flags after LoadCreatureAddon. Any spell in *addon
|
||||||
|
// will not be able to adjust these.
|
||||||
|
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
||||||
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11355"
|
#define REVISION_NR "11356"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue