Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2013, 07:34 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default Broken #npcedit qglobal.

Okay, so currently #npcedit qlobal does this: http://prntscr.com/22etq5

The current code is broken to pieces (Lines 6982-6990):
Code:
else if(strcasecmp(sep->arg[1], "qglobal") == 0)
{
	char errbuf[MYSQL_ERRMSG_SIZE];
	char *query = 0;
	c->Message(15,"Quest globals have been %d for NPCID %u",c->GetTarget()->CastToNPC()->GetNPCTypeID(),atoi(sep->arg[2])==0?"disabled":"enabled");
	database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set qglobal=%i where id=%i",atoi(sep->argplus[2])==0?0:1,c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
	c->LogSQL(query);
	safe_delete_array(query);
}
See how it's pulling the NPC's ID in the incorrect spot, here is my proposed fix, it calls the NPC's ID in the correct spot.
Code:
else if(strcasecmp(sep->arg[1], "qglobal") == 0)
{
	char errbuf[MYSQL_ERRMSG_SIZE];
	char *query = 0;
	c->Message(15,"Quest globals have been %s for NPCID %u",atoi(sep->arg[2])==0?"disabled":"enabled",c->GetTarget()->CastToNPC()->GetNPCTypeID());
	database.RunQuery(query, MakeAnyLenString(&query, "update npc_types set qglobal=%i where id=%i",atoi(sep->argplus[2])==0?0:1,c->GetTarget()->CastToNPC()->GetNPCTypeID()), errbuf);
	c->LogSQL(query);
	safe_delete_array(query);
}
Reply With Quote
  #2  
Old 11-06-2013, 10:14 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Good catch, thanks!
Reply With Quote
  #3  
Old 11-06-2013, 11:07 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

No problem, I just found it annoying, didn't know if anyone else knew about it so I posted. :P
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:01 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