From 734f720aca5c21507155cfb24c253f58878b7a6e Mon Sep 17 00:00:00 2001 From: Salja Date: Sun, 25 Jan 2015 22:47:16 +0100 Subject: [PATCH] add player and item to auctionshouse hooks, not sure is better move back to player events ? Signed-off-by: Salja --- Hooks.h | 4 ++-- LuaEngine.h | 4 ++-- ServerHooks.cpp | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Hooks.h b/Hooks.h index 24aeee8..5319f4c 100644 --- a/Hooks.h +++ b/Hooks.h @@ -136,8 +136,8 @@ namespace Hooks WEATHER_EVENT_ON_CHANGE = 25, // (event, zoneId, state, grade) // Auction house - AUCTION_EVENT_ON_ADD = 26, // (event, AHObject) - AUCTION_EVENT_ON_REMOVE = 27, // (event, AHObject) + AUCTION_EVENT_ON_ADD = 26, // (event, AHObject, player, item) + AUCTION_EVENT_ON_REMOVE = 27, // (event, AHObject, player, item) AUCTION_EVENT_ON_SUCCESSFUL = 28, // (event, AHObject) // Not Implemented AUCTION_EVENT_ON_EXPIRE = 29, // (event, AHObject) // Not Implemented diff --git a/LuaEngine.h b/LuaEngine.h index f106a70..63df6c3 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -442,8 +442,8 @@ public: void OnChange(Weather* weather, uint32 zone, WeatherState state, float grade); /* Auction House */ - void OnAdd(AuctionHouseObject* auctionHouse); - void OnRemove(AuctionHouseObject* auctionHouse); + void OnAdd(AuctionHouseObject* auctionHouse, Player* pPlayer, Item* pItem); + void OnRemove(AuctionHouseObject* auctionHouse, Player* pPlayer, Item* pItem); void OnSuccessful(AuctionHouseObject* auctionHouse); void OnExpire(AuctionHouseObject* auctionHouse); diff --git a/ServerHooks.cpp b/ServerHooks.cpp index 6391556..12ec26a 100644 --- a/ServerHooks.cpp +++ b/ServerHooks.cpp @@ -82,23 +82,27 @@ void Eluna::OnChange(Weather* weather, uint32 zone, WeatherState state, float gr } // Auction House -void Eluna::OnAdd(AuctionHouseObject* ah) +void Eluna::OnAdd(AuctionHouseObject* ah, Player* pPlayer, Item* pItem) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_ADD)) return; LOCK_ELUNA; Push(ah); + Push(pPlayer); + Push(pItem); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_ADD); } -void Eluna::OnRemove(AuctionHouseObject* ah) +void Eluna::OnRemove(AuctionHouseObject* ah, Player* pPlayer, Item* pItem) { if (!ServerEventBindings->HasEvents(AUCTION_EVENT_ON_REMOVE)) return; LOCK_ELUNA; Push(ah); + Push(pPlayer); + Push(pItem); CallAllFunctions(ServerEventBindings, AUCTION_EVENT_ON_REMOVE); }