aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authorMaverick2797 <git.maverick2797@gmail.com>2025-10-18 16:42:41 +0800
committerorwell <orwell@bleipb.de>2026-01-29 21:42:11 +0100
commitab35c7b05b5209e7b982f2ea936fb713c7fc83fe (patch)
tree5ecd830ddcdda259610be82fa3737b0c3a0afbba /advtrains
parentf68dcd083a1bfe59d77afac300adbc29a7c70138 (diff)
Redo how wagon groups are calculated
- Added "at_rideable" to include anything that can be ridden, rather than the previous hardcoded "pass" seat name. - Changed how "at_control" was calculated (now checks for driving_ctrl_access) - Changed how "at_pax" was calculated (now checks for not driving_ctrl_access)
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/wagons.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 52ce577..adb12b0 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -1401,8 +1401,14 @@ function advtrains.register_wagon(sysname_p, prototype, desc, inv_img, nincreati
local wagon_groups = { not_in_creative_inventory = nincreative and 1 or 0}
if prototype.is_locomotive then wagon_groups['at_loco'] = 1 end
if prototype.seat_groups then
- if prototype.seat_groups.dstand then wagon_groups['at_control'] = 1 end
- if prototype.seat_groups.pass then wagon_groups['at_pax'] = 1 end
+ wagon_groups['at_rideable'] = 1
+ for seats, seat in pairs(prototype.seat_groups) do
+ if seat.driving_ctrl_access then
+ wagon_groups['at_control'] = 1
+ else
+ wagon_groups['at_pax'] = 1
+ end
+ end
end
if prototype.has_inventory then wagon_groups['at_freight'] = 1 end