item.layer

Moderator: POL Developer

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

item.layer

Post by garyglitter » Thu Jun 07, 2012 6:12 am

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: 315
Joined: Fri Feb 20, 2009 8:30 pm

Re: item.layer

Post by RusseL » Thu Jun 07, 2012 2:14 pm

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 » Thu Jun 07, 2012 8:10 pm

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: 464
Joined: Tue Feb 21, 2006 5:08 pm

Re: item.layer

Post by Tomi » Sat Jun 09, 2012 2:03 am

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

Locked

Who is online

Users browsing this forum: No registered users and 1 guest