Former Title: [TOTPP] IMPORTANT BUG FIX
EDIT: 4 August 2021: Version 0.16 of TOTPP comes with a civlua.lua file that incorporates all these changes. It is no longer necessary to make this change.
Action Required: The file civlua.lua in Test of Time\lua should be updated to the attached file. This is important to get correct, since most scenarios rely on the civlua.lua module in Test of Time\lua
Bug: Creating sea units on the ocean sometimes fails (and possibly sometimes land units can be created on the ocean when the code should prevent it, but that was not tested).
Reason: there is a comparison tile.terrainType == terrain.ocean in 2 places (one is actually a ~= comparison
Correction: The code should be (tile.terrainType % 16) == terrain.ocean
Also: a global variable city is created, this is switched to a local in this updated file. Pretty unlikely to cause a bug, but city is a reasonable variable name, and someone might make it global for some reason, and it could cause problems.
EDIT 4 November 2020: civ.getCosmic() replaced by civ.cosmic in updated file.
EDIT 26 February 2021: Fixed civlua.iterateTiles, which wasn't actually returning tiles.
EDIT: 4 August 2021: Version 0.16 of TOTPP comes with a civlua.lua file that incorporates all these changes. It is no longer necessary to make this change.
Action Required: The file civlua.lua in Test of Time\lua should be updated to the attached file. This is important to get correct, since most scenarios rely on the civlua.lua module in Test of Time\lua
Bug: Creating sea units on the ocean sometimes fails (and possibly sometimes land units can be created on the ocean when the code should prevent it, but that was not tested).
Reason: there is a comparison tile.terrainType == terrain.ocean in 2 places (one is actually a ~= comparison
Correction: The code should be (tile.terrainType % 16) == terrain.ocean
Also: a global variable city is created, this is switched to a local in this updated file. Pretty unlikely to cause a bug, but city is a reasonable variable name, and someone might make it global for some reason, and it could cause problems.
EDIT 4 November 2020: civ.getCosmic() replaced by civ.cosmic in updated file.
EDIT 26 February 2021: Fixed civlua.iterateTiles, which wasn't actually returning tiles.
Attachments
Last edited: