ID:267229
 
mob/PLAYER/verb/Switch(mob/M)
var/client/MC = M.client
var/client/C = client //Holds the clients in variables, because they will be jumping around.
var/S = M.name //Holding the name
src.iswitching = 1
M.iswitching = 1
M.name = src.name
src.name = S //Swapping the names
MC.mob = null
C.mob = M
MC.mob = src //Switching between the mobs
src.iswitching = 0
M.iswitching = 0


this is my code... and the iswitching is so the people switching won't logout...
now the problem seems to not be the 1st time switching but the 2nd time.....
When I switch with another it switchs just right.. but when the other person switchs back with me I get this

runtime error: Cannot modify null.mob.
proc name: Switch (/mob/PLAYER/verb/Switch)
usr: Shy_guy197 (/mob)
src: Shy_guy197 (/mob)
call stack:
Shy_guy197 (/mob): Switch(Gakumerasara (/mob))

which I think it has something to do with

the MC = null part... I dunno but it is the second time it does it...

if anyone can help out I would like that very much
You are correct. When you make MC=null it calls that client's Del() before it can Login() to the new mob. I suggest making a temporary mob to assossiate the MC with, switching C.mob to the other mob like you did, then switching MC.mob to the mob that C originally had. Then delete the temporary mob.

-Loduwijk