ECompile / Scriptengine - Bug (POL 097 2008-02-26)

Report core bugs regarding the Ultima Online Emulator Core release (version 097). You can attach your Core Dump. One bug per post.

Moderator: POL Developer

Master Poster
Posts: 96
Joined: Sat Feb 04, 2006 1:24 pm
Location: Vienna, Austria

ECompile / Scriptengine - Bug (POL 097 2008-02-26)

Post by OWHorus » Thu Apr 24, 2008 12:20 pm

Hello all,

an old bug seems to raise it ugly head again :-).

I reported this quite a long time ago, and it was already fixed. I still have to check if it happens with the last core version before POL 097 2008-02-26:

In certain cases the assignment of an ItemRef to a struct element inside a struct initializer causes the struct and the ItemRef both to become invalid!

How to repeat:
Consider the following small program: It works as a command. Start it and select any item, it does not matter.
If the line marked as 'Bug' is active and the next two lines are commented out, the bug is seen: The print statements in the program print:
<uninitialized object>
<uninitialized object>

If the line marked as 'Bug' is commented out and the next two lines are active, the script runs as it should. Both sets of lines do exactly the same thing. The output as it is expected:
struct{ cmd = 10, field = <appobj:ItemRef>, type = 12 }

Code: Select all

// Ecompile Bug Test
use os;
use uo;
program test(who)
 var testitem := Target(who, 0);  // select any item
 print(testitem);                         // print an itemref
 var ev;
 if (testitem.serial)
    ev := struct {type := 12, cmd := 10, field := testitem};	 // Bug !
//    ev := struct {type := 12, cmd := 10, field};		      // No Bug
//    ev.field := testitem;	                                                 // No Bug		endif