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 github.com/DavidGriffith/inform … c7ed596e5b, this changed. The current (incorrect) behavior goes something like this:
[spoiler]> 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.
[/spoiler]
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():
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:
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.”: github.com/DavidGriffith/inform … 20ed1c94eb