安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题








1) Get a refinery with "Can smelt Scrap" on both Install and Permanent Install
2) Install it
3) Scrap smelting works
4) Permanently install it
5) Scrap smelting doesn't work anymore
In fact, here is the error in the code:
The tooltip (refinery.lua line 322) says "can smelt scrap" even if canScrapBonus is false, but on line 912, 1025 and 1137 you override canScrap with canScrapBonus. So the tooltip says it can smelt scrap but the bonus was defined as false and got overridden.
EDIT: Another issue is that on line 75, you are reading "canScrap" instead of "canScrapBonus"
In fact, you are doing a fundamental mistake by not re-seeding the random function on line 208. To avoid breaking things, I recommend adding this to line 208:
math.randomseed(seed)
math.random()
and replace the canScrap assignment with this:
-- CAN SCRAP
local canScrap = false
if math.random() < 0.5 then
canScrap = true
end
local canScrapBonus = false
if canScrap or math.random() < 0.5 then
canScrapBonus = true
end
Then return both canScrap and canScrapBonus from the same call.
This will re-seed the random and rolls a blank on it to reset the state to what it would be. Right now random will have an offset of 1 if the mod is installed temporarily, or 2 if it's installed permanently, which messes with canScrap. At the same time you need to also generate canScrapBonus in the same method instead of a second roll
EDIT: The textures folder seems to be in the wrong folder, it should be under data, not in the root folder. i.e. textures are under 2040989882\textures\icons but getIcon references them to be at 2040989882\data\textures\icons