Codechange: Use GetString() with local parameters in script functions. (#13585)

This commit is contained in:
Peter Nelson
2025-02-16 21:27:25 +00:00
committed by GitHub
parent fd4adc55e3
commit 154896ce55
18 changed files with 19 additions and 39 deletions

View File

@@ -15,6 +15,7 @@
#include "../../landscape_cmd.h"
#include "../../road_cmd.h"
#include "../../station_cmd.h"
#include "../../strings_func.h"
#include "../../newgrf_roadstop.h"
#include "../../script/squirrel_helper_type.hpp"
@@ -29,7 +30,7 @@
{
if (!IsRoadTypeAvailable(road_type)) return std::nullopt;
return GetString(GetRoadTypeInfo((::RoadType)road_type)->strings.name);
return ::StrMakeValid(::GetString(GetRoadTypeInfo((::RoadType)road_type)->strings.name));
}
/* static */ bool ScriptRoad::IsRoadTile(TileIndex tile)