HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. "Read more...":https://support.plan.io/news/187
Bug #929034
closedUnits costing less than 10 shields have 0 bribe cost.
0%
Description
/common/unit.c::unit_bribe_cost()
blamed lines of code: /* Consider the build cost. */
cost *= (unit_build_shield_cost_base(punit) / 10;
FIX: Forcing those to (float) fixed it at FCW, but note, FCW version of this function is divergent and has other vars also previously changed to float. So if changing that one line doesn't work, recommend changing more things to float and/or looking at the fcw.org version of the function which no longer has this bug.
Files
Updated by Lexxie L almost 2 years ago
I forgot to mention, fcw.org version of the code has previously fixed other similar maths bugs involving rounding and etc., such as a bug that made negative bribe costs where you got PAID to bribe units.
Updated by Marko Lindqvist almost 2 years ago
- File 0049-Make-unit-build-cost-s-effect-on-bribe-cost-float.patch 0049-Make-unit-build-cost-s-effect-on-bribe-cost-float.patch added
- File 0030-Make-unit-build-cost-s-effect-on-bribe-cost-float.patch 0030-Make-unit-build-cost-s-effect-on-bribe-cost-float.patch added
- Category set to General
- Status changed from New to Resolved
- Sprint/Milestone set to 2.6.5
Please open new tickets to osdn ( https://osdn.net/projects/freeciv/ticket/ ) in the future. We are phasing out hrm.
Updated by Marko Lindqvist almost 2 years ago
- Status changed from Resolved to Closed
- Assignee set to Marko Lindqvist
Updated by Lexxie L almost 2 years ago
FYI, I don't think this patch fixed the second bug, where extreme edge cases made negative bribe costs
Updated by Alexandro Ignatiev almost 2 years ago
just rant, why so float, not just
cost = cost * unit_build_shield_cost(punit) / 10;
and
return MAX(cost, 0)
in the end (well, can "Unit_Bribe_Cost_Pct" = -200 be a feature for a very useless undisbandable unit?) %\
Updated by Marko Lindqvist almost 2 years ago
Lexxie L wrote:
FYI, I don't think this patch fixed the second bug, where extreme edge cases made negative bribe costs
Updated by Marko Lindqvist almost 2 years ago
Alexandro Ignatiev wrote:
just rant, why so float
Please open a new ticket if you want this further adjusted. This ticket will now go to 2.6.5 in its present form unless actual regressions are found.