ID:139729
 
Code:
mob
proc
SendOut(var/Pokemon/P, var/atom/new_loc)
if(!new_loc)
new_loc = src.loc
OldMob = src.client.mob
P.loc = new_loc
src.client.mob = P
Return()
alert(src, "Called Return For [OldMob]")
if(src.OldMob)
client.RETURNPOKEMON()
client
proc
RETURNPOKEMON()
var/mob/B = mob
var/mob/A = mob.OldMob
mob = A
mob += B
mob.OldMob = null


Problem description:
Well it's probably some stupid mistake I'm not noticing, I've redone this 3 times and looked over it more then 10 times that but I'm not seeing the problem which is that return isn't returning you to your old mob. I checked and apparently Oldmob is null?
You're setting OldMob on the old mob and then switching.

        SendOut(var/Pokemon/P, var/atom/new_loc)
if(!new_loc)
new_loc = src.loc
p.OldMob = src.client.mob
P.loc = new_loc
src.client.mob = P


Additionally, adding B to the client's 'mob' variable in RETURNPOKEMON doesn't make any sense.
In response to Jp
yea i eventually noticed all of that and i fixed everything, thank you.