PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
DestroyItem on CanInsertScript -> Crash (POL 097)

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 097
Display posts from previous:   

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 168

PostPosted: Sun Mar 02, 2008 11:02 pm    Post subject: DestroyItem on CanInsertScript -> Crash (POL 097) Reply with quote

Consider this script:

Code:

use uo;

program CanInsertItemIntoContainer( who, container, movetype, inserttype, adding_item, existing_stack, amount_to_add )
    if (adding_item)
        DestroyItem(adding_item);
    endif
endprogram


Dragging item into container having caninsertscript like that will print into console "remove_item_from_world: item [serial] at 0,0 does not exist in world zone", "Unhandled Exception! Minidump started...", and POL will crash. If this is something _hard_ to fix so that destroying would become possible, how about failing the destroy request and printing something informal, like "GAAH! IDIOT SCRIPTER KILL KILL KILL!" into console instead? Even that would be better than crashing.

I see that this is noted in documentation, "You should not destroy the adding_item in the CanInsert script.", so maybe this should be feature request instead of bug report?

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Sun Mar 02, 2008 11:45 pm    Post subject: Reply with quote

Do you get problems in OnInsert?

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 168

PostPosted: Sun Mar 02, 2008 11:57 pm    Post subject: Reply with quote

No. OnInsertScript does not care if item gets destroyed.

To me this is more of a little annoyance, nice-to-not-have-around-if-you-are-new-to-escript, than something that cannot be lived with.

Author Message
coltain



Joined: 20 Mar 2007
Posts: 96
Location: Poland

PostPosted: Mon Mar 03, 2008 2:34 am    Post subject: Reply with quote

caninsert - return 1;
oninsert - destroy;

Author Message
CWO



Joined: 04 Feb 2006
Posts: 685
Location: Chicago, IL USA

PostPosted: Mon Mar 03, 2008 5:34 am    Post subject: Reply with quote

Right coltain... CanInsertScript is only saying to return 1 or 0 saying yes or no it can be inserted... OnInsertScript says what happens on the insert... like destroying and such.

Author Message
ncrsn



Joined: 10 Feb 2006
Posts: 168

PostPosted: Mon Mar 03, 2008 9:27 am    Post subject: Reply with quote

Even if it is wrong way to do things, POL should not crash. Say, for an example, that I don't do my homework of reading the docs: I modify a CanInsertScript to look like the one on first post, put it on a live shard, and unload it into use. If shard happens to crash (as it will, as soon as someone activates the script), I (as an average user) would blame the POL for being unstable.

Though I did something that _everyone_ here knows should not be done.

If, instead of crash, POL would print some informal message, I would eventually see that there is something wrong with my script. Result? POL wise, scripter stupid.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Bug Reports 097 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty