Bug, feature or midunderstanding?

fronobulax

Developer
Staff member
r8466
This is a simple test case that illustrates my concern. I was trying to write a script that pulled things from my DC and conditionally used them. The items to be pulled were in a map file so I could write a corresponding script to return them to the DC.
Code:
boolean success;
item it = $item[Bricko egg];
int have = item_amount(it);
print("Have "+have+" of "+it);
success = put_display(1, it);
have = display_amount(it);
print("Success "+success+" and have "+have+" of "+it+" in DC");
I do not have a BRICKO egg so I would expect put_display to return false and display_amount to return zero. However, when I run the script I get the following output.
> call scripts\WTF.ash

Have 0 of BRICKO egg
Updating display case...
Placing items in display case...
Success true and have 1 of BRICKO egg in DC
Requests complete.

I don't see any obvious error on my part (although I have been known to miss the obvious) and the Wiki documentation for the various functions suggests my expectation is reasonable.

Am I doing something wrong that I cannot see? Am I misinterpreting the wiki entries for the functions? Have I found a mafia bug?

Thanks.
 
Top