Added config option"queryPlayerContainers"

This option should allow you to query every player container for an available slot.
This commit is contained in:
Alejandro Mujica 2019-02-05 12:51:39 -04:00
parent 1aaa6288a8
commit 6e02936226
4 changed files with 14 additions and 7 deletions

View File

@ -69,6 +69,7 @@ freePremium = false
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
showMonsterLoot = false
queryPlayerContainers = false
-- Character Rooking
-- Level threshold is the level requirement to teleport players back to newbie town

View File

@ -77,6 +77,7 @@ bool ConfigManager::load()
boolean[CONVERT_UNSAFE_SCRIPTS] = getGlobalBoolean(L, "convertUnsafeScripts", true);
boolean[TELEPORT_NEWBIES] = getGlobalBoolean(L, "teleportNewbies", true);
boolean[STACK_CUMULATIVES] = getGlobalBoolean(L, "autoStackCumulatives", false);
boolean[QUERY_PLAYER_CONTAINERS] = getGlobalBoolean(L, "queryPlayerContainers", false);
string[DEFAULT_PRIORITY] = getGlobalString(L, "defaultPriority", "high");
string[SERVER_NAME] = getGlobalString(L, "serverName", "");

View File

@ -40,6 +40,7 @@ class ConfigManager
CONVERT_UNSAFE_SCRIPTS,
TELEPORT_NEWBIES,
STACK_CUMULATIVES,
QUERY_PLAYER_CONTAINERS,
LAST_BOOLEAN_CONFIG /* this must be the last one */
};

View File

@ -2297,11 +2297,13 @@ Cylinder* Player::queryDestination(int32_t& index, const Thing& thing, Item** de
n--;
}
/*for (Item* tmpContainerItem : tmpContainer->getItemList()) {
if (g_config.getBoolean(ConfigManager::QUERY_PLAYER_CONTAINERS)) {
for (Item* tmpContainerItem : tmpContainer->getItemList()) {
if (Container* subContainer = tmpContainerItem->getContainer()) {
containers.push_back(subContainer);
}
}*/
}
}
continue;
}
@ -2324,9 +2326,11 @@ Cylinder* Player::queryDestination(int32_t& index, const Thing& thing, Item** de
return tmpContainer;
}
/*if (Container* subContainer = tmpItem->getContainer()) {
if (g_config.getBoolean(ConfigManager::QUERY_PLAYER_CONTAINERS)) {
if (Container* subContainer = tmpItem->getContainer()) {
containers.push_back(subContainer);
}*/
}
}
n++;
}