[7401] Fixed bgqueue invitation to already started battlegrounds - not tested.

Finally fixed sql update in [7399]. Thx to Lake292.

Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
Triply 2009-03-07 17:51:21 +01:00
parent f64341068b
commit 898fef99d2
4 changed files with 13 additions and 7 deletions

View file

@ -1,3 +1,6 @@
ALTER TABLE db_version CHANGE COLUMN required_7393_01_mangos_game_event required_7399_01_mangos_mangos_string bit;
DELETE FROM mangos_string WHERE entry in (753, 754, 755);
INSERT INTO mangos_string VALUES (753,'The battle for Warsong Gulch begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO mangos_string VALUES (753,'The battle for Warsong Gulch begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO mangos_string VALUES (754,'The battle for Arathi Basin begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO mangos_string VALUES (754,'The battle for Arathi Basin begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO mangos_string VALUES (755,'The battle for Eye of the Storm begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO mangos_string VALUES (755,'The battle for Eye of the Storm begins in 2 minutes.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

View file

@ -194,6 +194,7 @@ pkgdata_DATA = \
7388_01_mangos_mangos_string.sql \ 7388_01_mangos_mangos_string.sql \
7390_01_mangos_areatrigger_teleport.sql \ 7390_01_mangos_areatrigger_teleport.sql \
7393_01_mangos_game_event.sql \ 7393_01_mangos_game_event.sql \
7399_01_mangos_mangos_string.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'

View file

@ -81,7 +81,7 @@ void BattleGroundQueue::SelectionPool::Init()
// remove group info from selection pool // remove group info from selection pool
// returns true when we need to try to add new group to selection pool // returns true when we need to try to add new group to selection pool
// or false when pool is ok // returns false when selection pool is ok or when we kicked smaller group than we need to kick
// sometimes it can be called on empty selection pool // sometimes it can be called on empty selection pool
bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size) bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
{ {
@ -105,7 +105,8 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
GroupQueueInfo* ginfo = (*groupToKick); GroupQueueInfo* ginfo = (*groupToKick);
SelectedGroups.erase(groupToKick); SelectedGroups.erase(groupToKick);
PlayerCount -= ginfo->Players.size(); PlayerCount -= ginfo->Players.size();
if (abs((int32)(ginfo->Players.size() - size)) <= 1) //return false if we kicked smaller group or there are enough players in selection pool
if (ginfo->Players.size() <= size + 1)
return false; return false;
} }
return true; return true;
@ -113,8 +114,8 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size)
// add group to selection pool // add group to selection pool
// used when building selection pools // used when building selection pools
// returns true if we can invite more players // returns true if we can invite more players, or when we added group to selection pool
// returns false when selection pool is set // returns false when selection pool is full
bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount) bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 desiredCount)
{ {
//if group is larger than desired count - don't allow to add it to pool //if group is larger than desired count - don't allow to add it to pool
@ -123,6 +124,7 @@ bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 de
SelectedGroups.push_back(ginfo); SelectedGroups.push_back(ginfo);
// increase selected players count // increase selected players count
PlayerCount += ginfo->Players.size(); PlayerCount += ginfo->Players.size();
return true;
} }
if( PlayerCount < desiredCount ) if( PlayerCount < desiredCount )
return true; return true;
@ -499,7 +501,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel
//if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break; //if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break;
if( !m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() ) if( !m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() )
{ {
if( aliFree <= diffHorde - 1 ) if( aliFree <= diffHorde + 1 )
break; break;
m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffHorde - diffAli); m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffHorde - diffAli);
} }
@ -514,7 +516,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BGQueueIdBasedOnLevel
} }
if( !m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() ) if( !m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() )
{ {
if( hordeFree <= diffAli - 1 ) if( hordeFree <= diffAli + 1 )
break; break;
m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffAli - diffHorde); m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffAli - diffHorde);
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7400" #define REVISION_NR "7401"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__