Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001909Core InformUnderstandingpublic2016-05-02 12:142017-08-16 22:16
Assigned To 
Platformx86OSMac OS XOS Version10.6.8
Product Version6M62 
Target VersionFixed in Version 
Summary0001909: Parser.i6t: ScoreMatchL rejects body parts as not matching "my" or owner descriptor in indef mode
DescriptionInform 7 models body parts of the player and other characters using I6-level component_parent, component child, and component_sibling properties rather than the usual object containment hierarchy (parent, child, and sibling).

However, the parser's notion of possession when scoring a match list in the presence of descriptors like "my" or "her" is based solely on traditional object containment and, consequently, it rejects body parts as not matching these descriptors.

The specific code that does this is in ScoreMatchL (irrelevant parts elided):
[ ScoreMatchL context its_owner its_score obj i j threshold met a_s l_s;
    if (indef_type & MY_BIT ~= 0) threshold++;
    if (indef_owner ~= nothing) threshold++;
    for (i=0 : i<number_matched : i++) {
        obj = match_list-->i; its_owner = parent(obj); its_score=0; met=0;
        if (indef_type & MY_BIT ~= 0 && its_owner == actor) met++;
        if (indef_owner ~= 0 && its_owner == indef_owner) met++;

        if (met < threshold) {
            #Ifdef DEBUG;
            if (parser_trace >= 4)
             print " ", (The) match_list-->i, " (", match_list-->i, ") in ",
             (the) its_owner, " is rejected (doesn't match descriptors)^";
            #Endif; ! DEBUG
            match_list-->i = -1;

I think that this code should take component relationships into account as well:

   for (i=0 : i<number_matched : i++) {
        obj = match_list-->i; its_owner = parent(obj); its_core = CoreOf(obj); its_score=0; met=0;
        if (indef_type & MY_BIT ~= 0 && (its_owner == actor || its_core == actor)) met++;
        if (indef_owner ~= 0 && (its_owner == indef_owner || its_core == indef_owner)) met++;
Minimal Source Text To Reproduce
An arm is a kind of thing. Understand "arm" as an arm.
A left arm is a kind of arm.
A right arm is a kind of arm.
A left arm is part of every person.
A right arm is part of every person.

Test Chamber is a room.
Alice is a woman in Test Chamber.

Test me with "x arms / x my arms / x her arms".
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
vlaviano (reporter)
2016-05-02 15:21
edited on: 2016-05-02 20:44

It might also be worth changing the tests for direct containment:

its_owner == actor
its_owner == indef_owner

into tests for indirect containment:

IndirectlyContains(actor, obj)
IndirectlyContains(indef_owner, obj)

since an object in a container held by a character can just as easily be said to belong to that character as a directly held object.

Edit: but not, I suppose, an object held by another character who is in turn held by the character. We'd want something like:

[ IndirectOwnerOf obj p;
        p = parent(obj);
        while (p && (~~(p ofclass K8_person))) p = parent(p);
        return p;

Edit2: For full generality, we'd want to unify this with the component stuff. We'd iterate upwards as with CoreOfParentOfCoreOf and return any animate (other than the original object) along the way, either in the component tree or the containment tree, as the indirect owner.

neroden (reporter)
2017-08-16 22:16

I may need this fix for something I'm writing; I might implement a patch.

- Issue History
Date Modified Username Field Change
2016-05-02 12:14 vlaviano New Issue
2016-05-02 15:21 vlaviano Note Added: 0004452
2016-05-02 15:32 vlaviano Note Edited: 0004452 View Revisions
2016-05-02 15:33 vlaviano Note Edited: 0004452 View Revisions
2016-05-02 15:34 vlaviano Note Edited: 0004452 View Revisions
2016-05-02 20:44 vlaviano Note Edited: 0004452 View Revisions
2017-08-16 22:16 neroden Note Added: 0004717
2017-08-16 22:16 neroden Issue Monitored: neroden

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker