Guild_Check() |
Problem description:
My guild system is saved off of obj's. I wanted to create a proc that will check if their guild's obj exists upon log in, so that if a person disbands their guild while a member is offline, it will notify the person when they log in and strip them of their guild crap. To seek out the bug, I set up three test strings, and you never make it past src<<"Test1"(as in Test1 doesn't appear). Can somebody tell me where I went wrong with for(var/obj/Guild_Objects/Guild_Approved/G in world)?
Aside from that, you should handle most of the functionality within the object itself, and have a global handler datum keeping track of guild objects. I'll ignore the last part for now, but keep it in mind.
Having the object do the work makes your life a lot easier:
Within G.HandleMob(mob/M) you'd take care of handing out verbs and notifications, rather than putting it all in the Guild_Check() proc.
A handler datum will make your life even easier.
With a handler object like above you wouldn't need to loop through the world and you wouldn't have an issue of persistence. A call to GuildHandler.GetGuild(src.guildname) would get you the exact guild object you need.
Note that the above are examples of concepts and may not function as presented. You should apply the concepts to your own code and not copy character for character.