ID:2048087
 
(See the best response by Nadrew.)
Code:
if(!shop_items.len)


var/list/last = list()

for(var/item in subtypesof(/datum/shop_item))

var/datum/shop_item/I = new item()
if(!I.item)
continue
if(I.last) //error
last += I
continue

if(!shop_items[I.category])
shop_items[I.category] = list()

shop_items[I.category] += I

for(var/datum/shop_item/I in last)

if(!shop_items[I.category])
shop_items[I.category] = list()

shop_items[I.category] += I


Problem description:

shop\shop_item.dm:17:error: I.last: undefined var

BUT THE VAR IS RIGHT THERE, the code is inside a proc*, and i have another code that is the SAME code and has no errors

Best response
You're defining last as a local variable but trying to access it as an object variable belonging to /datum/shop_item. Remove the "I." part.