Page 1 of 1

item.hp -= 1;

Posted: Sun Apr 06, 2008 7:01 am
by OldnGrey
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.

Posted: Sun Apr 06, 2008 9:01 am
by *Edwards
I did in my combat hook and it's not working. I shall reply here in few minutes with a reel test & confirmation.

Posted: Sun Apr 06, 2008 9:15 am
by *Edwards
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.

Posted: Sun Apr 06, 2008 10:38 am
by ncrsn
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.

Posted: Sun Apr 06, 2008 2:17 pm
by Pierce
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

Posted: Sun Apr 06, 2008 10:43 pm
by OldnGrey
Thanks guys.
That confirms there is a bug in the distro combat scripts.