I have a for loop that loops through usr.contents for all atoms of type componentType. Seems simple but when the loop is done componentType is null.
Code Snippet (if applicable) to Reproduce Problem:
obj
Knife
icon_state = "Knife"
components = list(/obj/Blade = 1, /obj/Handle = 1)
// Check for all components needed
for(var/componentType in components)
world << componentType
// How many of these components are in usr contents?
var/amountFound = 0
for(componentType in usr.contents)
amountFound ++
world << componentType
Expected Results:
The output should be:
/obj/blade
/obj/blade
/obj/handle
/obj/handle
Actual Results:
The output is:
/obj/blade
(blank line) (null)
/obj/handle
(blank line) (null)
I'm sure it's null because I checked using if(componentType == null) and it came back yes. Plus null is outputted of course as a blank line.