Skip to content

Commit

Permalink
Allow using the unit type for Shield2Gold_Factor
Browse files Browse the repository at this point in the history
Closes #769.
  • Loading branch information
lmoureaux committed Dec 4, 2023
1 parent 3268d35 commit 6999e31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/unittype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ int utype_upkeep_cost(const struct unit_type *ut, struct player *pplayer,
FIXME: Should the ai know about this? */
if (utype_has_flag(ut, UTYF_SHIELD2GOLD)
&& (otype == O_GOLD || otype == O_SHIELD)) {
gold_upkeep_factor = get_player_bonus(pplayer, EFT_SHIELD2GOLD_FACTOR);
gold_upkeep_factor =
get_unittype_bonus(pplayer, nullptr, ut, EFT_SHIELD2GOLD_FACTOR);
if (gold_upkeep_factor > 0) {
switch (otype) {
case O_GOLD:
Expand Down

0 comments on commit 6999e31

Please sign in to comment.