Skip to content

Commit

Permalink
Write HouseType indexes starting from 0 also in RA2YR mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Oct 24, 2024
1 parent ff63107 commit ba6217f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TSMapEditor/Initialization/MapWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public static void WriteHouseTypes(IMap map, IniFile mapIni)
{
HouseType houseType = houseTypes[i];
houseTypesSection.SetStringValue(
houseType.Index > -1 ? houseType.Index.ToString(CultureInfo.InvariantCulture) : i.ToString(CultureInfo.InvariantCulture),
i.ToString(CultureInfo.InvariantCulture),
houseType.ININame);

mapIni.RemoveSection(houseType.ININame);
Expand Down Expand Up @@ -428,7 +428,7 @@ public static void WriteHouses(IMap map, IniFile mapIni)
for (int i = 0; i < map.Houses.Count; i++)
{
House house = map.Houses[i];
housesSection.SetStringValue(house.ID > -1 ? house.ID.ToString() : i.ToString(), house.ININame);
housesSection.SetStringValue(house.ID > -1 ? house.ID.ToString(CultureInfo.InvariantCulture) : i.ToString(CultureInfo.InvariantCulture), house.ININame);

// When countries are not in use, the section is already removed by WriteHouseTypes
if (Constants.IsRA2YR)
Expand Down

0 comments on commit ba6217f

Please sign in to comment.