ID:262866
 
Code:
client/Del()
for(var/mob/pet/P in world)
if(P.owner == src)
P.loc = usr
usr.ingat = 0
usr.intank = 0
usr.ingar = 0
usr.Jyuken = 0
usr.Tekken = 0
usr.bunshin = 0
usr.Basic = 1
usr.Kaiten = 0
usr.intank = 0
usr.overlays -= 'meattank.dmi'
usr.overlays -= 'hakkeshou.dmi'
usr.overlays -= 'gatsuuga.dmi'
usr.Move_Delay = usr.Savedspeed
usr.icon = usr.Oicon
usr.icon_state = ""
world<<"<font size=1><font color =red><B>Info: <font color = white>[src] Logged out"
del(src)
return
mob/Logout()
for(var/mob/pet/P in world)
if(P.owner == src)
P.loc = usr
world<<"<font size=1><font color =red><B>Info: <font color = white>[src] Logged out"
src.Savenow()
del(src)
mob
Logout()

del(src)


Problem description:The mobs don't delete even when a player is logged out, they just sit there until the player logs back in. This bug has me stuck and another problem, how come it isn't saving when a person logs out.

Lord of light wrote:
Code:
client/Del()
> for(var/mob/pet/P in world)
> if(P.owner == src)
> P.loc = usr
> usr.ingat = 0
> usr.intank = 0
> usr.ingar = 0
> usr.Jyuken = 0
> usr.Tekken = 0
> usr.bunshin = 0
> usr.Basic = 1
> usr.Kaiten = 0
> usr.intank = 0
> usr.overlays -= 'meattank.dmi'
> usr.overlays -= 'hakkeshou.dmi'
> usr.overlays -= 'gatsuuga.dmi'
> usr.Move_Delay = usr.Savedspeed
> usr.icon = usr.Oicon
> usr.icon_state = ""
> world<<"<font size=1><font color =red><B>Info: <font color = white>[src] Logged out"
> del(src)
> return
> mob/Logout()
> for(var/mob/pet/P in world)
> if(P.owner == src)
> P.loc = usr
> world<<"<font size=1><font color =red><B>Info: <font color = white>[src] Logged out"
> src.Savenow()
> del(src)
> mob
> Logout()
>
> del(src)
>



I noticed that client/Del() proc is kinda sloppy. You might want to reset all those varibles upon logging in, not logging out. Thats just how I do it, I dont know if it will effect this. all in all, that entire proc is kinda redundant. You also have an extra Logout() proc, which may cause some problems. You should just leave it to one Logout() proc....Like this:

mob/Logout()
world << "<font size=1><font color =red><B>Info: <font color = white>[src] Logged out"
del(src)

What I figured to do with the pet mob is to try making a seperate proc.


That should handle the mob deletion problem. Im not so sure what to do with your saving problems, or what to do with the pet mob. Perhaps a more expirienced coder will see this.

- Cliff H.
In response to Team CS
Why not just the variables to temp?

mob/temp/a_temp=0

Then on login, it will automaticly reset to 0 (or the default variable)
In response to Flame Sage
1. Put it all in 1 proc. Not both Logout and Del.

2. No put usr in proc, ungh.