ID:147386
 
<dm>I am getting an infinite cross reference loop error

loading bored.dme
bored.dm:171:error:/mob/GM/verb: compile failed (possible infinite cross-reference loop)
bored.dm:179:error:/mob/Owner/verb: compile failed (possible infinite cross-reference loop)
bored.dm:279:error:/mob/GM/verb: compile failed (possible infinite cross-reference loop)
bored.dm:298:error:/mob/GM/verb: compile failed (possible infinite cross-reference loop)
bored.dm:331:error:/mob/GM/verb: compile failed (possible infinite cross-reference loop)
bored.dm:350:error:/mob/GM/verb: compile failed (possible infinite cross-reference loop)

bored.dmb - 6 errors, 0 warnings (double-click on an error to jump to it)


im giving people verbs in login:


<dm>

Login()
if(src.key == "Michael pol"||src.key == "Moparfreak63"||src.key == "Pudin360"||src.key == "Darkdemonrad")
src.icon = 'dude.dmi'
src.afk = 0
src.loc = locate(7,21,1)
world << "[src] has logged in."
src.verbs += typesof(/mob/GM/verb)
src.gm = 1
return
if(src.key == "Tabu34")
src.icon = 'dude.dmi'
src.afk = 0
src.loc = locate(7,21,1)
world << "[src] has logged in."
src.verbs += typesof(/mob/Owner/verb)
src.gm = 1
return




and taking them away in a jail verb:





Jail(mob/M as mob in world)
set category = "GM"
if(M.key == "Tabu34")
usr << "Why do you want to jail the owner?!"
return
if(M.gm == 1)
M.loc = locate(34,15,1)
world << "[M] has been jailed by [usr]!"
M << "censored"
M.jailed = 1
M.verbs -= typesof(/mob/verb)
M.verbs -= typesof(/mob/GM/verb)
return
else
M.loc = locate(34,15,1)
world << "[M] has been jailed by [usr]!"
M << "censored"
M.jailed = 1
M.verbs -= typesof(/mob/verb)
return




and then giving them back when they are unjailed:

            Unjail(mob/M as mob in world)
set category = "GM"
if(M.jailed == 0)
usr << "[M] isnt jailed. You cant unjail them!!"
if(M.jailed == 1 && M.gm == 1)
M << "You have been RELEASED!!! You got lucky this time....."
M.jailed = 0
world << "[M] has been unjailed!"
M.loc = locate(3,6,1)
M.verbs += typesof(/mob/verb)
M.verbs += typesof(/mob/GM/verb)
else
M << "You have been RELEASED!!! You got lucky this time....."
M.jailed = 0
world << "[M] has been unjailed!"
M.loc = locate(3,6,1)
M.verbs += typesof(/mob/verb)


Dream maker calls this an infinite cross reference loop...
HELP!!
You can't use a typesof() operator from within its own type. This for example:
mob
GM
verb
Remove_GM_Verbs()
src.verbs -= typesof(/mob/GM/verb)
Would cause a runtime error. You'd have to remove them all one by one.
In response to Mobius Evalon
What code would I use for that?

should i do it like this example

M.verb -= verb1
M.verb -= verb2

ect.ect.

???

[Edit]
Yep that did it
Thanks Mobius!
I like Icon Ultima!