[Hugo] Lib Bug? Ask Barman About Himself...
Posted: Tue Jan 16, 2007 12:24 pm
Mainly for Kent:
Somebody posted an interesting question to the newsgroup. Basically, if the him_obj is set to an NPC and you immediately try to do something like "ask barman about himself" (where him_obj is not the barman), then the Hugo lib works unexpectedly.
As far as I can tell, it's happening in objlib.h, in the self_class. What gets returned for the xobject used by the self_class is himself.self_object or herself.self_object -- which is always "him_obj" or "her_obj".
If you were to say "x barman" and then "ask barman about himself" I think it'd work fine (I haven't tested it) -- because him_obj is going to be set correctly. But if you say something like "x other guy" and then "ask barman about himself", the barman is going to respond as if "himself" is "other guy" becase him_obj is set to the other guy.
The "xobject" checking makes sure that the object is actually living and appropriate for the pronoun (via checking self.self_resolve). So, self_class *already* knows that the self-referencing pronoun refers to the object. So, I think the bug is actually in self_class. It shouldn't be using self.self_object as the xobject in the perform() call -- it should be using object as the xobject, right?
So, where line 125 in objlib.h currently says this:
It should be changed to this:
Right? The whole purpose of self_class when the self pronoun is the xobject is to make the object refer to itself. So, self.self_object is okay when the pronoun was the object, but not when it's the xobject. Right?
Somebody posted an interesting question to the newsgroup. Basically, if the him_obj is set to an NPC and you immediately try to do something like "ask barman about himself" (where him_obj is not the barman), then the Hugo lib works unexpectedly.
As far as I can tell, it's happening in objlib.h, in the self_class. What gets returned for the xobject used by the self_class is himself.self_object or herself.self_object -- which is always "him_obj" or "her_obj".
If you were to say "x barman" and then "ask barman about himself" I think it'd work fine (I haven't tested it) -- because him_obj is going to be set correctly. But if you say something like "x other guy" and then "ask barman about himself", the barman is going to respond as if "himself" is "other guy" becase him_obj is set to the other guy.
The "xobject" checking makes sure that the object is actually living and appropriate for the pronoun (via checking self.self_resolve). So, self_class *already* knows that the self-referencing pronoun refers to the object. So, I think the bug is actually in self_class. It shouldn't be using self.self_object as the xobject in the perform() call -- it should be using object as the xobject, right?
So, where line 125 in objlib.h currently says this:
Code: Select all
Perform(verbroutine, object, self.self_object)
Code: Select all
Perform(verbroutine, object, object)