Skip to content

Commit

Permalink
bugfix: multipulling. (ss220-space#4205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeberdir authored Feb 21, 2024
1 parent e8c7c74 commit ad7ae47
Show file tree
Hide file tree
Showing 214 changed files with 382 additions and 392 deletions.
1 change: 0 additions & 1 deletion _maps/map_files/generic/CentComm.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -6456,7 +6456,6 @@
height = 11;
id = "specops_away";
name = "centcom bay 3";
no_spin = 1;
top_left_corner = 8;
top_right_corner = 1;
turf_type = /turf/simulated/floor;
Expand Down
1 change: 0 additions & 1 deletion _maps/map_files/generic/z2_old.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -6116,7 +6116,6 @@
height = 11;
id = "specops_away";
name = "centcom bay 3";
no_spin = 1;
top_left_corner = 8;
top_right_corner = 1;
width = 5
Expand Down
6 changes: 3 additions & 3 deletions code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pipes -> Pipelines
Pipelines + Other Objects -> Pipe network
*/
/obj/machinery/atmospherics
anchored = 1
anchored = TRUE
resistance_flags = FIRE_PROOF
max_integrity = 200
plane = GAME_PLANE
Expand Down Expand Up @@ -314,9 +314,9 @@ Pipelines + Other Objects -> Pipe network
user.remove_ventcrawl()
user.forceMove(src.loc)
user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.")
user.canmove = 0
user.canmove = FALSE
spawn(1)
user.canmove = 1
user.canmove = TRUE

/obj/machinery/atmospherics/AltClick(mob/living/user)
user.handle_ventcrawl(src)
Expand Down
2 changes: 1 addition & 1 deletion code/ATMOSPHERICS/components/binary_devices/circulator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

var/obj/machinery/power/generator/generator

anchored = 1
anchored = TRUE
density = 1

can_unwrench = 1
Expand Down
2 changes: 1 addition & 1 deletion code/LINDA/LINDA_fire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

//This is the icon for fire on turfs, also helps for nurturing small fires until they are full tile
/obj/effect/hotspot
anchored = 1
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
icon = 'icons/goonstation/effects/fire.dmi'
icon_state = "1"
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ Returns 1 if the chain up to the area contains the given typepath
var/obj/corner = new()
corner.loc = X
corner.density = 1
corner.anchored = 1
corner.anchored = TRUE
corner.icon = X.icon
corner.icon_state = replacetext(X.icon_state, "_s", "_f")
corner.tag = "delete me"
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/spacedrift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SUBSYSTEM_DEF(spacedrift)
continue

if(!AM.loc || AM.loc != AM.inertia_last_loc || AM.Process_Spacemove(0))
AM.inertia_dir = 0
AM.inertia_dir = NONE

if(!AM.inertia_dir)
AM.inertia_last_loc = null
Expand All @@ -53,7 +53,7 @@ SUBSYSTEM_DEF(spacedrift)
AM.inertia_moving = FALSE
AM.inertia_next_move = world.time + AM.inertia_move_delay
if(AM.loc == old_loc)
AM.inertia_dir = 0
AM.inertia_dir = NONE

AM.setDir(old_dir)
AM.inertia_last_loc = AM.loc
Expand Down
2 changes: 1 addition & 1 deletion code/datums/diseases/viruses/transformation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
return

affected_mob.notransform = 1
affected_mob.canmove = 0
affected_mob.canmove = FALSE
affected_mob.icon = null
affected_mob.overlays.Cut()
affected_mob.invisibility = INVISIBILITY_ABSTRACT
Expand Down
66 changes: 32 additions & 34 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,29 @@
appearance_flags = TILE_BOUND|PIXEL_SCALE
glide_size = 8 // Default, adjusted when mobs move based on their movement delays
var/last_move = null
var/anchored = 0
var/anchored = FALSE
var/move_resist = MOVE_RESIST_DEFAULT
var/move_force = MOVE_FORCE_DEFAULT
var/pull_force = PULL_FORCE_DEFAULT
// var/elevation = 2 - not used anywhere
var/move_speed = 10
var/l_move_time = 1
var/datum/thrownthing/throwing = null
var/throw_speed = 2 //How many tiles to move per ds when being thrown. Float values are fully supported
var/throw_range = 7
var/no_spin = 0
var/no_spin_thrown = 0
var/moved_recently = 0
var/no_spin_thrown = FALSE
var/mob/pulledby = null
var/atom/movable/pulling
var/throwforce = 0
var/canmove = 1
var/canmove = TRUE
var/pull_push_speed_modifier = 1

var/inertia_dir = 0
var/inertia_dir = NONE
var/atom/inertia_last_loc
var/inertia_moving = 0
var/inertia_moving = FALSE
var/inertia_next_move = 0
var/inertia_move_delay = 5

var/moving_diagonally = 0 //0: not doing a diagonal move. 1 and 2: doing the first/second step of the diagonal move
/// NONE:0 not doing a diagonal move. FIRST_DIAG_STEP:1 and SECOND_DIAG_STEP:2 doing the first/second step of the diagonal move.
var/moving_diagonally = NONE
var/list/client_mobs_in_contents

/// Either FALSE, [EMISSIVE_BLOCK_GENERIC], or [EMISSIVE_BLOCK_UNIQUE]
Expand Down Expand Up @@ -105,8 +102,10 @@
if(!(AM.can_be_pulled(src, force, show_message)))
return FALSE

if(pulling && AM == pulling && src == AM.pulledby) // are we trying to pull something we are already pulling?
return FALSE
if(pulling)
if(AM == pulling && src == AM.pulledby) // are we trying to pull something we are already pulling?
return FALSE
stop_pulling() // Clear yourself from targets `pulledby`.

var/atom/movable/previous_puller = null
if(AM.pulledby)
Expand Down Expand Up @@ -136,7 +135,6 @@
pulling.pulledby = null
var/mob/living/ex_pulled = pulling
pulling = null
pulledby = null
if(isliving(ex_pulled))
var/mob/living/L = ex_pulled
L.update_canmove()// mob gets up if it was lyng down in a chokehold
Expand Down Expand Up @@ -318,7 +316,7 @@
var/area/old_area = get_area(src)
var/area/new_area = get_area(destination)
loc = destination
moving_diagonally = 0
moving_diagonally = NONE

if(old_loc)
old_loc.Exited(src, destination)
Expand Down Expand Up @@ -347,7 +345,7 @@

Moved(old_loc, NONE, TRUE)

return 1
return TRUE


/atom/movable/proc/move_to_null_space()
Expand Down Expand Up @@ -392,36 +390,36 @@

//Called whenever an object moves and by mobs when they attempt to move themselves through space
//And when an object or action applies a force on src, see newtonian_move() below
//Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting
//Mobs should return 1 if they should be able to move of their own volition, see client/Move() in mob_movement.dm
//Return FALSE to have src start/keep drifting in a no-grav area and TRUE to stop/not start drifting
//Mobs should return TRUE if they should be able to move of their own volition, see client/Move() in mob_movement.dm
//movement_dir == 0 when stopping or any dir when trying to move
/atom/movable/proc/Process_Spacemove(var/movement_dir = 0)
/atom/movable/proc/Process_Spacemove(movement_dir = 0)
if(has_gravity(src))
return 1
return TRUE

if(pulledby && !pulledby.pulling)
return 1
return TRUE

if(throwing)
return 1
return TRUE

if(locate(/obj/structure/lattice) in range(1, get_turf(src))) //Not realistic but makes pushing things in space easier
return 1
return TRUE

return 0
return FALSE

/atom/movable/proc/newtonian_move(direction) //Only moves the object if it's under no gravity
if(!loc || Process_Spacemove(0))
inertia_dir = 0
return 0
inertia_dir = NONE
return FALSE

inertia_dir = direction
if(!direction)
return 1
return TRUE

inertia_last_loc = loc
SSspacedrift.processing[src] = src
return 1
return TRUE


//called when src is thrown into hit_atom
Expand Down Expand Up @@ -511,7 +509,7 @@
pulledby.stop_pulling()

throwing = TT
if(spin && !no_spin && !no_spin_thrown)
if(spin && !no_spin_thrown)
SpinAnimation(5, 1)

SEND_SIGNAL(src, COMSIG_MOVABLE_POST_THROW, TT, spin)
Expand Down Expand Up @@ -549,21 +547,21 @@
last_move = buckled_mob.last_move
inertia_dir = last_move
buckled_mob.inertia_dir = last_move
return 0
return 1
return FALSE
return TRUE

/atom/movable/proc/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
return FALSE

/atom/movable/proc/force_push(atom/movable/AM, force = move_force, direction, silent = FALSE)
. = AM.force_pushed(src, force, direction)
if(!silent && .)
visible_message("<span class='warning'>[src] сильно толка[pluralize_ru(src.gender,"ет","ют")] [AM]!</span>", "<span class='warning'>Вы сильно толкаете [AM]!</span>")
visible_message(span_warning("[src] сильно толка[pluralize_ru(gender,"ет","ют")] [AM]!"), span_warning("Вы сильно толкаете [AM]!"))

/atom/movable/proc/move_crush(atom/movable/AM, force = move_force, direction, silent = FALSE)
. = AM.move_crushed(src, force, direction)
if(!silent && .)
visible_message("<span class='danger'>[src] сокруша[pluralize_ru(src.gender,"ет","ют")] [AM]!</span>", "<span class='danger'>Вы сокрушили [AM]!</span>")
visible_message(span_danger("[src] сокруша[pluralize_ru(gender,"ет","ют")] [AM]!"), span_danger("Вы сокрушили [AM]!"))

/atom/movable/proc/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
return FALSE
Expand All @@ -572,7 +570,7 @@
if(istype(mover) && mover.checkpass(PASS_OTHER_THINGS))
return TRUE
if(mover in buckled_mobs)
return 1
return TRUE
return ..()

/atom/movable/proc/get_spacemove_backup()
Expand Down Expand Up @@ -680,5 +678,5 @@
/atom/movable/proc/decompile_act(obj/item/matter_decompiler/C, mob/user) // For drones to decompile mobs and objs. See drone for an example.
return FALSE

/atom/movable/proc/get_pull_push_speed_modifier(var/current_delay)
/atom/movable/proc/get_pull_push_speed_modifier(current_delay)
return pull_push_speed_modifier
2 changes: 1 addition & 1 deletion code/game/dna/genes/goon_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
/obj/effect/self_deleting
density = 0
opacity = 0
anchored = 1
anchored = TRUE
icon = null
desc = ""
//layer = 15
Expand Down
2 changes: 1 addition & 1 deletion code/game/dna/genes/monkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
H.drop_item_ground(W)
H.regenerate_icons()
H.SetStunned(2 SECONDS)
H.canmove = 0
H.canmove = FALSE
H.icon = null
H.invisibility = INVISIBILITY_ABSTRACT
var/has_greater_form = H.dna.species.greater_form //cache this
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/blob/theblob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
desc = "Some blob creature thingy"
density = 0
opacity = 1
anchored = 1
anchored = TRUE
max_integrity = 30
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
var/point_return = 0 //How many points the blob gets back when it removes a blob of that type. If less than 0, blob cannot be removed.
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/clockwork/clockwork_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@
name = "integration cog"
desc = "You shouldn't see that! Call dev on that!"
icon = null
anchored = 1
anchored = TRUE
active_power_usage = 100 // In summary it costs 500 power. Most areas costs around 800, with top being medbay at around 8000. Fair number.
var/obj/machinery/power/apc/apc
var/next_whoosh = 120
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/malfunction/Malf_Modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
name = "doomsday device"
icon_state = "nuclearbomb_base"
desc = "A weapon which disintegrates all organic life in a large area."
anchored = 1
anchored = TRUE
density = 1
atom_say_verb = "blares"
speed_process = TRUE // Disgusting fix. Please remove once #12952 is merged
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/meteor/meteors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ GLOBAL_LIST_INIT(meteors_ops, list(/obj/effect/meteor/goreops)) //Meaty Ops
icon = 'icons/obj/meteor.dmi'
icon_state = "small"
density = 1
anchored = 1
anchored = TRUE
var/hits = 4
var/hitpwr = 2 //Level of ex_act to be called on hit.
var/dest
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/miniantags/abduction/machinery/pad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
desc = "Use this to transport to and from human habitat"
icon = 'icons/obj/abductor.dmi'
icon_state = "alien-pad-idle"
anchored = 1
anchored = TRUE
var/turf/teleport_target

/obj/machinery/abductor/pad/proc/Warp(mob/living/target)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/wizard/artefact.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
icon = 'icons/obj/biomass.dmi'
icon_state = "rift"
density = 1
anchored = 1.0
anchored = TRUE
var/spawn_path = /mob/living/simple_animal/cow //defaulty cows to prevent unintentional narsies
var/spawn_amt_left = 20

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/wizard/soulstone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
to_chat(user, "<span class='danger'>Capture failed!</span>: The soul stone is full! Use or free an existing soul to make room.")
else
T.forceMove(src) // Put the shade into the stone.
T.canmove = 0
T.canmove = FALSE
T.health = T.maxHealth
update_appearance(UPDATE_ICON_STATE|UPDATE_NAME)
to_chat(T, "<span class='notice'>Your soul has been recaptured by the soul stone, its arcane energies are reknitting your ethereal form</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/Beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
layer = WIRE_LAYER
plane = FLOOR_PLANE
layer = 2.5
anchored = 1
anchored = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = 0
var/syndicate = 0
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/Freezer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon_state = "freezer"
density = 1
var/min_temperature = 0
anchored = 1.0
anchored = TRUE
use_power = IDLE_POWER_USE
active_power_usage = 5000 //cooling down massive amounts of air's not cheap. This is still very low considering everything
power_channel = EQUIP
Expand Down Expand Up @@ -174,7 +174,7 @@
icon_state = "heater"
density = 1
var/max_temperature = 0
anchored = 1.0
anchored = TRUE
layer = 3
current_heat_capacity = 1000
active_power_usage = 5000
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/OpTable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "table2-idle"
density = 1
anchored = 1.0
anchored = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = 1
active_power_usage = 5
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/PDApainter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
icon_state = "pdapainter"
base_icon_state = "pdapainter"
density = 1
anchored = 1
anchored = TRUE
max_integrity = 200
var/obj/item/pda/storedpda = null
var/list/colorlist = list()
Expand Down
Loading

0 comments on commit ad7ae47

Please sign in to comment.