all warnings from Wunused
and some from Wall
cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code
for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint
also note for coding:
if you do something like
if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)
Signed-off-by: balrok <der-coole-carl@gmx.net>
Rename m_TeamScores500disadvantage to m_TeamScores500Disadvantage, and optimize its update.
Patch is tested.
Signed-off-by: Triply <triply@getmangos.com>
* Introduced new table character_battleground_data
* Entry point is now stored on BG enter event not join event
* Entry point for dungeons is now correctly set to nearest graveyard
(this prevent well known assert in GetInstance because of porting to already destroyed instance)
* Teleporting from BG correctly restore mount state
* Teleporting from BG correctly restore taxi flight
(in multipath flight you will end up in nearest transition point on the route)
Signed-off-by: ApoC <apoc@nymfe.net>
* Fixed leak in BattleGround::m_PlayerScores at BattleGround::Reset,
add and use BattleGroundScoreMap typedef
* Delete AreaTeam objects stored in global map at shutdown
* Delete Corpse objects stored in global map at shutdown
* Store guild bank log entries as objectes instead pointers in log event lists
* including new achievement createria data type ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE
Note: Some achivement creteria for success need data in `achievement_criteria_data`
score is used in every battleground (not arena)
so we can use it as a virtual variable to access
it also from BattleGround-class
Signed-off-by: balrok <der-coole-carl@gmx.net>
* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
* Create Gameobject version to make GO with owner more safe for remove
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Also added ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE and support
this criteira special cases base at `achievement_criteria_data`
that required DB support.
* Replace platform seelction MaNGOS code for select format descriptor for uint64 by using ACE define.
I64FMTD renamed to UI64FMTD for more clear name.
* Add new define UI64LIT (base at ACE seelction) for build portables uint64 literals.
Please always use UI64LIT(0x00001) instead less portable 0x00001LL
* Save temporary unsummoned pet to current slot (instead non_in_slot mode) and
prevent save as current pet summoned while temporay unsummon (arena)
* Prevent overwrite temporary summoned pet data
* At player loading set temporary unsummoned pet data instead pet loading
if pet expected to be temporary unsummoned in current player state (loading in taxi flight/etc)
* Restore proper pet at arena leave and unsummon in arena summoned.
Moved method BattleGroundMrg::InvitePlayer to BattleGroundQueue::InviteGroupToBG
Added some comments to RemindInvite and RemoveInvite events.
Optimalise code.
Signed-off-by: Triply <triply@getmangos.com>
Fix: Do not allow to remove insignia from players in arena!
Fixed ending arena match when last player of team logs out.
Signed-off-by: Triply <triply@getmangos.com>
Patch is tested, but can cause problems / unexpected behaviour.
TODO: set raid leader of battleground raid to raid leader who entered BG
TODO: when player leaves group, he is removed from GroupQueueInfo, and for him is created new GroupQueueInfo in normal queue.
Signed-off-by: Triply <triply@getmangos.com>
Probably fixed bug with not ending battlegrounds - reported in previous commit message
Fixed player will loose arena rating if
1. he doesn't click on enter rated arena window - and timer will expire
2. he logs out during time he is invited to rated arena match
3. if he logs out during fight in rated arena match
Patch is not tested, i will test it as soon as possible.
Signed-off-by: Triply <triply@getmangos.com>
Fixed typo with BattleGroundPlayerMap.
Optimized implementation for removing offline players from battleground.
Fixed typo in BattleGroundMgr::DeleteAllBattleGrounds.
Patch is tested and should work.
TODO there is a bug if you disable premature finish timer, that can cause battlegrounds to be never ending!
TODO rewrite BattleGround::RemovePlayer function - and fix bugs there!
I might not have today enough time to fix those bugs.
Signed-off-by: Triply <triply@getmangos.com>
Note:
1) CHAT_MSG_BG_SYSTEM_NEUTRAL not dependent from target guid so use SendMessageToAll
and cleanup code
2) BattleGround.cpp now not dependent from Chat.h
this is done by this script:
ack -c "World.h" | ack :1 | sed 's/:1//' | xargs grep -c sWorld | grep :0 | sed 's/:0//' | xargs sed -i '/#include "World.h"/d'
i didn't checked every change but gcc haven't complained
Fixed message color for premature finish warnings.
Fixed .debug bg command won't allow 1v0 arenas now, only battlegrounds 1v0.
Added battleground announcer message removed in [7384].
Patch is tested, everything worked for me. You must execute attached sql file!
Signed-off-by: Triply <triply@getmangos.com>
Fixed problem that queues doesn't invite new players to already running battlegrounds.
Some other fixes for announce system will be soon.
Signed-off-by: Triply <triply@getmangos.com>
Added 2 new config options - InvitationType and PremadeGroupWaitForMatch - you can find more info in default config file.
This patch can cause crashes.
Signed-off-by: Triply <triply@getmangos.com>