aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/GarrisonHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-05-11 18:23:43 +0200
committerShauren <shauren.trinity@gmail.com>2015-05-11 18:23:43 +0200
commit9d4c568596fbfe911f0edb0a92d75b175ad900af (patch)
tree3929f57e05516380953a25829c30376ec39291a4 /src/server/game/Handlers/GarrisonHandler.cpp
parent3c79914e7b01a44bd5b34f7728e5cb575fa48723 (diff)
Core/Garrisons: Added more building checks and implemented canceling building construction
Diffstat (limited to 'src/server/game/Handlers/GarrisonHandler.cpp')
-rw-r--r--src/server/game/Handlers/GarrisonHandler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Handlers/GarrisonHandler.cpp b/src/server/game/Handlers/GarrisonHandler.cpp
index 0b45fb0ab57..54c7f4242fd 100644
--- a/src/server/game/Handlers/GarrisonHandler.cpp
+++ b/src/server/game/Handlers/GarrisonHandler.cpp
@@ -34,6 +34,15 @@ void WorldSession::HandleGarrisonPurchaseBuilding(WorldPackets::Garrison::Garris
garrison->PlaceBuilding(garrisonPurchaseBuilding.PlotInstanceID, garrisonPurchaseBuilding.BuildingID);
}
+void WorldSession::HandleGarrisonCancelConstruction(WorldPackets::Garrison::GarrisonCancelConstruction& garrisonCancelConstruction)
+{
+ if (!_player->GetNPCIfCanInteractWith(garrisonCancelConstruction.NpcGUID, UNIT_NPC_FLAG_GARRISON_ARCHITECT))
+ return;
+
+ if (Garrison* garrison = _player->GetGarrison())
+ garrison->CancelBuildingConstruction(garrisonCancelConstruction.PlotInstanceID);
+}
+
void WorldSession::HandleGarrisonRequestBlueprintAndSpecializationData(WorldPackets::Garrison::GarrisonRequestBlueprintAndSpecializationData& /*garrisonRequestBlueprintAndSpecializationData*/)
{
if (Garrison* garrison = _player->GetGarrison())