statpanel("Inventory")
for(var/obj/X in src.contents)
if(X.type == /obj/magic/spells)
//do nothing
else
stat(X)
statpanel("Spells")
for(var/obj/magic/spells/X in src.contents)
stat(X)
Problem description:
I'm trying to get spells to only appear in the Spells tab, but they appear in the Inventory as well as the Spells tab. What's the problem?
Try using the istype() proc in your if() check. Your code doesn't consider sub-types of /obj/magic/spells, so it will skip obj/magic/spells/fireball, for instance.