Tekamthi
Deity
- Joined
- Aug 12, 2016
- Messages
- 2,024
The uncertainty to me is, do I need brackets around the conditional? The existing "not ... ==" failed, unbracketed. I don't understand why exactly, it's poor form perhaps but shouldn't it evaluate to same as the ~= form?
My guess is it failed cuz 'pPlot:GetFeatureType()' immediately following an 'if' of 'if not', somehow evaluates to "true"; maybe cuz it returns a non-nil value? If so original code is basically checking if false == -1, and never triggers correctly.
So for 'if pPlot:GetFeatureType() ~= FeatureTypes.NO_FEATURE' we might get another problem, as it might evaluate this as 'if true ~= -1' and misfire as well?
to be safe I'd change the line to
My guess is it failed cuz 'pPlot:GetFeatureType()' immediately following an 'if' of 'if not', somehow evaluates to "true"; maybe cuz it returns a non-nil value? If so original code is basically checking if false == -1, and never triggers correctly.
So for 'if pPlot:GetFeatureType() ~= FeatureTypes.NO_FEATURE' we might get another problem, as it might evaluate this as 'if true ~= -1' and misfire as well?
to be safe I'd change the line to
Code:
if (pPlot:GetFeatureType() ~= FeatureTypes.NO_FEATURE) then return false end