Skip to content

Commit

Permalink
Make player walkthrough optional
Browse files Browse the repository at this point in the history
Fix inverted condition
  • Loading branch information
ranisalt committed Aug 4, 2015
1 parent c6a463b commit 5ff1c2f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ maxPlayers = 0
motd = "Welcome to The Forgotten Server!"
onePlayerOnlinePerAccount = true
allowClones = false
allowWalkthrough = true
serverName = "Forgotten"
statusTimeout = 5000
replaceKickOnLogin = true
Expand Down
1 change: 1 addition & 0 deletions src/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ bool ConfigManager::load()
boolean[FREE_PREMIUM] = getGlobalBoolean(L, "freePremium", false);
boolean[REPLACE_KICK_ON_LOGIN] = getGlobalBoolean(L, "replaceKickOnLogin", true);
boolean[ALLOW_CLONES] = getGlobalBoolean(L, "allowClones", false);
boolean[ALLOW_WALKTHROUGH] = getGlobalBoolean(L, "allowWalkthrough", true);
boolean[MARKET_PREMIUM] = getGlobalBoolean(L, "premiumToCreateMarketOffer", true);
boolean[EMOTE_SPELLS] = getGlobalBoolean(L, "emoteSpells", false);
boolean[STAMINA_SYSTEM] = getGlobalBoolean(L, "staminaSystem", true);
Expand Down
1 change: 1 addition & 0 deletions src/configmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ConfigManager
FREE_PREMIUM,
REPLACE_KICK_ON_LOGIN,
ALLOW_CLONES,
ALLOW_WALKTHROUGH,
BIND_ONLY_GLOBAL_ADDRESS,
OPTIMIZE_DATABASE,
MARKET_PREMIUM,
Expand Down
4 changes: 2 additions & 2 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ bool Player::canWalkthrough(const Creature* creature) const
}

const Player* player = creature->getPlayer();
if (!player) {
if (!player || !g_config.getBoolean(ConfigManager::ALLOW_WALKTHROUGH)) {
return false;
}

Expand Down Expand Up @@ -857,7 +857,7 @@ bool Player::canWalkthroughEx(const Creature* creature) const
}

const Player* player = creature->getPlayer();
if (!player) {
if (!player || !g_config.getBoolean(ConfigManager::ALLOW_WALKTHROUGH)) {
return false;
}

Expand Down

0 comments on commit 5ff1c2f

Please sign in to comment.