[Beta] Lua error in CityBannerManager.lua GetWarmongerPreviewString

glider1

Deity
Joined
May 29, 2006
Messages
2,905
Location
Where animals hop not run
Line 215 of CityBannerManager:
strToolTip = strToolTip .. player:GetWarmongerPreviewString(city:GetOwner());

causes this lua error:
Spoiler :
[10955.263] Runtime Error: Assets\DLC\Expansion2\UI\InGame\CityBannerManager.lua:215: attempt to call method 'GetWarmongerPreviewString' (a nil value)
[10955.310] Runtime Error: Assets\DLC\Expansion2\UI\InGame\CityBannerManager.lua:215: attempt to call method 'GetWarmongerPreviewString' (a nil value)
[10955.482] Runtime Error: Assets\DLC\Expansion2\UI\InGame\CityBannerManager.lua:215: attempt to call method 'GetWarmongerPreviewString' (a nil value)
[10956.433] Runtime Error: Assets\DLC\Expansion2\UI\InGame\CityBannerManager.lua:215: attempt to call method 'GetWarmongerPreviewString' (a nil value)
[10956.558] Runtime Error: Assets\DLC\Expansion2\UI\InGame\CityBannerManager.lua:215: attempt to call method 'GetWarmongerPreviewString' (a nil value)

in scenarios where active player is at war with civs they have not met and who's city banner is not visible.
Commenting out the line removes all errors and the logs are clear.
 
[RESOLVED] although in theory it would be good practice for the code to ask city:IsVisible()? before executing line 215, modders can create always-at-war scenarios in other ways that should not cause this error.
 
Back
Top Bottom