Fix: Bug #7721 (h109): patch by ST2 included to make configuration options work correctly
This commit is contained in:
@@ -26,7 +26,7 @@ class CompanyGoal {
|
|||||||
goal_id = null; // Number of the goal in OpenTTD goal window.
|
goal_id = null; // Number of the goal in OpenTTD goal window.
|
||||||
timeout = null; // Timeout in ticks before the goal becomes obsolete.
|
timeout = null; // Timeout in ticks before the goal becomes obsolete.
|
||||||
reward = 0; // reward for reached goal (makes this come closer to subsidies)
|
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_town = GSController.GetSetting("rewardfactor_town");
|
||||||
rewardfactor_ind = GSController.GetSetting("rewardfactor_ind");
|
rewardfactor_ind = GSController.GetSetting("rewardfactor_ind");
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ class CompanyGoal {
|
|||||||
this.cargo = cargo;
|
this.cargo = cargo;
|
||||||
this.accept = accept;
|
this.accept = accept;
|
||||||
this.wanted_amount = wanted_amount;
|
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();
|
this.ResetTimeout();
|
||||||
|
|
||||||
// Construct goal if a company id was provided.
|
// Construct goal if a company id was provided.
|
||||||
@@ -53,13 +53,13 @@ class CompanyGoal {
|
|||||||
destination_string = GSText(GSText.STR_TOWN_NAME, destination);
|
destination_string = GSText(GSText.STR_TOWN_NAME, destination);
|
||||||
destination_string_news = GSText(GSText.STR_TOWN_NAME_NEWS, destination);
|
destination_string_news = GSText(GSText.STR_TOWN_NAME_NEWS, destination);
|
||||||
goal_type = GSGoal.GT_TOWN;
|
goal_type = GSGoal.GT_TOWN;
|
||||||
this.reward = this.reward * rewardfactor_town;
|
this.reward = (this.reward * rewardfactor_town) / 100;
|
||||||
} else {
|
} else {
|
||||||
destination = accept.ind;
|
destination = accept.ind;
|
||||||
destination_string = GSText(GSText.STR_INDUSTRY_NAME, destination);
|
destination_string = GSText(GSText.STR_INDUSTRY_NAME, destination);
|
||||||
destination_string_news = GSText(GSText.STR_INDUSTRY_NAME_NEWS, destination);
|
destination_string_news = GSText(GSText.STR_INDUSTRY_NAME_NEWS, destination);
|
||||||
goal_type = GSGoal.GT_INDUSTRY;
|
goal_type = GSGoal.GT_INDUSTRY;
|
||||||
this.reward = this.reward * rewardfactor_ind;
|
this.reward = (this.reward * rewardfactor_ind) / 100;
|
||||||
}
|
}
|
||||||
local goal_text, goal_news_text;
|
local goal_text, goal_news_text;
|
||||||
if (this.reward > 0) {
|
if (this.reward > 0) {
|
||||||
|
|||||||
26
info.nut
26
info.nut
@@ -98,32 +98,32 @@ function BeeRewardInfo::GetSettings()
|
|||||||
GSInfo.AddSetting({name="subsidy_factor",
|
GSInfo.AddSetting({name="subsidy_factor",
|
||||||
description="Factor to be multiplied with cargo amount as reward",
|
description="Factor to be multiplied with cargo amount as reward",
|
||||||
min_value=0,
|
min_value=0,
|
||||||
max_value=4,
|
max_value=4000,
|
||||||
easy_value=3,
|
easy_value=3000,
|
||||||
medium_value=2,
|
medium_value=2000,
|
||||||
hard_value=1,
|
hard_value=1000,
|
||||||
custom_value=0,
|
custom_value=0,
|
||||||
step_size=0.5,
|
step_size=1,
|
||||||
flags=GSInfo.CONFIG_INGAME});
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
GSInfo.AddSetting({name="rewardfactor_town",
|
GSInfo.AddSetting({name="rewardfactor_town",
|
||||||
description="Extra factor to be multiplied with reward for towns",
|
description="Extra factor to be multiplied with reward for towns",
|
||||||
min_value=0,
|
min_value=0,
|
||||||
max_value=2,
|
max_value=200,
|
||||||
easy_value=2,
|
easy_value=200,
|
||||||
medium_value=1,
|
medium_value=100,
|
||||||
hard_value=0,
|
hard_value=0,
|
||||||
custom_value=0,
|
custom_value=0,
|
||||||
step_size=0.1,
|
step_size=1,
|
||||||
flags=GSInfo.CONFIG_INGAME});
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
GSInfo.AddSetting({name="rewardfactor_ind",
|
GSInfo.AddSetting({name="rewardfactor_ind",
|
||||||
description="Extra factor to be multiplied with reward for industries",
|
description="Extra factor to be multiplied with reward for industries",
|
||||||
min_value=0,
|
min_value=0,
|
||||||
max_value=2,
|
max_value=200,
|
||||||
easy_value=2,
|
easy_value=200,
|
||||||
medium_value=1,
|
medium_value=100,
|
||||||
hard_value=0,
|
hard_value=0,
|
||||||
custom_value=0,
|
custom_value=0,
|
||||||
step_size=0.1,
|
step_size=1,
|
||||||
flags=GSInfo.CONFIG_INGAME});
|
flags=GSInfo.CONFIG_INGAME});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user