diff --git a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp
index ce621e689c..0a4b6c3f32 100644
--- a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp
@@ -1,10 +1,27 @@
+/*
+ * Copyright (C) 2008-2010 Trinity
+ * Copyright (C) 2005-2009 MaNGOS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include "ObjectMgr.h"
#include "AuctionHouseMgr.h"
#include "AuctionHouseBot.h"
#include
-
-
using namespace std;
vector npcItems;
vector lootItems;
@@ -22,6 +39,7 @@ vector blueItemsBin;
vector purpleItemsBin;
vector orangeItemsBin;
vector yellowItemsBin;
+
AuctionHouseBot::AuctionHouseBot()
{
debug_Out = false;
@@ -1509,6 +1527,7 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char*
uint32 maxItems = (uint32) strtoul(param1, NULL, 0);
CharacterDatabase.PExecute("UPDATE auctionhousebot SET maxitems = '%u' WHERE auctionhouse = '%u'", maxItems, ahMapID);
config->SetMaxItems(maxItems);
+ config->CalculatePercents();
}
break;
case 3: //min time Deprecated (Place holder for future commands)
diff --git a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h
index 853955a43a..d1cec5f170 100644
--- a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h
+++ b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h
@@ -1,3 +1,22 @@
+/*
+ * Copyright (C) 2008-2010 Trinity
+ * Copyright (C) 2005-2009 MaNGOS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#ifndef AUCTION_HOUSE_BOT_H
#define AUCTION_HOUSE_BOT_H
@@ -173,7 +192,8 @@ public:
void SetMaxItems(uint32 value)
{
maxItems = value;
- CalculatePercents();
+ // CalculatePercents() needs to be called, but only if
+ // SetPercentages() has been called at least once already.
}
uint32 GetMaxItems()
{