aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-20 16:06:03 -0500
committermegamage <none@none>2009-08-20 16:06:03 -0500
commit5f04f0c1f02ae3029ff9db47b242071774cb7c15 (patch)
tree2df00961df2019daf7bc05adb8482817e9c83afb /src
parent6606a82509d76b9afb57a2ed664355ba3f179dd6 (diff)
*Only allow to build new vehicles during wartime in wintergrasp.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Wintergrasp.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 486d8ed383e..a6b633cfa21 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -380,13 +380,14 @@ void OPvPWintergrasp::OnCreatureCreate(Creature *creature, bool add)
{
if(add)
{
- if(workshop->m_vehicles.size() >= MAX_VEHICLE_PER_WORKSHOP)
+ if(m_wartime && workshop->m_vehicles.size() < MAX_VEHICLE_PER_WORKSHOP)
+ workshop->m_vehicles.insert((Vehicle*)creature);
+ else
{
creature->setDeathState(DEAD);
creature->SetRespawnTime(DAY);
return;
- }
- workshop->m_vehicles.insert((Vehicle*)creature);
+ }
}
// TODO: now you have to wait until the corpse of vehicle disappear to build a new one
else if(!workshop->m_vehicles.erase((Vehicle*)creature))
@@ -768,7 +769,7 @@ uint32 OPvPWintergrasp::GetData(uint32 id)
{
// if can build more vehicles
if(SiegeWorkshop *workshop = GetWorkshopByEngGuid(id))
- return workshop->m_vehicles.size() < MAX_VEHICLE_PER_WORKSHOP ? 1 : 0;
+ return m_wartime && workshop->m_vehicles.size() < MAX_VEHICLE_PER_WORKSHOP ? 1 : 0;
return 0;
}