aboutsummaryrefslogtreecommitdiff
path: root/src/game/BattleGround.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-08 11:36:10 -0600
committermegamage <none@none>2009-03-08 11:36:10 -0600
commit985b7656bb8f7de1cb192410f2ee0495dd43ae91 (patch)
treeac10c887e7e80fe17956ee2ca0742c40f3d24389 /src/game/BattleGround.cpp
parent88c050182cd2628984a0282f66256913cecd188b (diff)
parent0f8dee432c4eb78b466744b9e3e13266c6be19d7 (diff)
*Merge.
--HG-- branch : trunk rename : sql/updates/XXX_characters_auctionhouse.sql => sql/updates/1164_characters.sql
Diffstat (limited to 'src/game/BattleGround.cpp')
-rw-r--r--src/game/BattleGround.cpp33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 29843eb425e..a4c2cae5ca8 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -727,42 +727,29 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
if(plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
return;
- BattleGroundMarks mark;
- bool IsSpell;
+ if(!plr || !count)
+ return;
+
+ BattleGroundMarks mark;
switch(GetTypeID())
{
case BATTLEGROUND_AV:
- IsSpell = true;
- if(count == ITEM_WINNER_COUNT)
- mark = SPELL_AV_MARK_WINNER;
- else
- mark = SPELL_AV_MARK_LOSER;
+ mark = ITEM_AV_MARK_OF_HONOR;
break;
case BATTLEGROUND_WS:
- IsSpell = true;
- if(count == ITEM_WINNER_COUNT)
- mark = SPELL_WS_MARK_WINNER;
- else
- mark = SPELL_WS_MARK_LOSER;
+ mark = ITEM_WS_MARK_OF_HONOR;
break;
case BATTLEGROUND_AB:
- IsSpell = true;
- if(count == ITEM_WINNER_COUNT)
- mark = SPELL_AB_MARK_WINNER;
- else
- mark = SPELL_AB_MARK_LOSER;
+ mark = ITEM_AB_MARK_OF_HONOR;
break;
- case BATTLEGROUND_EY:
- IsSpell = false;
+ case BATTLEGROUND_EY:
mark = ITEM_EY_MARK_OF_HONOR;
break;
default:
return;
}
- if(IsSpell)
- plr->CastSpell(plr, mark, true);
- else if ( objmgr.GetItemPrototype( mark ) )
+ if ( objmgr.GetItemPrototype( mark ) )
{
ItemPosCountVec dest;
uint32 no_space_count = 0;
@@ -770,7 +757,7 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
if( msg != EQUIP_ERR_OK ) // convert to possible store amount
count -= no_space_count;
- if( count != 0 && !dest.empty()) // can add some
+ if(!dest.empty()) // can add some
if(Item* item = plr->StoreNewItem( dest, mark, true, 0))
plr->SendNewItem(item,count,false,true);