mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
Fix calls to GetSafePoints to not pass null_ptr as zonename (#1336)
* Fix calls to GetSafePoints to not pass null_ptr as zonename * Fix GetSafePoints to check and deal will nullptr being sent as short_zone_name * Remove unintentinal formatting change * Fix some typos/cut-n-paste errors I assume Co-authored-by: Noudess <noudess@gmail.com>
This commit is contained in:
parent
dd06033a58
commit
6fb687871c
@ -972,6 +972,10 @@ bool Database::SetVariable(const std::string varname, const std::string &varvalu
|
|||||||
|
|
||||||
// Get zone starting points from DB
|
// Get zone starting points from DB
|
||||||
bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x, float* safe_y, float* safe_z, float* safe_heading, int16* min_status, uint8* min_level, char *flag_needed) {
|
bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x, float* safe_y, float* safe_z, float* safe_heading, int16* min_status, uint8* min_level, char *flag_needed) {
|
||||||
|
|
||||||
|
if (zone_short_name == nullptr)
|
||||||
|
return false;
|
||||||
|
|
||||||
std::string query = fmt::format(
|
std::string query = fmt::format(
|
||||||
SQL(
|
SQL(
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@ -235,7 +235,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, EQApplicationPacket **o
|
|||||||
if (atoi(row_d[1]) != 0) {
|
if (atoi(row_d[1]) != 0) {
|
||||||
player_profile_struct.binds[4].zone_id = (uint32) atoi(row_d[1]);
|
player_profile_struct.binds[4].zone_id = (uint32) atoi(row_d[1]);
|
||||||
content_db.GetSafePoints(
|
content_db.GetSafePoints(
|
||||||
ZoneName(player_profile_struct.binds[4].zone_id),
|
ZoneName(player_profile_struct.binds[4].zone_id, true),
|
||||||
0,
|
0,
|
||||||
&player_profile_struct.binds[4].x,
|
&player_profile_struct.binds[4].x,
|
||||||
&player_profile_struct.binds[4].y,
|
&player_profile_struct.binds[4].y,
|
||||||
@ -252,7 +252,7 @@ void WorldDatabase::GetCharSelectInfo(uint32 account_id, EQApplicationPacket **o
|
|||||||
float heading = atof(row_d[5]);
|
float heading = atof(row_d[5]);
|
||||||
if (x == 0 && y == 0 && z == 0 && heading == 0) {
|
if (x == 0 && y == 0 && z == 0 && heading == 0) {
|
||||||
content_db.GetSafePoints(
|
content_db.GetSafePoints(
|
||||||
ZoneName(player_profile_struct.binds[4].zone_id),
|
ZoneName(player_profile_struct.binds[4].zone_id, true),
|
||||||
0,
|
0,
|
||||||
&x,
|
&x,
|
||||||
&y,
|
&y,
|
||||||
@ -567,7 +567,7 @@ bool WorldDatabase::GetStartZone(
|
|||||||
p_player_profile_struct->heading == 0
|
p_player_profile_struct->heading == 0
|
||||||
) {
|
) {
|
||||||
content_db.GetSafePoints(
|
content_db.GetSafePoints(
|
||||||
ZoneName(p_player_profile_struct->zone_id),
|
ZoneName(p_player_profile_struct->zone_id, true),
|
||||||
0,
|
0,
|
||||||
&p_player_profile_struct->x,
|
&p_player_profile_struct->x,
|
||||||
&p_player_profile_struct->y,
|
&p_player_profile_struct->y,
|
||||||
@ -583,7 +583,7 @@ bool WorldDatabase::GetStartZone(
|
|||||||
p_player_profile_struct->binds[0].heading == 0
|
p_player_profile_struct->binds[0].heading == 0
|
||||||
) {
|
) {
|
||||||
content_db.GetSafePoints(
|
content_db.GetSafePoints(
|
||||||
ZoneName(p_player_profile_struct->binds[0].zone_id),
|
ZoneName(p_player_profile_struct->binds[0].zone_id, true),
|
||||||
0,
|
0,
|
||||||
&p_player_profile_struct->binds[0].x,
|
&p_player_profile_struct->binds[0].x,
|
||||||
&p_player_profile_struct->binds[0].y,
|
&p_player_profile_struct->binds[0].y,
|
||||||
|
|||||||
@ -230,9 +230,9 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
|||||||
break;
|
break;
|
||||||
case GateToBindPoint:
|
case GateToBindPoint:
|
||||||
target_x = m_pp.binds[0].x;
|
target_x = m_pp.binds[0].x;
|
||||||
target_x = m_pp.binds[0].y;
|
target_y = m_pp.binds[0].y;
|
||||||
target_x = m_pp.binds[0].z;
|
target_z = m_pp.binds[0].z;
|
||||||
target_x = m_pp.binds[0].heading;
|
target_heading = m_pp.binds[0].heading;
|
||||||
break;
|
break;
|
||||||
case ZoneToBindPoint:
|
case ZoneToBindPoint:
|
||||||
target_x = m_pp.binds[0].x;
|
target_x = m_pp.binds[0].x;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user