From ce9815d5572974adbd5d7120fcb7628ed3116d12 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 12 Apr 2018 10:00:08 -0400 Subject: [PATCH] Core/GameObjects: Set GO_FLAG_MAP_OBJECT for gameobjects that use a WMO model --- Source/Game/Collision/Models/GameObjectModel.cs | 2 +- Source/Game/Entities/GameObject/GameObject.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Game/Collision/Models/GameObjectModel.cs b/Source/Game/Collision/Models/GameObjectModel.cs index d74b40706..7a4b15880 100644 --- a/Source/Game/Collision/Models/GameObjectModel.cs +++ b/Source/Game/Collision/Models/GameObjectModel.cs @@ -177,7 +177,7 @@ namespace Game.Collision public void enableCollision(bool enable) { _collisionEnabled = enable; } bool isCollisionEnabled() { return _collisionEnabled; } - bool isMapObject() { return isWmo; } + public bool isMapObject() { return isWmo; } public static void LoadGameObjectModelList() { diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 7f2b00f01..76cf59d2f 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -266,6 +266,9 @@ namespace Game.Entities SetDisplayId(goInfo.displayId); m_model = CreateModel(); + if (m_model != null && m_model.isMapObject()) + SetFlag(GameObjectFields.Flags, GameObjectFlags.MapObject); + // GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3 SetGoType(goInfo.type); m_prevGoState = goState; @@ -2360,6 +2363,8 @@ namespace Game.Entities m_model = CreateModel(); if (m_model != null) GetMap().InsertGameObjectModel(m_model); + + ApplyModFlag(GameObjectFields.Flags, GameObjectFlags.MapObject, m_model != null && m_model.isMapObject()); } Player GetLootRecipient()