From 223967b80d783df1be2df5f74ddf198f373fbc57 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 12 Jun 2012 21:30:32 +0000 Subject: Added working crafting hooks HOOK_PRE_CRAFTING, HOOK_CRAFTING_NO_RECIPE and HOOK_POST_CRAFTING git-svn-id: http://mc-server.googlecode.com/svn/trunk@598 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cCraftingWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/cCraftingWindow.cpp') diff --git a/source/cCraftingWindow.cpp b/source/cCraftingWindow.cpp index c84121a06..570f1ed9a 100644 --- a/source/cCraftingWindow.cpp +++ b/source/cCraftingWindow.cpp @@ -73,7 +73,7 @@ void cCraftingWindow::Clicked( cPacket_WindowClick* a_ClickPacket, cPlayer & a_P cCraftingGrid Grid(GetSlots() + 1, 3, 3); cCraftingRecipe Recipe(Grid); - cRoot::Get()->GetCraftingRecipes()->GetRecipe(Grid, Recipe); + cRoot::Get()->GetCraftingRecipes()->GetRecipe(&a_Player, Grid, Recipe); if ((a_ClickPacket->m_SlotNum == 0) && !bDontCook) { @@ -84,10 +84,10 @@ void cCraftingWindow::Clicked( cPacket_WindowClick* a_ClickPacket, cPlayer & a_P Grid.CopyToItems(GetSlots() + 1); // Get the recipe for the new grid contents: - cRoot::Get()->GetCraftingRecipes()->GetRecipe(Grid, Recipe); + cRoot::Get()->GetCraftingRecipes()->GetRecipe(&a_Player, Grid, Recipe); } *GetSlot(0) = Recipe.GetResult(); - LOGD("You cooked: %i x %i !!", GetSlot(0)->m_ItemID, GetSlot(0)->m_ItemCount ); + LOGD("%s cooked: %i x %i !!", a_Player.GetName().c_str(), GetSlot(0)->m_ItemID, GetSlot(0)->m_ItemCount ); } SendWholeWindow( a_Player.GetClientHandle() ); a_Player.GetInventory().SendWholeInventory( a_Player.GetClientHandle() ); -- cgit v1.2.3