johanberntsson / PunyInform

A fast and compact library for writing text adventure games for the Z-machine running on 8-bit computers as well as other platforms.
MIT License
176 stars 17 forks source link

"Take" (and others?) regression #89

Closed hlabrand closed 3 years ago

hlabrand commented 3 years ago

I upgraded to Puny v3.0 and I have a problem with "take". The "Taken." message is not displaying when it had before (i.e. when taking the knife from the compartment on the boat in TI).

I think the issue is in "PerformPreparedAction" : I modified the lib to make it

        print "this is PerformPreparedAction^";
                print "run_after_routines_msg : ", (string) run_after_routines_msg, "^";
                print "run_after_routines_msg : ", run_after_routines_msg, "^";
                print "keep_silent = ", keep_silent, "^";
        if(run_after_routines_msg && AfterRoutines() == false &&
                run_after_routines_msg > 1 &&
                keep_silent == false)
            PrintMsg(run_after_routines_msg, run_after_routines_arg_1);

Output:

this is PerformPreparedAction
run_after_routines_msg : Taken.
run_after_routines_msg : -31217
keep_silent = 0

This means "run_after_routines_msg > 1" fails. (Because it's a simple message?) This is with the current version of the code. Thanks!

Edit: I have the same behavior with "drop".

fredrikr commented 3 years ago

Oops, of course this fails! Fixed now.