ID:1138959
 
(See the best response by Blastcore.)
Problem description:
Hey, I'm trying to make the character teleport by double clicking anywhere on the map, and it's been working fine till I added a Night/Day system to the game, filling most of the map with an 'Outside' area which changes its overlays at 'night'.

Now, whenever it's night time, and the player tries to teleport somewhere by clicking any 'outside' area on the map, it'll teleport him to 1,1,1 , because the whole area has the same values at night due to it being an 'area' type.. So, is there any way for me to get the coordinates of the turf, or any object palced at that location instead of the area?

Even teleporting the mob to the cursor's location should do, any help?

Thanks in advance :)
Could you show the code that makes you teleport?
Code:
client
DblClick(O as obj)
var/mp_cost = round(rand(5000,25000))

if(usr.busy)
return
if(usr.dead)
return
if(usr.CanTeleport)
if(istype(O,/mob/PC))
return


if(istype(O,/mob/NPC))
return
if(istype(O,/turf/Floors/No_Walking))
return
if(istype(O,/turf/Sky/Clouds))
return
if(istype(O,/turf/Buildings/Wall))
return
if(istype(O,/turf/Buildings/Roof))
return
if(istype(O,/obj/Equipment))
return

if(usr.mp >= mp_cost)
if(O in oview(12))
usr.ki -= mp_cost
usr.z = O:z
usr.x = O:x
usr.y = O:y
usr.afk_time = 0

else
usr.afk_time = 0
return


Well, it's something along those lines, I removed some of the checks cus' they were irrelevant..

Thanks :)
Best response
Instead of using client/DblClick() you can use turf/DblClick() so you avoid all those obj and mob checks.

turf/DblClick()
var/mp_cost = round(rand(5000,25000))
if(usr.busy)
return
if(usr.dead)
return
if(usr.CanTeleport)
if(istype(src, /turf/Floors/No_Walking))
return
if(istype(src, /turf/Buildings/Wall))
return
if(istype(src, /turf/Buildings/Roof))
return
if(usr.mp >= mp_cost)
usr.Move(src)
usr.ki -= mp_cost
usr.afk_time = 0
else
usr.afk_time = 0


Use mouse_opacity for the overlays for the night. So they're invisible for the mouse.
Exactly what I was looking for, thanks :P