Skip to content

Commit

Permalink
[9952] Allow update subgroup in raid for offline players.
Browse files Browse the repository at this point in the history
Also prevent crash and wrong subgroup number send from client.
  • Loading branch information
VladimirMangos committed May 22, 2010
1 parent caa916d commit e91fbf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/game/GroupHandler.cpp
Expand Up @@ -510,6 +510,9 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )

recv_data >> groupNr;

if (groupNr >= MAX_RAID_SUBGROUPS)
return;

// we will get correct pointer for group here, so we don't have to check if group is BG raid
Group *group = GetPlayer()->GetGroup();
if(!group)
Expand All @@ -524,7 +527,10 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
/********************/

// everything is fine, do it
group->ChangeMembersGroup(sObjectMgr.GetPlayer(name.c_str()), groupNr);
if (Player* player = sObjectMgr.GetPlayer(name.c_str()))
group->ChangeMembersGroup(player, groupNr);
else
group->ChangeMembersGroup(sObjectMgr.GetPlayerGUIDByName(name.c_str()), groupNr);
}

void WorldSession::HandleGroupAssistantLeaderOpcode( WorldPacket & recv_data )
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9951"
#define REVISION_NR "9952"
#endif // __REVISION_NR_H__

0 comments on commit e91fbf9

Please sign in to comment.