goap
goap copied to clipboard
populateState comparing whole KVPs instead of just keys?
https://github.com/sploreg/goap/blob/d1cea0728fb4733266affea8049da1e373d618f7/Assets/Standard%20Assets/Scripts/AI/GOAP/GoapPlanner.cs#L160
// if the key exists in the current state, update the Value
bool exists = false;
foreach (KeyValuePair<string,object> s in state) {
if (s.Equals(change)) { // <-- problem?
exists = true;
break;
}
}
am I missing something? This appears to be comparing whole KVPs, not just the keys.
if (s.Key.Equals(change.Key)) {
appears to work.