Core/Garrisons: Fixed building gameobject id used for buildings under construction when *ConstructionGameObjectID is empty

This commit is contained in:
Shauren
2015-06-29 16:31:29 +02:00
parent d4deb17a2f
commit a51300f814

View File

@@ -691,10 +691,9 @@ GameObject* Garrison::Plot::CreateGameObject(Map* map, GarrisonFactionIndex fact
GarrPlotInstanceEntry const* plotInstance = sGarrPlotInstanceStore.AssertEntry(PacketInfo.GarrPlotInstanceID);
GarrPlotEntry const* plot = sGarrPlotStore.AssertEntry(plotInstance->GarrPlotID);
GarrBuildingEntry const* building = sGarrBuildingStore.AssertEntry(BuildingInfo.PacketInfo->GarrBuildingID);
if (BuildingInfo.PacketInfo->Active)
entry = faction == GARRISON_FACTION_INDEX_HORDE ? plot->HordeConstructionGameObjectID : plot->AllianceConstructionGameObjectID;
if (BuildingInfo.PacketInfo->Active || !entry)
entry = faction == GARRISON_FACTION_INDEX_HORDE ? building->HordeGameObjectID : building->AllianceGameObjectID;
else
entry = faction == GARRISON_FACTION_INDEX_HORDE ? plot->HordeConstructionGameObjectID : plot->AllianceConstructionGameObjectID;
}
if (!sObjectMgr->GetGameObjectTemplate(entry))