Resolved Tax Corruption due to low loyalty and low security are both bugged

Users who are viewing this thread

Version number
1.5.10
Branch
Beta
Modded/unmodded
No, I didn't use any mods.
Summary: When a settlement's loyalty or security are low (< 50), the taxes provided by the settlement are reduced due to "corruption." There was previously a bug that miscalculated the reduction that has been fixed. However, another bug has been introduced that prevents the tax reduction from happening at all. In the methods CalculateGoldCutDueToLowLoyalty and CalculateGoldCutDueToLowSecurity, there is an error where a few decimal values are multiplied together, then converted to an integer, then back to a float. The resulting values from the multiplication operation are < 1, so when the results are converted into an integer, the decimal places get truncated, and the value becomes 0. When converted back to a float, the value remains 0, preventing any reduction to taxes.

For loyalty specifically, when loyalty is < 25 taxes are removed completely. This part works as intended. It is only for loyalty values between 25 and 50 that this bug occurs.

How to Reproduce: Set a settlement's loyalty and security values to a number between 25 and 50, and observe the tax tooltip in the Town Management menu. They will not show any reduction.

Media (Screenshots & Video):

XZUKj.png
 
Back
Top Bottom