View Single Post
  #6  
Old 09-01-2008, 05:33 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

I thought it would be fine the way I did this, but I guess maybe not.

Quote:
Originally Posted by AndMetal View Post
zone/command.cpp
Code:
void command_wp(Client *c, const Seperator *sep)
{
	if (sep->arg[4] == NULL)
		int wp = database.GetHighestWaypoint(zone->GetZoneID(), atoi(sep->arg[2]));
	else
		int wp = atoi(sep->arg[4]);
	if (strcasecmp("add",sep->arg[1]) == 0)
		database.AddWP(c, atoi(sep->arg[2]),wp, c->GetX(), c->GetY(), c->GetZ(), atoi(sep->arg[3]),zone->GetZoneID());
	else if (strcasecmp("delete",sep->arg[1]) == 0)
		database.DeleteWaypoint(c, atoi(sep->arg[2]),atoi(sep->arg[4]),zone->GetZoneID());
	else
		c->Message(0,"Usage: #wp add/delete grid_num pause wp_num");
}
Try this instead:
Code:
void command_wp(Client *c, const Seperator *sep)
{
	int wp;
	if (sep->arg[4] == NULL)
		wp = database.GetHighestWaypoint(zone->GetZoneID(), atoi(sep->arg[2]));
	else
		wp = atoi(sep->arg[4]);
	if (strcasecmp("add",sep->arg[1]) == 0)
		database.AddWP(c, atoi(sep->arg[2]),wp, c->GetX(), c->GetY(), c->GetZ(), atoi(sep->arg[3]),zone->GetZoneID());
	else if (strcasecmp("delete",sep->arg[1]) == 0)
		database.DeleteWaypoint(c, atoi(sep->arg[2]),atoi(sep->arg[4]),zone->GetZoneID());
	else
		c->Message(0,"Usage: #wp add/delete grid_num pause wp_num");
}
Let me know if that works. I knew when I wrote it that 2nd one would work, I just figured the other way would be a little cleaner & still work

Oh well, that's why KLS & Derision are the "devs", and I just tinker
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote