Anonymous

Module:Township: Difference between revisions

From Melvor Idle
_GetrBuildingByName: Fix statue handling following localization changes
No edit summary
(_GetrBuildingByName: Fix statue handling following localization changes)
Line 302: Line 302:
function p._GetBuildingByName(name)
function p._GetBuildingByName(name)
-- Check for the special statue case
-- Check for the special statue case
if name == 'STATUE_NAME' then
if name == 'Statues' then
name = 'Statue of Worship'
name = 'Statue of Worship'
end
end
local STATUE_OF = 'Statue of '
local STATUE_OF = 'Statue of '
if string.sub(name, 1, string.len(STATUE_OF)) == STATUE_OF then
if string.sub(name, 1, string.len(STATUE_OF)) == STATUE_OF then
local building = Shared.clone(GameData.getEntityByName(Township.buildings, 'STATUE_NAME'))
local building = Shared.clone(GameData.getEntityByID(Township.buildings, 'melvorF:Statues'))
building.name = name
building.name = name
return building
return building