ID:147952
 
Blarg.

GM_Summon_All()
set category = "Owner"
set name = "Summon all"
set desc = "Summon all players in the world."
if(alert("This will summon every player in the world. Continue?","Summon all","Yes","No") == "Yes")
for(var/mob/M in world)
if(istype(M,/mob/Car))
..()
if(M == usr)
..()

else
M.loc = locate(usr.x,usr.y - 1, usr.z)
M << "[usr] has summoned you!"
..()

I bolded and italicised the lines I'm having the problem with... It's supposed to ignore any mobs in the world that are of type mob/Car, and the person who used the verb naturally. If I put the "if(istype(M,/mob/Car))" line first, it summons all the cars and not the user of the verb, and if I put the "if(M == usr)" line first, it ignores the cars and summons the user of the verb. Help please? -.-'
Enigmaster2002 wrote:
for(var/mob/M in world)
if(istype(M,/mob/Car))
..()
else if(M == usr)
..()
else
M.loc = locate(usr.x,usr.y - 1, usr.z)
M << "<font color=red><b>[usr] has summoned you!</font></b>"
..()


The trouble with what you had before was that ..() just called back. It didn't stop the loop or skip that person.

--Tarmas.
..() calls the "old" version of a proc, when you override a proc with a new version. In this case, since the verb is new, ..() does absolutely nothing.

Since you didn't use the continue statement, your code keeps going. What you need to do is replace ..() in those places with continue.

It has to be continue instead of return, because the goal is to keep going through the loop, not break out of the verb.

Lummox JR