Skip to content

Commit

Permalink
Fixes space drift of pulled objects (#500)
Browse files Browse the repository at this point in the history
* Fixes space drift of pulled objects

* Fixes mech space movement
  • Loading branch information
EgorDinamit authored Jan 13, 2024
1 parent bd4940a commit b8313b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
2 changes: 0 additions & 2 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ var/list/mob/living/forced_ambiance_list = new
if(!istype(A,/mob/living)) return

var/mob/living/L = A
if(!L.ckey) return

if(!L.lastarea)
L.lastarea = get_area(L.loc)
var/area/newarea = get_area(L.loc)
Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if(has_gravity())
return 1

if(length(pulledby))
if(pulledby)
return 1

if(throwing)
Expand Down
30 changes: 12 additions & 18 deletions code/modules/mechs/mech_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@
if(Process_Spacemove()) //Handle here
return TRUE

/mob/living/exosuit/Process_Spacemove()
. = ..()
if(.)
return

//Regardless of modules, emp prevents control
if(emp_damage >= EMP_MOVE_DISRUPT && prob(25))
return FALSE

var/obj/item/mech_equipment/ionjets/J = hardpoints[HARDPOINT_BACK]
if(istype(J))
if(J.allowSpaceMove())
return TRUE

//Inertia drift making us face direction makes exosuit flight a bit difficult, plus newtonian flight model yo
/mob/living/exosuit/set_dir(ndir)
if(inertia_dir && inertia_dir == ndir)
Expand Down Expand Up @@ -142,16 +128,24 @@
return TRUE

/mob/living/exosuit/Process_Spacemove()
//Regardless of modules, emp prevents control
if(emp_damage >= EMP_MOVE_DISRUPT && prob(25))
return FALSE

if(has_gravity() || throwing || !isturf(loc) || length(grabbed_by) || check_space_footing() || locate(/obj/structure/lattice) in range(1, get_turf(src)))
anchored = TRUE
return 1
return TRUE

var/obj/item/mech_equipment/ionjets/J = hardpoints[HARDPOINT_BACK]
if(istype(J))
if(J.allowSpaceMove())
return TRUE

anchored = FALSE
return 0
return FALSE

/mob/living/exosuit/check_space_footing()//mechs can't push off things to move around in space, they stick to hull or float away
for(var/thing in trange(1,src))
var/turf/T = thing
for(var/turf/T in trange(1, src))
if(T.density || T.is_wall() || T.is_floor())
return T

Expand Down

0 comments on commit b8313b2

Please sign in to comment.