Codechange: do not keep local variable for temporary string parameters
This commit is contained in:
@@ -208,12 +208,11 @@ public:
|
||||
/* Location */
|
||||
std::stringstream tile_ss;
|
||||
tile_ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << std::uppercase << tile; // 0x%.4X
|
||||
std::string tile_str = tile_ss.str(); // Can't pass it directly to SetDParamStr as the string is only a temporary and would be destructed before the GetString call.
|
||||
|
||||
SetDParam(0, TileX(tile));
|
||||
SetDParam(1, TileY(tile));
|
||||
SetDParam(2, GetTileZ(tile));
|
||||
SetDParamStr(3, tile_str);
|
||||
SetDParamStr(3, tile_ss.str());
|
||||
this->landinfo_data.push_back(GetString(STR_LAND_AREA_INFORMATION_LANDINFO_COORDS));
|
||||
|
||||
/* Local authority */
|
||||
|
Reference in New Issue
Block a user