This is behaving exactly as intended.Here is an example of what I mean by "function returning prematurely":
will result in:PHP:boolean test() { print( "start test" ); retrieve_item( 1, $item[ Xlyinia notebook ] ); print( "end test" ); return true; } void main() { test().print(); }
> call test.ash
start test
You need 1 more Xlyinia's notebook to continue.
false
Keep in mind that ASH is the "Advanced Script Handler". Although it is C-like in syntax, it is a scripting language. Scripts are expected to abort execution if a command fails. So, the following CLI script:
Code:
acquire 3 Mae West
adventure 1 Fudge Mountain
drink 3 Mae West
Code:
retrieve_item( 3, $item[ Mae West ] );
adventure( 1, $location[ Fudge Mountain ] );
drink( 3, $item[ Mae West ] );
Nope.It looks like a problem with ASH to me.
Yup. It is behaving exactly as intended.The same happens with adventure() for example, and this is why scripters have to capture its return value.
Yup.Checking if retrieve_item() returned false and aborting the script if needed should be the scripter's job. Having a function returning prematurely could upset the rest of the script without dealing with the problem, if the scripter doesn't capture the return value.
Last edited: