AIs can fail at requesting 170 years inflation loan with a 4% interest rate #8453
Labels
bug
Something isn't working
component: AI/Game script (squirrel)
This issue is related to Squirrel (Scripting language)
The AI is setting loan amount to £1,641,693,900,000 and has a current loan of £82,050,000.
OpenTTD/src/script/api/script_company.cpp
Lines 207 to 209 in edbb5f4
Following the code,
abs(1,641,693,900,000 - 82,050,000)
= 1,641,611,850,000 is passed to this function:OpenTTD/src/script/api/script_object.hpp
Lines 69 to 72 in edbb5f4
uint32 p1
transforms the value to 934,342,928This ends up failing to set the loan even to the bugged value:
OpenTTD/src/misc_cmd.cpp
Lines 57 to 58 in edbb5f4
p1 % LOAN_INTERVAL != 0
is true, returnsCMD_ERROR
The text was updated successfully, but these errors were encountered: