Skip to content

Commit

Permalink
* Added a new configuration fieldOwnershipDuration to config.lua.
Browse files Browse the repository at this point in the history
  • Loading branch information
jprzimba committed Dec 18, 2024
1 parent c8e8190 commit 314bb37
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ blackSkullDuration = 3
orangeSkullDuration = 7
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
fieldOwnershipDuration = 5 * 1000

cleanProtectionZones = false

Expand Down
2 changes: 1 addition & 1 deletion markdowns/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- New protocol 14.05 assets. ([Tryller](https://github.com/jprzimba))
- Fix gotoHouse talkaction. ([Tryller](https://github.com/jprzimba))
- Optimized the `onPlayerSellAllLoot` code to prevent prolonged freezes. ([Tryller](https://github.com/jprzimba))
- Add a new configurable feature in `config.lua`: `chainSystemVipOnly`. ([Tryller](https://github.com/jprzimba))
- Add new configurable featurees in `config.lua`: `chainSystemVipOnly`, `fieldOwnershipDuration`. ([Tryller](https://github.com/jprzimba))

## Added files

Expand Down
1 change: 1 addition & 0 deletions src/config/config_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,5 @@ enum ConfigKey_t : uint16_t {
BLACK_SKULL_DEATH_HEALTH,
BLACK_SKULL_DEATH_MANA,
CHAIN_SYSTEM_VIP_ONLY,
FIELD_OWNERSHIP,
};
1 change: 1 addition & 0 deletions src/config/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ bool ConfigManager::load() {
loadIntConfig(L, FAIRFIGHT_TIMERANGE, "fairFightTimeRange", 5 * 60 * 1000);
loadIntConfig(L, BLACK_SKULL_DEATH_HEALTH, "blackSkulledDeathHealth", 40);
loadIntConfig(L, BLACK_SKULL_DEATH_MANA, "blackSkulledDeathMana", 0);
loadIntConfig(L, FIELD_OWNERSHIP, "fieldOwnershipDuration", 5 * 1000);

loadStringConfig(L, CORE_DIRECTORY, "coreDirectory", "data");
loadStringConfig(L, DATA_DIRECTORY, "dataPackDirectory", "data-global");
Expand Down
2 changes: 1 addition & 1 deletion src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2228,7 +2228,7 @@ void MagicField::onStepInField(const std::shared_ptr<Creature> &creature) {
}
}

if (!harmfulField || (OTSYS_TIME() - createTime <= 5000) || creature->hasBeenAttacked(ownerId)) {
if (!harmfulField || (OTSYS_TIME() - createTime <= (uint32_t)g_configManager().getNumber(FIELD_OWNERSHIP)) || creature->hasBeenAttacked(ownerId)) {
conditionCopy->setParam(CONDITION_PARAM_OWNER, ownerId);
}
}
Expand Down

0 comments on commit 314bb37

Please sign in to comment.