vesuvias
02-11-2004, 02:59 AM
I am not sure if this has been reported before. I am using the latest code from CVS running the MW 053 alpha3 DB.
Apprently If you die while not having been bound yet (perhaps we should make a startingbindpoints db table) you get sent to -3,-3,-3 in the same zone. This is a problem in some zones but in others (ie vahlshar) it can lead to repeated falling death loops.
I inspected the code and traced the problem to handlepacket inside client_process.cpp. The offending bug I believe is centered on this section:
if (!database.GetSafePoints(target_zone, &tarx, &tary, &tarz, &minstatus, &minlevel)) {
target_zone[0] = 0;
}
int8 tmpzonesummon_ignorerestrictions = zonesummon_ignorerestrictions;
if (zonesummon_ignorerestrictions) {
minstatus = 0;
minlevel = 0;
}
zonesummon_ignorerestrictions = 0;
ZonePoint* zone_point = zone->GetClosestZonePoint(x_pos, y_pos, z_pos, zc->zoneID);
tarx=zonesummon_x;
tary=zonesummon_y;
tarz=zonesummon_z;
// -1, -1, -1 = code for zone safe point
if ((x_pos == -1 && y_pos == -1 && (z_pos == -1 || z_pos == -10)) ||
(zonesummon_x == -1 && zonesummon_y == -1 && (zonesummon_z == -1 || zonesummon_z == -10))) {
cout << "Zoning to safe coords: " << target_zone << " (" << database.GetZoneID(target_zone) << ")" << endl;
tarx=database.GetSafePoint(target_zone, "x");
tary=database.GetSafePoint(target_zone, "y");
tarz=database.GetSafePoint(target_zone, "z");
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
// -3 -3 -3 = bind point
else if (zonesummon_x == -3 && zonesummon_y == -3 && (zonesummon_z == -3 || zonesummon_z == -30) && database.GetZoneName(m_pp.bind_zone_id)) {
strcpy(target_zone, database.GetZoneName(m_pp.bind_zone_id));
tarx = m_pp.bind_x;
tary = m_pp.bind_y;
tarz = m_pp.bind_z;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
minstatus = 0;
minlevel = 0;
}
else if (zone_point != 0) {
if(zone_point->target_x==999999)
tarx=GetX();
else
tarx = zone_point->target_x;
if(zone_point->target_y==999999)
tary=GetY();
else
tary = zone_point->target_y;
if(zone_point->target_z==999999)
tarz=GetZ();
else
tarz = zone_point->target_z;
tarheading = zone_point->target_heading;
}
// if not -2 -2 -2, zone to these coords. -2, -2, -2 = not a zonesummon zonerequest
else if (!(zonesummon_x == -2 && zonesummon_y == -2 && (zonesummon_z == -2 || zonesummon_z == -20))) {
tarx = zonesummon_x;
tary = zonesummon_y;
tarz = zonesummon_z;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
else {
cout << "WARNING: No target coords for this zone in DB found" << endl;
cout << "Zoning to safe coords: " << target_zone << " (" << database.GetZoneID(target_zone) << ")" << ", x=" << tarx << ", y=" << tary << ", z=" << tarz << endl;
tarx=-1;
tary=-1;
tarz=-1;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
Now my C++ is rather rusty (but its coming back, I am a Java guy by trade) but this else {
cout << "WARNING: No target coords for this zone in DB found" << endl;
cout << "Zoning to safe coords: " << target_zone << " (" << database.GetZoneID(target_zone) << ")" << ", x=" << tarx << ", y=" << tary << ", z=" << tarz << endl;
tarx=-1;
tary=-1;
tarz=-1;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
Seems really strange. Why would you print out the correct loc of the safe area and then proceed to wipe out your only record of those coords? Anyway like I said I am still a little rusty so I was hoping some more code experienced devs might be able to shed some light on the situation.
Try not to give me too much shit, at least I took the time to track down where I think the problem lies as oppossed to just whinning about it. :D
Ves
Apprently If you die while not having been bound yet (perhaps we should make a startingbindpoints db table) you get sent to -3,-3,-3 in the same zone. This is a problem in some zones but in others (ie vahlshar) it can lead to repeated falling death loops.
I inspected the code and traced the problem to handlepacket inside client_process.cpp. The offending bug I believe is centered on this section:
if (!database.GetSafePoints(target_zone, &tarx, &tary, &tarz, &minstatus, &minlevel)) {
target_zone[0] = 0;
}
int8 tmpzonesummon_ignorerestrictions = zonesummon_ignorerestrictions;
if (zonesummon_ignorerestrictions) {
minstatus = 0;
minlevel = 0;
}
zonesummon_ignorerestrictions = 0;
ZonePoint* zone_point = zone->GetClosestZonePoint(x_pos, y_pos, z_pos, zc->zoneID);
tarx=zonesummon_x;
tary=zonesummon_y;
tarz=zonesummon_z;
// -1, -1, -1 = code for zone safe point
if ((x_pos == -1 && y_pos == -1 && (z_pos == -1 || z_pos == -10)) ||
(zonesummon_x == -1 && zonesummon_y == -1 && (zonesummon_z == -1 || zonesummon_z == -10))) {
cout << "Zoning to safe coords: " << target_zone << " (" << database.GetZoneID(target_zone) << ")" << endl;
tarx=database.GetSafePoint(target_zone, "x");
tary=database.GetSafePoint(target_zone, "y");
tarz=database.GetSafePoint(target_zone, "z");
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
// -3 -3 -3 = bind point
else if (zonesummon_x == -3 && zonesummon_y == -3 && (zonesummon_z == -3 || zonesummon_z == -30) && database.GetZoneName(m_pp.bind_zone_id)) {
strcpy(target_zone, database.GetZoneName(m_pp.bind_zone_id));
tarx = m_pp.bind_x;
tary = m_pp.bind_y;
tarz = m_pp.bind_z;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
minstatus = 0;
minlevel = 0;
}
else if (zone_point != 0) {
if(zone_point->target_x==999999)
tarx=GetX();
else
tarx = zone_point->target_x;
if(zone_point->target_y==999999)
tary=GetY();
else
tary = zone_point->target_y;
if(zone_point->target_z==999999)
tarz=GetZ();
else
tarz = zone_point->target_z;
tarheading = zone_point->target_heading;
}
// if not -2 -2 -2, zone to these coords. -2, -2, -2 = not a zonesummon zonerequest
else if (!(zonesummon_x == -2 && zonesummon_y == -2 && (zonesummon_z == -2 || zonesummon_z == -20))) {
tarx = zonesummon_x;
tary = zonesummon_y;
tarz = zonesummon_z;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
else {
cout << "WARNING: No target coords for this zone in DB found" << endl;
cout << "Zoning to safe coords: " << target_zone << " (" << database.GetZoneID(target_zone) << ")" << ", x=" << tarx << ", y=" << tary << ", z=" << tarz << endl;
tarx=-1;
tary=-1;
tarz=-1;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
Now my C++ is rather rusty (but its coming back, I am a Java guy by trade) but this else {
cout << "WARNING: No target coords for this zone in DB found" << endl;
cout << "Zoning to safe coords: " << target_zone << " (" << database.GetZoneID(target_zone) << ")" << ", x=" << tarx << ", y=" << tary << ", z=" << tarz << endl;
tarx=-1;
tary=-1;
tarz=-1;
zonesummon_x = -2;
zonesummon_y = -2;
zonesummon_z = -2;
}
Seems really strange. Why would you print out the correct loc of the safe area and then proceed to wipe out your only record of those coords? Anyway like I said I am still a little rusty so I was hoping some more code experienced devs might be able to shed some light on the situation.
Try not to give me too much shit, at least I took the time to track down where I think the problem lies as oppossed to just whinning about it. :D
Ves