Skip to content

Commit

Permalink
Update 2.5.1 (#10)
Browse files Browse the repository at this point in the history
- Fixed a bug that prevented the debuff from disappearing after disbanding units
  • Loading branch information
msolefonte authored Aug 23, 2022
1 parent 2740311 commit 719fbbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added support for instant recruitment (i.e. Nurgle/Regiment of Renown)
- Updated versioning to reflect original work by Jadawin

## [2.5.1] - 23.08.2022

- Fixed a bug that prevented the debuff from disappearing after disbanding units
17 changes: 12 additions & 5 deletions src/script/campaign/mod/cbac-player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ local function enforce_army_cost_limit(character)
end

local function enforce_faction_cost_limit(faction)
cbac:log("Enforcing faction cost limits for faction " .. faction:name());
for i = 0, faction:character_list():num_items() - 1 do
enforce_army_cost_limit(faction:character_list():item_at(i));
end
Expand All @@ -48,8 +49,11 @@ local function add_listeners()
end,
function()
cm:callback(function()
enforce_faction_cost_limit(cm:model():world():whose_turn_is_it());
end, 0.1)
local active_factions = cm:model():world():whose_turn_is_it();
for i = 0, active_factions:num_items() - 1 do
enforce_faction_cost_limit(active_factions:item_at(i));
end
end, 0.1)
end,
true
);
Expand All @@ -72,10 +76,13 @@ local function add_listeners()
function(context)
return cm.campaign_ui_manager:is_panel_open("units_panel") and context:unit():faction():is_human();
end,
function(context)
function()
cm:callback(function()
enforce_faction_cost_limit(cm:model():world():whose_turn_is_it());
end, 0.1)
local active_factions = cm:model():world():whose_turn_is_it();
for i = 0, active_factions:num_items() - 1 do
enforce_faction_cost_limit(active_factions:item_at(i));
end
end, 0.1)
end,
true
);
Expand Down

0 comments on commit 719fbbd

Please sign in to comment.