From 9a917be2e02d3b1cbb494cf6c93ab8fa4f29f939 Mon Sep 17 00:00:00 2001 From: jottyfan Date: Sun, 12 Jul 2015 14:48:16 +0200 Subject: [PATCH] Fix: Bug #7721 (h109): patch by ST2 included to make configuration options work correctly --- company.nut | 8 ++++---- info.nut | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/company.nut b/company.nut index b3b6513..d7cb67c 100644 --- a/company.nut +++ b/company.nut @@ -26,7 +26,7 @@ class CompanyGoal { goal_id = null; // Number of the goal in OpenTTD goal window. timeout = null; // Timeout in ticks before the goal becomes obsolete. reward = 0; // reward for reached goal (makes this come closer to subsidies) - subsidyfactor = GSController.GetSetting("subsidy_factor") * 20; + subsidyfactor = GSController.GetSetting("subsidy_factor"); rewardfactor_town = GSController.GetSetting("rewardfactor_town"); rewardfactor_ind = GSController.GetSetting("rewardfactor_ind"); @@ -42,7 +42,7 @@ class CompanyGoal { this.cargo = cargo; this.accept = accept; this.wanted_amount = wanted_amount; - this.reward = this.wanted_amount * subsidyfactor; // estimated factor, better would be a random value + this.reward = (this.wanted_amount * subsidyfactor) / 100; // estimated factor, better would be a random value this.ResetTimeout(); // Construct goal if a company id was provided. @@ -53,13 +53,13 @@ class CompanyGoal { destination_string = GSText(GSText.STR_TOWN_NAME, destination); destination_string_news = GSText(GSText.STR_TOWN_NAME_NEWS, destination); goal_type = GSGoal.GT_TOWN; - this.reward = this.reward * rewardfactor_town; + this.reward = (this.reward * rewardfactor_town) / 100; } else { destination = accept.ind; destination_string = GSText(GSText.STR_INDUSTRY_NAME, destination); destination_string_news = GSText(GSText.STR_INDUSTRY_NAME_NEWS, destination); goal_type = GSGoal.GT_INDUSTRY; - this.reward = this.reward * rewardfactor_ind; + this.reward = (this.reward * rewardfactor_ind) / 100; } local goal_text, goal_news_text; if (this.reward > 0) { diff --git a/info.nut b/info.nut index ddcc25d..400e7b8 100644 --- a/info.nut +++ b/info.nut @@ -98,32 +98,32 @@ function BeeRewardInfo::GetSettings() GSInfo.AddSetting({name="subsidy_factor", description="Factor to be multiplied with cargo amount as reward", min_value=0, - max_value=4, - easy_value=3, - medium_value=2, - hard_value=1, + max_value=4000, + easy_value=3000, + medium_value=2000, + hard_value=1000, custom_value=0, - step_size=0.5, + step_size=1, flags=GSInfo.CONFIG_INGAME}); GSInfo.AddSetting({name="rewardfactor_town", description="Extra factor to be multiplied with reward for towns", min_value=0, - max_value=2, - easy_value=2, - medium_value=1, + max_value=200, + easy_value=200, + medium_value=100, hard_value=0, custom_value=0, - step_size=0.1, + step_size=1, flags=GSInfo.CONFIG_INGAME}); GSInfo.AddSetting({name="rewardfactor_ind", description="Extra factor to be multiplied with reward for industries", min_value=0, - max_value=2, - easy_value=2, - medium_value=1, + max_value=200, + easy_value=200, + medium_value=100, hard_value=0, custom_value=0, - step_size=0.1, + step_size=1, flags=GSInfo.CONFIG_INGAME}); }