Skip to content

Commit

Permalink
Fixed crash when the localised_description is a hardcoded string (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
LovelySanta committed Jun 6, 2022
1 parent 7d8f493 commit d6731cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions angelsaddons-mobility/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.0.10
Date: 06.06.2022
Bugfixes:
- Fixed crash when the localised_description is a hardcoded string (771)
---------------------------------------------------------------------------------------------------
Version: 0.0.9
Date: 10.08.2021
Features:
Expand Down
2 changes: 1 addition & 1 deletion angelsaddons-mobility/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angelsaddons-mobility",
"version": "0.0.9",
"version": "0.0.10",
"factorio_version": "1.1",
"title": "Angel's Addons - Mass Transit",
"author": "Arch666Angel, lovely_santa",
Expand Down
5 changes: 4 additions & 1 deletion angelsaddons-mobility/prototypes/train-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ local function add_speed_locale()
for _,train in pairs(data.raw[part]) do
if train then
if train.localised_description then --add to table
--table.insert(train.localised_description,"\n") --ensure new line at start?
if type(train.localised_description) == 'string' then
train.localised_description = {"", train.localised_description}
end
table.insert(train.localised_description,"\n") --ensure new line at start
table.insert(train.localised_description,{"speed-text.speed-cap", train.max_speed*216})
else-- add new table
train.localised_description={"speed-text.speed-cap", math.floor(train.max_speed*216*100)/100}--rounded tile/tick converted to km/h
Expand Down

0 comments on commit d6731cc

Please sign in to comment.