Skip to content

Commit

Permalink
Fixed client crash at raid target icon update.
Browse files Browse the repository at this point in the history
Some other updates.
  • Loading branch information
tomrus88 committed Feb 6, 2010
1 parent 2893a68 commit 0f491e7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/game/Group.cpp
Expand Up @@ -908,7 +908,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
delete roll;
}

void Group::SetTargetIcon(uint8 id, uint64 guid)
void Group::SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid)
{
if(id >= TARGETICONCOUNT)
return;
Expand All @@ -917,12 +917,13 @@ void Group::SetTargetIcon(uint8 id, uint64 guid)
if( guid != 0 )
for(int i = 0; i < TARGETICONCOUNT; ++i)
if( m_targetIcons[i] == guid )
SetTargetIcon(i, 0);
SetTargetIcon(i, 0, 0);

m_targetIcons[id] = guid;

WorldPacket data(MSG_RAID_TARGET_UPDATE, (2+8));
data << uint8(0);
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+8+1+8));
data << uint8(0); // set targets
data << uint64(whoGuid);
data << uint8(id);
data << uint64(guid);
BroadcastPacket(&data, true);
Expand Down Expand Up @@ -957,7 +958,7 @@ void Group::SendTargetIconList(WorldSession *session)
return;

WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+TARGETICONCOUNT*9));
data << (uint8)1;
data << uint8(1); // list targets

for(int i = 0; i < TARGETICONCOUNT; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/Group.h
Expand Up @@ -286,7 +286,7 @@ class MANGOS_DLL_SPEC Group
SendUpdate();
}

void SetTargetIcon(uint8 id, uint64 guid);
void SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid);

Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; }
Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; }
Expand Down
2 changes: 1 addition & 1 deletion src/game/GroupHandler.cpp
Expand Up @@ -469,7 +469,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode( WorldPacket & recv_data )

uint64 guid;
recv_data >> guid;
group->SetTargetIcon(x, guid);
group->SetTargetIcon(x, _player->GetGUID(), guid);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/Opcodes.h
Expand Up @@ -576,7 +576,7 @@ enum Opcodes
SMSG_GMTICKET_SYSTEMSTATUS = 0x21B,
CMSG_SPIRIT_HEALER_ACTIVATE = 0x21C,
CMSG_SET_STAT_CHEAT = 0x21D,
SMSG_SET_REST_START_OBSOLETE = 0x21E,
SMSG_QUEST_FORCE_REMOVE = 0x21E, // uint32 questid
CMSG_SKILL_BUY_STEP = 0x21F,
CMSG_SKILL_BUY_RANK = 0x220,
CMSG_XP_CHEAT = 0x221,
Expand Down
5 changes: 4 additions & 1 deletion src/game/QuestDef.h
Expand Up @@ -121,6 +121,7 @@ enum __QuestGiverStatus
enum __QuestFlags
{
// Flags used at server and sent to client
QUEST_FLAGS_NONE = 0x00000000,
QUEST_FLAGS_STAY_ALIVE = 0x00000001, // Not used currently
QUEST_FLAGS_PARTY_ACCEPT = 0x00000002, // If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT
QUEST_FLAGS_EXPLORATION = 0x00000004, // Not used currently
Expand All @@ -137,7 +138,9 @@ enum __QuestFlags
QUEST_FLAGS_UNK3 = 0x00002000, // activates PvP?
QUEST_FLAGS_UNK4 = 0x00004000, // ? Membership Card Renewal
QUEST_FLAGS_WEEKLY = 0x00008000, // Not used currently: Weekly quests
// 0x20000 - 1 quest in 3.3, 0x40000 - 1 quest in 3.3
QUEST_FLAGS_AUTOCOMPLETE = 0x00010000, // auto complete
QUEST_FLAGS_UNK5 = 0x00020000, // has something to do with ReqItemId and SrcItemId
QUEST_FLAGS_UNK6 = 0x00040000, // use Objective text as Complete text
QUEST_FLAGS_LOW_LEVEL = 0x00080000, // quests in starting areas

// Mangos flags for set SpecialFlags in DB if required but used only at server
Expand Down

2 comments on commit 0f491e7

@Shadez
Copy link

@Shadez Shadez commented on 0f491e7 Feb 6, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10>....\src\game\Group.cpp(917) : error C2065: 'guid' : undeclared identifier
10>....\src\game\Group.cpp(919) : error C2065: 'guid' : undeclared identifier
10>....\src\game\Group.cpp(922) : error C2065: 'guid' : undeclared identifier
10>....\src\game\Group.cpp(928) : error C2065: 'guid' : undeclared identifier

@boxa
Copy link
Contributor

@boxa boxa commented on 0f491e7 Feb 7, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All "guid" now should'be "targetGuid"
f.e.:
if( targetGuid != 0 )
insted
if( guid != 0 )

Please sign in to comment.