PDA

View Full Version : $wp variable..fix?


Cripp
08-14-2004, 05:58 AM
HI, I am not sure if $wp variable works for everyone or not, but after adding the 2 grid system for me it didnt work. not sure if 2grid system broke it or not but heres what i did to fix it.

embparser.cpp around line 285 replace:
case EVENT_WAYPOINT: {
std::string temp = "wp";
temp += itoa(npcid);
ExportVar(packagename.c_str(), temp.c_str(), data);
SendCommands(packagename.c_str(), "EVENT_WAYPOINT", npcid, npcmob, mob);
break;
}

with

case EVENT_WAYPOINT: {
//std::string temp = "wp";
// temp += itoa(npcid);
//ExportVar(packagename.c_str(), temp.c_str(), data);
ExportVar(packagename.c_str(), "wp", itoa( (int)npcmob->cur_wp ));
SendCommands(packagename.c_str(), "EVENT_WAYPOINT", npcid, npcmob, mob);
break;
}

parser.cpp around line 445 replace:

case EVENT_WAYPOINT: {
temp = "wp." + (string)itoa(npcid);
AddVar(temp,data);
SendCommands("event_waypoint", qstID, npcmob, mob);
break;
}

with

case EVENT_WAYPOINT: {
temp = "wp." + (string)itoa(npcid);
AddVar(temp,itoa( (int)npcmob->cur_wp ));
//AddVar(temp,data);
SendCommands("event_waypoint", qstID, npcmob, mob);
break;
}

and finally in mob.h around line 760 replace:

int max_wp;
int cur_wp;
// used by quest wandering commands

with

int max_wp;
public:
int cur_wp;
protected:
// used by quest wandering commands

works perfectly for me now :D hope this helps.

govtcheeze
08-14-2004, 07:13 AM
Very nice fix!

sotonin
08-14-2004, 07:57 AM
maybe they'll add 2 grid into the cvs now. o.O... finally

Cripp
08-14-2004, 09:15 AM
i hope so, its so much better. i am havin some troubles getting it working tho. so far i only have the circular type working with it.