- Joined
- Jan 12, 2004
- Messages
- 1,311
Would it please
be possible expose to LUA mods an existing feature of the game: knowledge of which plot belongs to which city (note: it is already possible to set plot city ownership via plot:SetOwner(iPlayer,iCity,...), but reading it is currently not possible).
Here would be the code to add in CvLuaPlot.cpp.
- in CvLuaPlot:
ushMethods:
Method(GetCityPurchaseID);
- at the end of the file:
//------------------------------------------------------------------------------
//int GetCityPurchaseID();
int CvLuaPlot::lGetCityPurchaseID(lua_State* L)
{
return BasicLuaMethod(L, &CvPlot::GetCityPurchaseID);
}

Here would be the code to add in CvLuaPlot.cpp.
- in CvLuaPlot:

Method(GetCityPurchaseID);
- at the end of the file:
//------------------------------------------------------------------------------
//int GetCityPurchaseID();
int CvLuaPlot::lGetCityPurchaseID(lua_State* L)
{
return BasicLuaMethod(L, &CvPlot::GetCityPurchaseID);
}