ID:752109
 
Code:
mob
restart()
icon_state = gender
loc = locate(/turf/start)

world
turf = /turf/newgrass1


Problem description:
I have a command called reset user that will reset a mobs vars and location. when i test this option, sometimes the mob stands on the start tile while other times the mob stands near the tile. any ideas?
If you have something on the start turf that is dense it in theory should move the mob next to the turf.
yes, but it is not dense
While that may be true was something dense on the turf at the time??"
If that's the case, do a check to see if there are any dense atoms on that location.

mob/proc/check_loc()
// Change this to what ever turf you're checking for. (In your case it would be '/turf/start')
var/turf/t = locate(/turf/turf_here)
// If there are any dense atoms on t(the turf being checked), notify the usr and don't do anything.
for(var/atom/a in t)
if(a.density)
src << "There's a dense atom on [t]."
return

// Teleport the player to the turf being checked.
src.loc = t


mob
restart()
icon_state = gender
check_loc()
In response to A.T.H.K
yes, there was something dense on the map
In response to Kalster
That would be why they won't land on the start turf.

I would just add an enter() on the turf and make the mob density 0 the when they exit() return it to 1 that should solve the issue.
hi A.T.H.K. i tried the example. it did not work
Urais, i tried the code. there is no dense atoms
   Login()
loc = locate(/turf/start)
x_temp = x
y_temp = y
z_temp = z
..()

restart()
usr.Move(locate(x_temp,y_temp,z_temp))


i fixed the code with the following. thank you