The "acquire" goal is broken

Bug #1030537 reported by Erik Ogenvik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cyphesis
Fix Committed
Undecided
Erik Ogenvik

Bug Description

The "acquire" goal is broken, since the method "is_it_in_my_inventory" will always return false. The issue comes from doing a python comparison:
"return me.things[self.what][0].location.parent==me"

Both the objects referenced are of type NPCMind, and when inspected (through "print(str(me))") will point to the same NPCMind instance. But comparing them will yield false.

Calling "id(...)" on them will result in different values though.
Of interest might also be that the C++ method "Mind_compare" is never called when comparing them this way (it is however called when doing something like "me==me").

The main result of this is that the wood cutter and the planter will enter into incomplete goal states.

Revision history for this message
Al Riddoch (alriddoch) wrote :

Sounds reasonable. The protocols for object comparison have changed since Python 1.5.2, which is the version I wrote the initial port against, and over time I've modified the way comparison of wrapped objects work.

This may also be a symptom of other badness, as it is un-ideal that two wrappers exist for the same underlying object.

Al Riddoch (alriddoch)
Changed in cyphesis:
assignee: nobody → Al Riddoch (alriddoch)
Revision history for this message
Erik Ogenvik (erik-ogenvik) wrote :

Fixed with the Python bindings overhaul.

Changed in cyphesis:
assignee: Al Riddoch (alriddoch) → Erik Ogenvik (erik-ogenvik)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.