Weird coding in verbstub.h (DoSearch)

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Weird coding in verbstub.h (DoSearch)

Post by Merk »

Code: Select all

    elseif object is living
    {
        print CThe(object); MatchPlural(object, "doesn't", "don't");
        " let ";
        The(player)
        if object.pronouns #2
        {
            " search ";
            if object.pronouns #2
                print object.pronouns #2;
            else
                print object.pronoun;
        }
        print "."
    }
In the part where it checks for object.pronouns #2, it has an interior part that again checks for object.pronoun #2. Since it can't be in that block otherwise, the second check (and resulting "else") seems unnecessary...

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post by Kent »

It looks like I _may_ have intended "if object.pronouns" in the enclosing conditional. I'll have to look at this to see what the logic is in general.

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

Ah. As-is, it just seemed like extra code.

It really helps my understanding of the library files when I have to dig in to see how something does/doesn't work. :)

Post Reply