summaryrefslogtreecommitdiff
path: root/newgrf.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-18 11:23:58 +0000
committertron <tron@openttd.org>2005-10-18 11:23:58 +0000
commit24253c17cceadab0d30cef299f0ef0c669f5ecc1 (patch)
tree000f00442c2db76662d897b20b8ca8d16bb0a4ba /newgrf.c
parenta85d68ed574f547af2ccaeec1ddaff589480598f (diff)
downloadopenttd-24253c17cceadab0d30cef299f0ef0c669f5ecc1.tar.xz
(svn r3059) Use bitfields to encode railtype and climates of engines instead of manual shifting/anding
Diffstat (limited to 'newgrf.c')
-rw-r--r--newgrf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/newgrf.c b/newgrf.c
index d534181df..93905ed23 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -215,8 +215,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
FOR_EACH_OBJECT {
uint8 tracktype = grf_load_byte(&buf);
- ei[i].railtype_climates &= 0xf;
- ei[i].railtype_climates |= tracktype << 4;
+ ei[i].railtype = tracktype;
}
} break;
case 0x08: { /* AI passenger service */
@@ -1196,8 +1195,7 @@ static void VehicleChangeInfo(byte *buf, int len)
FOR_EACH_OBJECT {
uint8 climates = grf_load_byte(&buf);
- ei[i].railtype_climates &= 0xf0;
- ei[i].railtype_climates |= climates;
+ ei[i].climates = climates;
}
} break;
case 0x07: { /* Loading speed */