fix(gobject): elevator bug + prevent bugs related to faction and flags (#1402)
- Closes #1396
This commit is contained in:
@@ -1890,7 +1890,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// xinef: set faction of gameobject, if no faction - assume hostile
|
// xinef: set faction of gameobject, if no faction - assume hostile
|
||||||
trigger->setFaction(GetGOInfo()->faction ? GetGOInfo()->faction : 14);
|
trigger->setFaction(GetTemplateAddon() && GetTemplateAddon()->faction ? GetTemplateAddon()->faction : 14);
|
||||||
// Set owner guid for target if no owner availble - needed by trigger auras
|
// Set owner guid for target if no owner availble - needed by trigger auras
|
||||||
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
|
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
|
||||||
// xinef: set proper orientation, fixes cast against stealthed targets
|
// xinef: set proper orientation, fixes cast against stealthed targets
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ struct GameObjectTemplate
|
|||||||
std::string IconName;
|
std::string IconName;
|
||||||
std::string castBarCaption;
|
std::string castBarCaption;
|
||||||
std::string unk1;
|
std::string unk1;
|
||||||
uint32 faction;
|
|
||||||
uint32 flags;
|
|
||||||
float size;
|
float size;
|
||||||
union // different GO types have different data field
|
union // different GO types have different data field
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -700,8 +700,11 @@ bool StaticTransport::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 ph
|
|||||||
|
|
||||||
SetObjectScale(goinfo->size);
|
SetObjectScale(goinfo->size);
|
||||||
|
|
||||||
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
|
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||||
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
|
{
|
||||||
|
SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
|
||||||
|
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||||
|
}
|
||||||
|
|
||||||
SetEntry(goinfo->entry);
|
SetEntry(goinfo->entry);
|
||||||
SetName(goinfo->name);
|
SetName(goinfo->name);
|
||||||
|
|||||||
Reference in New Issue
Block a user