mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into BookClub
This commit is contained in:
@@ -403,44 +403,42 @@
|
||||
///Called by /client/Move()
|
||||
///For moving in space
|
||||
///Return 1 for movement 0 for none
|
||||
/mob/Process_Spacemove(var/movement_dir = 0)
|
||||
|
||||
/mob/Process_Spacemove(movement_dir = 0)
|
||||
if(..())
|
||||
return 1
|
||||
var/atom/movable/backup = get_spacemove_backup()
|
||||
if(backup)
|
||||
if(istype(backup) && movement_dir && !backup.anchored)
|
||||
if(backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
src << "<span class='info'>You push off of [backup] to propel yourself.</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/get_spacemove_backup()
|
||||
var/atom/movable/dense_object_backup
|
||||
for(var/atom/A in orange(1, get_turf(src)))
|
||||
for(var/A in orange(1, get_turf(src)))
|
||||
if(isarea(A))
|
||||
continue
|
||||
|
||||
else if(isturf(A))
|
||||
var/turf/turf = A
|
||||
if(istype(turf,/turf/space))
|
||||
if(istype(turf, /turf/space))
|
||||
continue
|
||||
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
|
||||
return 1
|
||||
|
||||
return A
|
||||
else
|
||||
var/atom/movable/AM = A
|
||||
if(AM == buckled) //Kind of unnecessary but let's just be sure
|
||||
continue
|
||||
if(AM.density)
|
||||
if(!AM.CanPass(src) || AM.density)
|
||||
if(AM.anchored)
|
||||
return 1
|
||||
return AM
|
||||
if(pulling == AM)
|
||||
continue
|
||||
dense_object_backup = AM
|
||||
break
|
||||
. = dense_object_backup
|
||||
|
||||
if(movement_dir && dense_object_backup)
|
||||
if(dense_object_backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
to_chat(src, "<span class='info'>You push off of [dense_object_backup] to propel yourself.</span>")
|
||||
|
||||
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/proc/mob_has_gravity(turf/T)
|
||||
return has_gravity(src, T)
|
||||
|
||||
Reference in New Issue
Block a user