mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Bug Fix] Fix crash in Client::Handle_OP_GMGoto (#3832)
# Notes - Logic was incorrect.
This commit is contained in:
parent
a0f2a8a743
commit
2f4af4f0c2
@ -6598,17 +6598,26 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
auto *gmg = (GMSummon_Struct *) app->pBuffer;
|
auto *gmg = (GMSummon_Struct *) app->pBuffer;
|
||||||
Mob *gt = entity_list.GetMob(gmg->charname);
|
Mob *gt = entity_list.GetMob(gmg->charname);
|
||||||
if (!gt) {
|
if (gt) {
|
||||||
MovePC(zone->GetZoneID(), zone->GetInstanceID(), gt->GetX(), gt->GetY(), gt->GetZ(), gt->GetHeading());
|
MovePC(
|
||||||
|
zone->GetZoneID(),
|
||||||
|
zone->GetInstanceID(),
|
||||||
|
gt->GetX(),
|
||||||
|
gt->GetY(),
|
||||||
|
gt->GetZ(),
|
||||||
|
gt->GetHeading()
|
||||||
|
);
|
||||||
} else if (!worldserver.Connected()) {
|
} else if (!worldserver.Connected()) {
|
||||||
Message(Chat::Red, "Error: World server disconnected.");
|
Message(Chat::Red, "Error: World server disconnected.");
|
||||||
} else {
|
} else {
|
||||||
auto pack = new ServerPacket(ServerOP_GMGoto, sizeof(ServerGMGoto_Struct));
|
auto pack = new ServerPacket(ServerOP_GMGoto, sizeof(ServerGMGoto_Struct));
|
||||||
memset(pack->pBuffer, 0, pack->size);
|
memset(pack->pBuffer, 0, pack->size);
|
||||||
ServerGMGoto_Struct *wsgmg = (ServerGMGoto_Struct *) pack->pBuffer;
|
|
||||||
strcpy(wsgmg->myname, GetName());
|
auto* g = (ServerGMGoto_Struct *) pack->pBuffer;
|
||||||
strcpy(wsgmg->gotoname, gmg->charname);
|
strcpy(g->myname, GetName());
|
||||||
wsgmg->admin = admin;
|
strcpy(g->gotoname, gmg->charname);
|
||||||
|
g->admin = admin;
|
||||||
|
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user