LUA Plot Types

Wolfdog

Unit Butcher
Joined
Jun 29, 2012
Messages
660
Location
Australia
I am trying to fix a bit of LUA that is annoying me and I have no idea what I am doing. Will this code work or am I way off. It is the City Partisans script that spawns partisans but it is bugs me that it spawns units on the sea plots.

I want to change this:
Code:
if(dist < 3 and (plot:GetOwner() == newPlayerID or plot:GetOwner() == -1) and plot:GetNumUnits() == 0) then

to this:
Code:
local plot_type = plot:GetPlotType();
					
if(dist < 3 and (plot:GetOwner() == newPlayerID or plot:GetOwner() == -1) and plot:GetNumUnits() == 0) and plot_type == PlotTypes.PLOT_LAND or plot_type == PlotTypes.PLOT_HILLS then

Thanks.
 
Just check the plot for not being water

not plot:IsWater()
 
Back
Top Bottom