intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Feb 22, 2019 12:24 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Aug 19, 2014 2:29 am 
Offline
User avatar

Joined: Mon Dec 12, 2011 7:03 pm
Posts: 576
Location: Washington
Here's a new regression spotted by the ever-diligent Nathan Schwartzman: If Paul, an NPC, is not interested in doing something, then ordering Paul to do that action to a multitude of objects should generate only one "Paul has better things to do." message. Sometime between commits https://github.com/DavidGriffith/inform ... a3decab21c and https://github.com/DavidGriffith/inform ... c7ed596e5b, this changed. The current (incorrect) behavior goes something like this:

Spoiler: show
> PAUL, TAKE ALL
rock: Paul has better things to do.
rock: Paul has better things to do.
rock: Paul has better things to do.
rock: Paul has better things to do.
rock: Paul has better things to do.
rock: Paul has better things to do.
gold key: Paul has better things to do.
silver key: Paul has better things to do.
lamp: Paul has better things to do.
mailbox: Paul has better things to do.

>


The changes that were made during this time were quite massive. I've identified InformLibrary.actor_act() as the source of the "Paul has better things to do." message. The property is first called like this in parserm.h in InformLibrary.play():

Code:
if (self.actor_act(actor, action, noun, second)) jump begin__action;
    jump turn__end;


This appears to handle orders on single objects. Multiple objects are handled a little further down like this:

Code:
if (inp1 == 0) {
    inp1 = l;
    if (self.actor_act(actor, action, l, second)) jump begin__action;
    inp1 = 0;
} else {
    inp2 = l;
    if (self.actor_act(actor, action, noun, l)) jump begin__action;
    inp2 = 0;
}eck


Here's what has me scratching my head. Under no circumstances does it appear that InformLibrary.actor_act() returns anything other than 0 (or false). Of what use is checking if that property returns something positive? According to what I see in the old CVS, Roger Firth wrote that property in 2004. Does anyone else remember what was planned for that property that would have prompted Roger to write a check like that? I would like to rewrite things such that InformLibrary.actor_act() returns a value that tells InformLibrary.play() that it should stop trying to do stuff and just end the turn, but I want to understand what was intended first.

Here's what I came up with for fixing the cascade of "...has better things to do.": https://github.com/DavidGriffith/inform ... 20ed1c94eb

_________________
David Griffith


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group