Can no longer move up/down from non-turf locations.

Port of https://github.com/Baystation12/Baystation12/pull/16653/
This commit is contained in:
PsiOmegaDelta
2017-03-18 12:28:30 +01:00
committed by Leshana
parent 1a8cd99347
commit 663e2b2d4c
+18 -14
View File
@@ -3,34 +3,38 @@
set category = "IC"
if(zMove(UP))
to_chat(usr, "<span class='notice'>You move upwards.</span>")
to_chat(src, "<span class='notice'>You move upwards.</span>")
/mob/verb/down()
set name = "Move Down"
set category = "IC"
if(zMove(DOWN))
to_chat(usr, "<span class='notice'>You move down.</span>")
to_chat(src, "<span class='notice'>You move down.</span>")
/mob/proc/zMove(direction)
if(eyeobj)
return eyeobj.zMove(direction)
if(!can_ztravel())
to_chat(usr, "<span class='warning'>You lack means of travel in that direction.</span>")
to_chat(src, "<span class='warning'>You lack means of travel in that direction.</span>")
return
var/turf/start = loc
if(!istype(start))
to_chat(src, "<span class='notice'>You are unable to move from here.</span>")
return 0
var/turf/destination = (direction == UP) ? GetAbove(src) : GetBelow(src)
if(!destination)
to_chat(usr, "<span class='notice'>There is nothing of interest in this direction.</span>")
to_chat(src, "<span class='notice'>There is nothing of interest in this direction.</span>")
return 0
if(!start.CanZPass(src, direction))
to_chat(src, "<span class='warning'>\The [start] is in the way.</span>")
return 0
var/turf/start = get_turf(src)
if(!start.CanZPass(src, direction))
to_chat(usr, "<span class='warning'>\The [start] is in the way.</span>")
return 0
if(!destination.CanZPass(src, direction))
to_chat(usr, "<span class='warning'>\The [destination] blocks your way.</span>")
to_chat(src, "<span class='warning'>\The [destination] blocks your way.</span>")
return 0
var/area/area = get_area(src)
@@ -46,12 +50,12 @@
to_chat(src, "<span class='warning'>You gave up on pulling yourself up.</span>")
return 0
else
to_chat(usr, "<span class='warning'>Gravity stops you from moving upward.</span>")
to_chat(src, "<span class='warning'>Gravity stops you from moving upward.</span>")
return 0
for(var/atom/A in destination)
if(!A.CanPass(src, start, 1.5, 0))
to_chat(usr, "<span class='warning'>\The [A] blocks you.</span>")
to_chat(src, "<span class='warning'>\The [A] blocks you.</span>")
return 0
Move(destination)
return 1
@@ -61,14 +65,14 @@
if(destination)
forceMove(destination)
else
to_chat(usr, "<span class='notice'>There is nothing of interest in this direction.</span>")
to_chat(src, "<span class='notice'>There is nothing of interest in this direction.</span>")
/mob/observer/eye/zMove(direction)
var/turf/destination = (direction == UP) ? GetAbove(src) : GetBelow(src)
if(destination)
setLoc(destination)
else
to_chat(usr, "<span class='notice'>There is nothing of interest in this direction.</span>")
to_chat(src, "<span class='notice'>There is nothing of interest in this direction.</span>")
/mob/proc/can_ztravel()
return 0