Commit graph

77 commits

Author SHA1 Message Date
balrok
bd30769dec [8475] fixed some gcc-warnings
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>
2009-09-05 13:47:47 +02:00
Triply
56ddf40d62 [8474] Allow to delete BattleGround objects when any of invited players didn't click to enter battle.
Rename m_TeamScores500disadvantage to m_TeamScores500Disadvantage, and optimize its update.
Patch is tested.

Signed-off-by: Triply <triply@getmangos.com>
2009-09-05 13:31:40 +02:00
balrok
beae3fe00f [8427] remove afk-flag at bg-join
Signed-off-by: balrok <der-coole-carl@gmx.net>
2009-08-27 12:24:05 +02:00
VladimirMangos
7caf5b5b2f [8344] In case battleground reward items player must "receive" instead "create" item in message. 2009-08-10 15:28:05 +04:00
ApoC
6d9448dd7f [8339] Improved storing/restoring BG entry point
* 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>
2009-08-09 11:00:37 +02:00
VladimirMangos
4e2536df45 [8331] Restore spirit guids work, step 2
Remove hack in battleground code that prevent proper work guids in result
sabotage of now correct work spell itself.
2009-08-09 00:49:14 +04:00
VladimirMangos
a6413516f9 [8315] Fixed memory leaks (mostly at server shutdown) and code cleanups.
* 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
2009-08-05 14:27:30 +04:00
VladimirMangos
9002710c93 [8276] Implement achievment ACHIEVEMENT_CRITERIA_TYPE_WIN_BG
* 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`
2009-07-29 17:29:10 +04:00
balrok
d8c1e3991f [8274] use virtual m_TeamScore for battlegrounds
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>
2009-07-29 14:45:45 +02:00
VladimirMangos
9f41772828 [8102] Simplify code base at new root method WorldObject::CleanupsBeforeDelete
* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
* Create Gameobject version to make GO with owner more safe for remove
2009-07-01 11:09:34 +04:00
AlexDereka
68ee99f6ac [8006] Fixed crash in EndBattleGround(). 2009-06-14 00:44:31 +04:00
Trazom
626553c9ee [7934] Implement ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA
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.
2009-06-01 07:32:03 +04:00
VladimirMangos
2a27a44e2a [7918] Improve portability in work with uint64 string format specifiers and in code literals.
* 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
2009-05-30 22:44:20 +04:00
raczman
159258b668 [7859] Memory leak in BG code.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Thanks to ANTOMA for prepering patch to mangos.
2009-05-20 16:34:28 +04:00
Nezemnoy
00820846e9 [7805] Refactoring batleground rewards code for cleanup and useful state for custom reward reuse.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-05-09 16:20:13 +04:00
zhenya
8144f30199 [7730] Some optimizantion and code style.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
2009-04-29 01:05:21 +04:00
VladimirMangos
c2e6dd20dd [7715] Provided way for scripts set alternative gameobject state for client show.
Also use enum for gsmeobject states.
2009-04-26 07:21:11 +04:00
Trazom
eedc10d46f [7703] Implement heal/damage total counters and related BG achievments.
* ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
* ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-04-23 23:56:15 +04:00
VladimirMangos
fc0e1ecdf1 [7690] Move GetCreature/GetGameobject to class Map.
* This let get objects at map without reference to player or another object.
* Simplify future implementation for per-map storage for like objects
2009-04-20 19:08:13 +04:00
VladimirMangos
eb198f8239 [7645] Fixed problems wit temporary unsummoned pets and cleanup code.
* 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.
2009-04-11 08:46:48 +04:00
balrok
6b2fd22a9c [7632] more "if"-condition related codestyle in battlegroundfiles
this time with this regex:
sed -i 's/if *( *\(.*\) *)$/if (\1)/' BattleGround*
2009-04-07 17:25:53 +00:00
Triply
73d12d7ccf replaced if( bla ) with if (bla) for applying mangos coding style
replaced it with sed -i 's/if( \(.*\) )$/if (\1)/' BattleGround*
written by triply

Signed-off-by: balrok <der-coole-carl@gmx.net>
2009-04-07 16:13:46 +00:00
Triply
c916f78abb [7631] Removed useless method BattleGroundQueue::BGEndedRemoveInvites
Moved method BattleGroundMrg::InvitePlayer to BattleGroundQueue::InviteGroupToBG
Added some comments to RemindInvite and RemoveInvite events.
Optimalise code.

Signed-off-by: Triply <triply@getmangos.com>
2009-04-07 16:23:10 +02:00
VladimirMangos
c33eff13f4 [7540] Move most reputation/force faction reaction code to new ReputationMgr. 2009-03-26 11:28:56 +03:00
AlexDereka
8a5e4706bc [7506] Remove dual ERROR in logs 2009-03-21 11:47:57 +03:00
Triply
7dd997617e [7460] Fixed possible cheating in rated arena by ressurection after relog.
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>
2009-03-14 22:33:34 +01:00
Triply
74006886e9 [7457] Fixed set Bg raid leader to party or raid leader who entered Bg.
Removed useless code from my previous patch.

Signed-off-by: Triply <triply@getmangos.com>
2009-03-14 20:22:17 +01:00
Triply
b45b075668 [7455] Implemented condition that player can be in 2 groups in 1 time - BG raid and normal group / raid.
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>
2009-03-14 17:01:30 +01:00
Triply
571c56ff07 [7449] Fixed BG queue invitation status showed on client. Fixed BG starting timer and BG ending timer.
TODO: make bg queue update player's status each minute.

Signed-off-by: Triply <triply@getmangos.com>
2009-03-13 00:09:50 +01:00
balrok
b6064c373e [7437] Fixed client visible instance ids for battlegrounds. Patch provided by balrok. Thx.
Signed-off-by: Triply <triply@getmangos.com>
2009-03-10 16:52:24 +01:00
balrok
aebcf212dc [7432] Fixed BattleGround's bonus_honor based on player level and reputation rewards. Implement functions for BattleGroundWeekends. Patch originally provided by Balrok. Thx
Correctly assigned some comments.

Signed-off-by: Triply <triply@getmangos.com>
2009-03-09 22:32:11 +01:00
Triply
1c8f8a2e13 [7425] Fixed crash in BattleGround::Update()
Signed-off-by: Triply <triply@getmangos.com>
2009-03-09 15:10:35 +01:00
balrok
18c8e861f4 [7416] Fixed minimap icon for battlegrounds and arenas. Patch provided by Balrok. Thx.
Signed-off-by: Triply <triply@getmangos.com>
2009-03-08 23:25:59 +01:00
Triply
bd0619ce40 [7415] Fixed removing player from battlegrounds
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>
2009-03-08 22:18:53 +01:00
Triply
ee5feab3eb [7414] Fixed premature finish timer messages for battleground (va_start was broken).
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>
2009-03-08 13:28:35 +01:00
VladimirMangos
722395be75 [7413] Fixed finally problems with node names localization in BattleGroundAB messages.
Also fix build at some platforms.
2009-03-08 14:39:53 +03:00
VladimirMangos
57e715857b [7409] Support localization for messsages in specialized battagorund code BattleGround*.cpp
Note: BattleGroundAB still have problems with team/node localization in result wrong way LANG_ strings used.
2009-03-08 09:52:52 +03:00
VladimirMangos
cdf99bc169 [7408] Fixed last hidden non-localized message case in BattleGround.cpp.
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
2009-03-08 08:54:14 +03:00
VladimirMangos
28a8e0c9cf [7407] Implement per-client localization support for battleground broadcast messages. 2009-03-08 08:10:54 +03:00
VladimirMangos
27a2d88796 [7406] Remove string version of BattleGround::SendMessageToAll. Use only string_id versions always. 2009-03-08 05:48:05 +03:00
Triply
8a9942619b [7404] Fixed cheating in rated arena matches by alt+f4.
Signed-off-by: Triply <triply@getmangos.com>
2009-03-08 01:48:41 +01:00
balrok
54f2dbefa0 [7403] much more unneeded includes removed
now i extended my script:
NAME="Chat"; ack -c $NAME | ack ":1$" | sed 's/:1//' | xargs /usr/bin/ack-grep -l "include \""$NAME".h\"" | xargs /bin/sed -i '/include "'$NAME'.h"/d'

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-03-08 02:22:17 +03:00
balrok
6c39db38f4 removed unneeded World.h includes
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
2009-03-08 01:26:52 +03:00
Triply
1ee2320484 [7399] Rewrited BattleGround starting code - moved it to battleground class.
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>
2009-03-07 11:23:23 +01:00
Triply
17100c67a8 [7388] Fixed battleground premature warning message. SQL files are attached, you must execute them!
Fix for message's color will be soon.

Signed-off-by: Triply <triply@getmangos.com>
2009-03-06 13:24:55 +01:00
Triply
bfa785fdb8 [7384] Removed some comments.
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>
2009-03-05 22:25:39 +01:00
VladimirMangos
9983286280 [7372] Cleanup BattleGround::GetClosestGraveYard related code. 2009-03-02 15:56:37 +03:00
Triply
a81d174288 [7353] Fixed problem with joining rated arena matches. Thanks to balrok for help.
Signed-off-by: Triply <triply@getmangos.com>
2009-02-27 14:20:31 +01:00
Triply
3560d9de54 [7351] Fixed removing normal horde groups from queue.
Fixed Reflective shield - patch provided by Rastik. Thx

Signed-off-by: Triply <triply@getmangos.com>
2009-02-27 11:08:57 +01:00
Triply
8f995ce904 [7336] Implemented new BattleGroundQueue invitation system. Now it supports premade group versus premade group matches.
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>
2009-02-25 19:21:31 +01:00