item.hp -= 1;

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

Locked
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm
Contact:

item.hp -= 1;

Post by OldnGrey » Sun Apr 06, 2008 7:01 am

For some reason I am not able to decrement an item's hp using
item.hp -= 1;

item.hp := item.hp - 1;
does work as you'd expect.

Is there any problem with those operators when dealing with refs and not integers?
The distro combat hook has armour wear using item.hp -= 1;

So this may be a bug.
If anyone else can test this for me to confirm, it would be good.

User avatar
*Edwards
Forum Regular
Posts: 301
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada
Contact:

Post by *Edwards » Sun Apr 06, 2008 9:01 am

I did in my combat hook and it's not working. I shall reply here in few minutes with a reel test & confirmation.

User avatar
*Edwards
Forum Regular
Posts: 301
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada
Contact:

Post by *Edwards » Sun Apr 06, 2008 9:15 am

Result:
For some reason I am not able to decrement an item's hp using
item.hp -= 1;

item.hp := item.hp - 1;
does work as you'd expect.

User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Post by ncrsn » Sun Apr 06, 2008 10:38 am

AFAIK UObject member's values cannot be modified using -= += etc constructs. If I remember correctly, this is known bug, that is (too hard) to be fixed. Couldn't find the post stating so, thought.

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Post by Pierce » Sun Apr 06, 2008 2:17 pm

AFAIK UObject member's values cannot be modified using -= += etc constructs
That's true. You can find it here:

http://forums.polserver.com/sutra8110.p ... ight=#8110

User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm
Contact:

Post by OldnGrey » Sun Apr 06, 2008 10:43 pm

Thanks guys.
That confirms there is a bug in the distro combat scripts.

Locked