How do tell the game if a tile is yours?

To get the ownership/working details for a plot
Code:
local iOwner = pPlot:GetOwner() -- id of player owning the plot or -1 if none
local pCity = pPlot:GetWorkingCity() -- city working the plot or nil if none
local iCity = pPlot:GetCityPurchaseID() -- id of city that acquired plot

To set the ownership of a plot
Code:
pPlot:SetOwner(iNewOwner, iOwningCity)
take care with SetOwner() if the plot is already owned and being worked, as there are numerous hoops to jump through disconnecting the worker in the old city BEFORE the new player/city can take ownership.
 
Back
Top Bottom