Merge branch 'master' into jgrpp
# Conflicts: # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj.filters # src/base_consist.h # src/company_base.h # src/newgrf_config.cpp # src/newgrf_config.h # src/openttd.cpp # src/saveload/saveload.cpp # src/saveload/saveload.h # src/saveload/station_sl.cpp # src/settings.cpp # src/signs_base.h # src/string.cpp # src/string_func.h # src/table/misc_settings.ini # src/table/settings.h.preamble # src/town_cmd.cpp # src/vehicle.cpp # src/vehicle_cmd.cpp # src/video/cocoa/cocoa_v.mm # src/video/null_v.cpp
This commit is contained in:
@@ -4139,7 +4139,7 @@ static uint UpdateStationWaiting(Station *st, CargoID type, uint amount, SourceT
|
||||
static bool IsUniqueStationName(const char *name)
|
||||
{
|
||||
for (const Station *st : Station::Iterate()) {
|
||||
if (st->name != nullptr && strcmp(st->name, name) == 0) return false;
|
||||
if (!st->name.empty() && st->name == name) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -4171,8 +4171,11 @@ CommandCost CmdRenameStation(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
st->cached_name.clear();
|
||||
free(st->name);
|
||||
st->name = reset ? nullptr : stredup(text);
|
||||
if (reset) {
|
||||
st->name.clear();
|
||||
} else {
|
||||
st->name = text;
|
||||
}
|
||||
|
||||
st->UpdateVirtCoord();
|
||||
InvalidateWindowData(WC_STATION_LIST, st->owner, 1);
|
||||
|
Reference in New Issue
Block a user