ID:170520
 
OK... so i add the GM or staff verbs using this.

verbs += typesof(/mob/Staff/verb)

ok... so it adds all the GM verbs to the person i choose. well when i want it to remove them i put in this

verbs -= typesof(/mob/Staff/verb)

but instead it wants to be a pain in the ass and give me errors like this.

GM.dm:9:error:/mob/Staff/verb: compile failed (possible infinite cross-reference loop) (the command that adds my GM verbs)

GM.dm:348:error:/mob/Staff/verb: compile failed (possible infinite cross-reference loop) (the command that takes them away)

how would i go about fixing this or do i have to take up 25 lines of coding and do it this way

verbs -= /mob/Staff/verb/Edit
Odine wrote:
GM.dm:9:error:/mob/Staff/verb: compile failed (possible infinite cross-reference loop) (the command that adds my GM verbs)

how would i go about fixing this or do i have to take up 25 lines of coding and do it this way

verbs -= /mob/Staff/verb/Edit

I made a test and it works for me. Can you post some code around the error part?


/Gazoot
Something like this wouldn't work:

Admin
verb
Give_Admin(mob/Player/P as mob in world)
P.verbs+=typesof(/Admin/verb)

Take_Admin(mob/Player/P as mob in world)
P.verbs-=typesof(/Admin/verb)


Basically, since typesof(/Admin/verb) also refers to the verb currently being used, DM assumes that it's an infinite cross-reference loop and refuses to compile it. This, unfortunately, has to be worked around. Here's one way to work around it:

Admin
verb
Give_Admin(mob/Player/P as mob in world)
P.GetAdmin()

Take_Admin(mob/Player/P as mob in world)
P.LoseAdmin()

mob/Player

proc
GetAdmin()
src.verbs+=typesof(/Admin/verb)

LoseAdmin()
src.verbs-=typesof(/Admin/verb)