aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp23
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.h22
2 files changed, 42 insertions, 3 deletions
diff --git a/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp
index ce621e689cd..0a4b6c3f32e 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 <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * 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 <vector>
-
-
using namespace std;
vector<uint32> npcItems;
vector<uint32> lootItems;
@@ -22,6 +39,7 @@ vector<uint32> blueItemsBin;
vector<uint32> purpleItemsBin;
vector<uint32> orangeItemsBin;
vector<uint32> 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 853955a43a0..d1cec5f170e 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 <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
+ *
+ * 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()
{