Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge management #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion nml/actions/action0properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,23 @@ def aircraft_is_large(value):
'graphic_flags' : {'size': 1, 'num': 0x09},
}

# TODO: Feature 0x06
#
# Feature 0x06 (Bridges)
#
properties[0x06] = {
# 0x08 - year availability (old way)
'min_length' : { 'num': 0x09, 'size': 1 },
'max_length' : { 'num': 0x0A, 'size': 1 },
# 0x0B - cost factor (old way)
'speed_limit' : { 'num': 0x0C, 'size': 2, 'unit_type': 'speed', 'unit_conversion': (5000, 1397), 'adjust_value': lambda val, unit: ottd_display_speed(val, 1, unit)},
'sprite' : { 'num': 0x0D, 'size': 2 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, based on my reading of the specs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I did it based on https://newgrf-specs.tt-wiki.net/wiki/Action0/Bridges

What is wrong according to you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prop 0D is not a simple 2 bytes value, it's more complex. See the example at the bottom of the page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sprites are clearly wrong... Need to find some to generate output, will be able to share full version then.

'flags' : { 'num': 0x0E, 'size': 1 },
'avail_year' : { 'num': 0x0F, 'size': 4 },
'name' : { 'num': 0x10, 'size': 2, 'string': 0xDC },
'description_rail_bridge' : { 'num': 0x11, 'size': 2, 'string': 0xDC },
'description_road_bridge' : { 'num': 0x12, 'size': 2, 'string': 0xDC },
'cost_factor' : { 'num': 0x13, 'size': 2 },
}

#
# Feature 0x07 (Houses)
Expand Down