bool UnloadLocation(aref loc)
{
if(CheckAttribute(loc,"id")) traceif("UnloadLocation(aref loc) " + loc.id);
DialogExit();
ref mainCharacter = GetMainCharacter();
if(SendMessage(&mainCharacter, "ls", MSG_CHARACTER_EX_MSG, "IsFightMode") != 0)
mainCharacter.lastFightMode = "1";
else
mainCharacter.lastFightMode = "0";
SideStepControl(0, false); // NK ranged sidestep 05-07-21
// KK -->
ClearAllLogStrings();
if (CheckAttribute(loc, "type")) {
if (loc.type == "own_deck" || loc.type == "ship") {
DeletePortLandscape();
}
}
// <-- KK
Event(EVENT_LOCATION_UNLOAD,"");
DeleteAttribute(loc,"openboxes"); // NK 05-04-14
DeleteAttribute(loc,"trapboxes"); // NK 05-04-14
DeleteAttribute(loc,"jammed"); // PB: Lockpicks
DeleteAttribute(mainCharacter, "Flags.waitdelay"); // PB: Just to make sure this is gone
DeleteAttribute(mainCharacter, "directsail1.QuestCheckMapEnter"); // PB: This too
LogoffCharactersFromLocation(loc); // PB: Permanently erase certain characters