[committed] Duel Group Patch

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

[committed] Duel Group Patch

Postby Hiatus » Tue May 10, 2011 11:17 am

http://www.dolserver.net/storm/tracker/?issue=4234

Duel should end if players group up and try to attack eachother
Attachments
duelgrppatch.patch
(607 Bytes) Downloaded 28 times
Graveen wrote:If you can't see the problem, then this is the problem :mrgreen:
Hiatus
Support Team
 
Posts: 263
Joined: Sat Apr 30, 2011 3:54 pm

Re: Duel Group Patch

Postby Graveen » Tue May 10, 2011 1:05 pm

Accepted, thank you, soon in SVN !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Duel Group Patch

Postby rdsandersjr » Tue May 10, 2011 1:27 pm

Updated Tracker ticket to fix completed. Added notes, waiting for svn submission
Thanks,
RDSandersJR
User avatar
rdsandersjr
Support Team
 
Posts: 1089
Joined: Fri Aug 01, 2008 3:01 pm
Location: Cincinnati, Ohio

Re: [committed] Duel Group Patch

Postby Xaves » Fri May 27, 2011 11:50 pm

Well, is the .path file the latest code ? If yes, it bugs. What if the player doesnt have a group ? Nullexception...
The easiest way to fix it would be to look wether the player has a group or not, if yes cancel duel.
Also I think, it would be best to call this in the group.addmember method.

Just my 2 cents
Xaves
DOL Initiate
 
Posts: 17
Joined: Sat Apr 14, 2007 8:39 pm

Re: [committed] Duel Group Patch

Postby Tolakram » Sat May 28, 2011 12:05 am

I fixed it. Right now Duels do not work correctly because of the unprotected Group check.
Code: Select all
// Duel should end if players join group and trys to attack
if (ad.Attacker.Group != null && ad.Attacker.Group.IsInTheGroup(ad.Target))
{
DuelStop();
}
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: [committed] Duel Group Patch

Postby Xaves » Sat May 28, 2011 12:41 am

Well, on live servers you couldnt duel with anyone that is in a group (look at the /duel challenge there it also asks for the player not having a group), that means the isinthegroup is not needed, thus it would be better to simply put it in the addmember in the group class.

Adding it to the attack doesnt make any sense to me anyways ... What if they stop attacking ? Then they are still dueling (for the server at least).
Code: Select all
public virtual bool AddMember(GameLiving living)
{
lock (m_groupMembers)
{
if (m_groupMembers.Contains(living))
return false;
m_groupMembers.Add(living);
}

living.Group = this;
living.GroupIndex = (byte)(MemberCount - 1);

UpdateGroupWindow();
// update icons of joined player to everyone in the group
UpdateMember(living, true, false);
// updae all icons for just joined player
GamePlayer p = living as GamePlayer;
if (p != null)
{
p.Out.SendGroupMembersUpdate(true);
if (p.DuelTarget != null)
p.DuelStop();
}

SendMessageToGroupMembers(living.Name + " has joined the group.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
GameEventMgr.Notify(GroupEvent.MemberJoined, this, new MemberJoinedEventArgs(living));
return true;
}
Xaves
DOL Initiate
 
Posts: 17
Joined: Sat Apr 14, 2007 8:39 pm

Re: [committed] Duel Group Patch

Postby Graveen » Sat May 28, 2011 2:21 pm

On live, iirc you are in duel until an offensive action in pve, rvr or logoff. Not sure if there is not also a timer
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest