[Crash] Fix crash issue with log formatting during character creation (#2798)

This commit is contained in:
Chris Miles 2023-01-26 20:40:58 -06:00 committed by GitHub
parent 826550acac
commit 0730b6b588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1778,12 +1778,39 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
pp.binds[0].heading = pp.heading; pp.binds[0].heading = pp.heading;
} }
LogInfo("Current location [{}] [{}] [{}] [{}] [{}] [{}]", if (GetZone(pp.zone_id)) {
ZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading); LogInfo(
LogInfo("Bind location [{}] [{}] [{}] [{}] [{}]", "Current location [{}] [{}] [{:.2f}] [{:.2f}] [{:.2f}] [{:.2f}]",
ZoneName(pp.binds[0].zone_id), pp.binds[0].zone_id, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z); ZoneName(pp.zone_id),
LogInfo("Home location [{}] [{}] [{}] [{}] [{}]", pp.zone_id,
ZoneName(pp.binds[4].zone_id), pp.binds[4].zone_id, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z); pp.x,
pp.y,
pp.z,
pp.heading
);
}
if (GetZone(pp.binds[0].zone_id)) {
LogInfo(
"Bind location [{}] [{}] [{:.2f}] [{:.2f}] [{:.2f}]",
ZoneName(pp.binds[0].zone_id),
pp.binds[0].zone_id,
pp.binds[0].x,
pp.binds[0].y,
pp.binds[0].z
);
}
if (GetZone(pp.binds[4].zone_id)) {
LogInfo(
"Home location [{}] [{}] [{:.2f}] [{:.2f}] [{:.2f}]",
ZoneName(pp.binds[4].zone_id),
pp.binds[4].zone_id,
pp.binds[4].x,
pp.binds[4].y,
pp.binds[4].z
);
}
/* Starting Items inventory */ /* Starting Items inventory */
content_db.SetStartingItems(&pp, &inv, pp.race, pp.class_, pp.deity, pp.zone_id, pp.name, GetAdmin()); content_db.SetStartingItems(&pp, &inv, pp.race, pp.class_, pp.deity, pp.zone_id, pp.name, GetAdmin());