Loading

Paste #pkqhcuzzq

  1.     void BuildBridge(uint8 i)
  2.     {
  3.         switch ((TransportType)(this->type >> 15)) {
  4.             case TRANSPORT_RAIL: _last_railbridge_type = this->bridges->Get(i)->index; break;
  5.             case TRANSPORT_ROAD: _last_roadbridge_type = this->bridges->Get(i)->index; break;
  6.             default: break;
  7.         }
  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,
  12.                     CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge);
  13.     }

Version history

Revision # Author Created at
pyhluoqhz Anonymous 28 Mar 2016, 18:52:29 UTC Diff

Comments