Old revision #pyhluoqhz | New revision #pkqhcuzzq | ||
---|---|---|---|
5 | case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->Get(i)->index; break; | 5 | case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->Get(i)->index; break; |
6 | default: break; | 6 | default: break; |
7 | } | 7 | } |
8 | DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->Get(i)->index | (_bridge_cur_road_subtype << 17), | 8 | // Alberth: It's hacky, but it ensures your bits are preserved (shifting 17 times in a value with width 8 is undefined behavior) |
9 | uint32 w = _bridge_cur_road_subtype; | ||
10 | w <<= 17; | ||
11 | DoCommandP(this->end_tile, this->start_tile, this->type | this->bridges->Get(i)->index | w, | ||
9 | CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge); | 12 | CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge); |
10 | } | 13 | } |