sploreg / goap

Goal Oriented Action Planning AI in Unity
MIT License
671 stars 170 forks source link

Update GoapPlanner.cs #3

Open ScottyXIII opened 5 years ago

ScottyXIII commented 5 years ago

Hi, not sure if this is still maintained but I come across this code from an article online and found an issue.

When I had no goals assigned I was noticing plans were still being built so I checked and found the inState() function would still return true if it's test parm was empty. The comment says it should return false so I put in a PR.

Was also wonder if there was a reason why you did not use state.Contains(t) rather than looping over state and checking each value? I think the built in Contains() function dose pretty much the same thing?