item.layer

Moderator: POL Developer

Locked
garyglitter
New User
Posts: 13
Joined: Wed May 16, 2012 5:19 pm

item.layer

Post by garyglitter »

From memory from working on older cores, the item.layer method returned the items layer (iirc). Now I'm seeing that it only returns the items layer if it is equipped, otherwise it returns 0. I'm using tile_layer instead now, just thought this was weird.

I suppose it's a handy way to know if the item is equipped or not. I'm guessing this it the purpose of it, if so then the description ought to be changed from
equipment layer
to something like
equipment layer if equipped
save a bit of confusion on my part :P
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: item.layer

Post by RusseL »

core-changes.txt

Code: Select all

12-17 MuadDib:
        Fixed :  Item.layer gets reset to 0 when unequipped.
that was a bug :cheesy:
garyglitter
New User
Posts: 13
Joined: Wed May 16, 2012 5:19 pm

Re: item.layer

Post by garyglitter »

Ah ok. So it's only meant to return the layer when equipped then? Thanks :P I did have a look at the change log but didn't see that one haha.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: item.layer

Post by Tomi »

Another way to check if equipped is to check if item.container is a CharRef
Locked