For loop problem. in Developer Help
|
|
I'm putting in a separate command in my game to delete all objects that someone built through right clicking something and selecting it from a popup menu, since the other verb like it uses a list proc that basically disables the verb from being displayed in the popup menu.
Delete_All_Owned_Objects(obj/o in view()) set category = "Owner" set desc = "Delete everything that a specific key made." for(var/obj/P in world) if(P.owner == o.owner) del P del o
|
It keeps giving me the error: "Cannot read null.owner". Could anyone tell me why?
Also, is there a setting that can hide a verb from the verb panel, but still allows one to see it in a popup menu?
|
"P.owner"
I'm not sure how that code works, but to fix the error, add before "if(P.owner == o.owner)" this line "if(!P) continue". Sometimes a non-existing or something I do not exactly know of is returned in the world.contents list. That line will skip over null objects.