-- no culture on water tile
function CheckCultureChange(iHexX, iHexY, iPlayerID, bUnknown)
if (iPlayerID ~= -1) then
local x, y = ToGridFromHex( iHexX, iHexY )
local plot = GetPlot(x,y)
if ( plot:IsWater() ) then
plot:SetOwner(-1, -1)
end
end
end
Events.SerialEventHexCultureChanged.Add(CheckCultureChange)
-- You will need this for quick plot conversion
function GetPlot (x,y)
local plot = Map:GetPlotXY(y,x)
if plot then
return plot
else
print("GetPlot: Plot object could not be retrieved for plot coordinates: "..x..","..y)
end
end