mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 02:08:23 +00:00
[Fix] Fix crash from lingering spawn2 reference in NPCs.
This commit is contained in:
@@ -188,7 +188,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
auto spawn2 = target->respawn2;
|
||||
auto spawn2 = target->GetSpawn();
|
||||
if (!spawn2) {
|
||||
c->Message(Chat::White, "Failed to delete spawn because NPC has no Spawn2.");
|
||||
return;
|
||||
@@ -297,7 +297,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
auto spawn2 = target->respawn2;
|
||||
auto spawn2 = target->GetSpawn();
|
||||
if (!spawn2) {
|
||||
c->Message(Chat::White, "Failed to edit respawn because NPC has no Spawn2.");
|
||||
return;
|
||||
@@ -434,7 +434,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
auto spawn2 = target->respawn2;
|
||||
auto spawn2 = target->GetSpawn();
|
||||
if (!spawn2) {
|
||||
c->Message(Chat::White, "Failed to move spawn because NPC has no Spawn2.");
|
||||
return;
|
||||
|
||||
@@ -8,7 +8,7 @@ void command_spawnfix(Client* c, const Seperator* sep)
|
||||
}
|
||||
|
||||
auto target = c->GetTarget()->CastToNPC();
|
||||
auto spawn2 = target->respawn2;
|
||||
auto spawn2 = target->GetSpawn();
|
||||
|
||||
if (!spawn2) {
|
||||
c->Message(Chat::White, "Failed to fix spawn, the spawn must not exist in the database.");
|
||||
|
||||
@@ -5,7 +5,7 @@ void command_wpadd(Client *c, const Seperator *sep)
|
||||
int type1 = 0, type2 = 0, pause = 0; // Defaults for a new grid
|
||||
Mob *target = c->GetTarget();
|
||||
if (target && target->IsNPC()) {
|
||||
Spawn2 *s2info = target->CastToNPC()->respawn2;
|
||||
Spawn2 *s2info = target->CastToNPC()->GetSpawn();
|
||||
if (s2info == nullptr) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
Reference in New Issue
Block a user