Crash
Moderator: Team Members
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Crash
Making a note, Scribble crashed the server by targeting himself on accident and doing a /spawn remove. Probably need to have a client check.
Resident Dirty Hippy
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: Crash
This fixes it.
Code: Select all
case COMMAND_SPAWN_REMOVE:{
Spawn* spawn = client->GetPlayer()->GetTarget();
if(spawn && !spawn->IsPlayer()){
if(spawn->GetSpawnLocationID() > 0){
if(database.RemoveSpawnFromSpawnLocation(spawn)){
bool delete_spawn = false;
if(sep && sep->arg[0][0] && sep->IsNumber(0)){
if(atoi(sep->arg[0]) == 1)
delete_spawn = true;
}
if(delete_spawn)
client->GetCurrentZone()->RemoveSpawn(spawn, true, false);
else
spawn->SetSpawnLocationID(0);
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Successfully removed spawn from zone");
}
else
client->SimpleMessage(CHANNEL_COLOR_RED, "Error removing spawn, see console window for details.");
}
else
client->SimpleMessage(CHANNEL_COLOR_RED, "This spawn does not have a spawn group associated with it");
}
else{
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn remove");
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command is used for removing the targeted NPC or Object from the zone.");
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Optionally, you can supply a 1 after the command to despawn it as well. IE /spawn remove 1");
}
break;
}Resident Dirty Hippy
- Scribble
- Team Member
- Posts: 157
- Joined: Wed Jun 22, 2016 5:30 am
- EQ2Emu Server: Norrath Reborn
- Characters: Scribe
- Location: East Coast , USA
- Contact:
Re: Crash
Thanks for the forward momentum on this !Gangrenous wrote:This fixes it.
Code: Select all
case COMMAND_SPAWN_REMOVE:{ Spawn* spawn = client->GetPlayer()->GetTarget(); if(spawn && !spawn->IsPlayer()){ if(spawn->GetSpawnLocationID() > 0){ if(database.RemoveSpawnFromSpawnLocation(spawn)){ bool delete_spawn = false; if(sep && sep->arg[0][0] && sep->IsNumber(0)){ if(atoi(sep->arg[0]) == 1) delete_spawn = true; } if(delete_spawn) client->GetCurrentZone()->RemoveSpawn(spawn, true, false); else spawn->SetSpawnLocationID(0); client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Successfully removed spawn from zone"); } else client->SimpleMessage(CHANNEL_COLOR_RED, "Error removing spawn, see console window for details."); } else client->SimpleMessage(CHANNEL_COLOR_RED, "This spawn does not have a spawn group associated with it"); } else{ client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Syntax: /spawn remove"); client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command is used for removing the targeted NPC or Object from the zone."); client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Optionally, you can supply a 1 after the command to despawn it as well. IE /spawn remove 1"); } break; }
Follow me at https://twitter.com/EqIIEmulator
Like to keep up with news via Discordapp chat?
Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23
Like to keep up with news via Discordapp chat?
Join eq2emulator public discord at https://discord.gg/sCR4fPZ
Check me out on Twtich at https://www.twitch.tv/scribbleeq23
Who is online
Users browsing this forum: No registered users and 0 guests