Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2008, 01:34 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default Movegrp quest command fix

I have seen a few complaints about movegrp not moving the requesting character. Well here is why

Zone\groups.cpp
Code:
void Group::TeleportGroup(Mob* sender, int32 zoneID, float x, float y, float z, float heading)
{
	uint32 i;
	 for (i = 0; i < MAX_GROUP_MEMBERS; i++)
	 {
	 #ifdef IPC
		if (members[i] != NULL && (members[i]->IsClient() || (members[i]->IsNPC() && members[i]->CastToNPC()->IsInteractive())) && members[i] != sender)
	 #else
		  if (members[i] != NULL && members[i]->IsClient() && members[i] != sender)
	 #endif
	 	{
			members[i]->CastToClient()->MovePC(int(zoneID), x, y, z, heading, 0, ZoneSolicited);
		}
	}	
}
The code in red causes the requester to be skipped. (members[i] != sender)

This function appears to only be used twice in the code.
By QuestManager::movegrp in questmgr.cpp and XS(XS_Group_TeleportGroup) in perl_groups.cpp

I do not know where XS_Group_TeleportGroup is used. Can someone enlighten me before I remove (members[i] != sender) and break something?

Also what is IPC? I did not see any reference to it in my source.
Reply With Quote
  #2  
Old 10-08-2008, 01:42 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Nevermind the IPC question. It appears to be a Unix thing. Sorry, I should have done more searching before asking.
Reply With Quote
  #3  
Old 10-08-2008, 02:36 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Rocker8956 View Post
This function appears to only be used twice in the code.
By QuestManager::movegrp in questmgr.cpp and XS(XS_Group_TeleportGroup) in perl_groups.cpp

I do not know where XS_Group_TeleportGroup is used. Can someone enlighten me before I remove (members[i] != sender) and break something?
The XS(XS_<Function) syntax is just the way that the functions to be called from the Perl quest system are declared. It would be called by doing $group->TeleportGroup(<params>).

Quote:
Also what is IPC? I did not see any reference to it in my source.
As well as Interprocess Communication, IPC also stood for Interactive Player Character, I believe. I'm not sure exactly what it was meant to do, or if it ever even worked.
Reply With Quote
  #4  
Old 10-08-2008, 02:55 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Thank you, it makes more sense now.

I probably don't want to mess with the Group::TeleportGroup since it is likely being used.

Though I think I may have a fix for the quest initiator not being moved by movegrp.

Please note I am at work so this is untested. If someone with quests that use the movegrp function could give this a try I would be grateful.

zone\questmgr.cpp
Find void QuestManager::movegrp and replace line 10 with the line in red.
Line number for whole file is 720 on mine.

Code:
void QuestManager::movegrp(int zoneid, float x, float y, float z) {
#ifdef IPC
    if (initiator && initiator->IsClient()|| (initiator->IsNPC() && initiator->CastToNPC()->IsInteractive()) )
#else
    if (initiator && initiator->IsClient())
#endif
	{
		Group *g = entity_list.GetGroupByClient(initiator);
       	if (g != NULL){
			g->TeleportGroup(owner, zoneid, x, y, z, 0.0f);
		}
		else {
			initiator->MovePC(zoneid, x, y, z, 0.0f);
		}
	}
}
All I changed was the word in blue (owner). I replaced initiator with owner.
Reply With Quote
  #5  
Old 10-12-2008, 02:57 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Thanks. I tested this and it works fine. It's in Rev87.
Reply With Quote
  #6  
Old 10-12-2008, 03:59 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

IPC was basically a system where a character could become a npc. It no longer works and probably should be fixed or removed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:40 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3