Merge pull request #4354 from Citadel-Station-13/upstream-merge-33465
[MIRROR] Replaces a bunch of loc assignments with forcemoves and moves to nullspace
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
stored_dna.initialize_dna(random_blood_type())
|
||||
if(isturf(loc)) //not spawned in an MMI or brain organ (most likely adminspawned)
|
||||
var/obj/item/organ/brain/OB = new(loc) //we create a new brain organ for it.
|
||||
loc = OB
|
||||
OB.brainmob = src
|
||||
forceMove(OB)
|
||||
|
||||
|
||||
/mob/living/brain/proc/create_dna()
|
||||
@@ -71,3 +71,16 @@
|
||||
var/obj/mecha/M = MMI.mecha
|
||||
if((src == MMI.brainmob) && istype(M))
|
||||
return M.click_action(A,src,params)
|
||||
|
||||
/mob/living/brain/forceMove(atom/destination)
|
||||
if(container)
|
||||
return container.forceMove(destination)
|
||||
else if (istype(loc, /obj/item/organ/brain))
|
||||
var/obj/item/organ/brain/B = loc
|
||||
B.forceMove(destination)
|
||||
else if (istype(destination, /obj/item/organ/brain))
|
||||
doMove(destination)
|
||||
else if (istype(destination, /obj/item/device/mmi))
|
||||
doMove(destination)
|
||||
else
|
||||
CRASH("Brainmob without a container [src] attempted to move to [destination].")
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
if(C.mind && C.mind.has_antag_datum(/datum/antagonist/changeling) && !no_id_transfer) //congrats, you're trapped in a body you don't control
|
||||
if(brainmob && !(C.stat == DEAD || (C.status_flags & FAKEDEATH)))
|
||||
to_chat(brainmob, "<span class = danger>You can't feel your body! You're still just a brain!</span>")
|
||||
loc = C
|
||||
forceMove(C)
|
||||
C.update_hair()
|
||||
return
|
||||
|
||||
|
||||
@@ -1028,3 +1028,15 @@
|
||||
if(mind && mind.linglink)
|
||||
return LINGHIVE_LINK
|
||||
return LINGHIVE_NONE
|
||||
|
||||
/mob/living/forceMove(atom/destination)
|
||||
stop_pulling()
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob(src, force = TRUE)
|
||||
if(has_buckled_mobs())
|
||||
unbuckle_all_mobs(force = TRUE)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(client)
|
||||
reset_perspective(destination)
|
||||
update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
|
||||
@@ -21,7 +21,10 @@
|
||||
if(!isturf(ai.loc))
|
||||
return
|
||||
T = get_turf(T)
|
||||
loc = T
|
||||
if (T)
|
||||
forceMove(T)
|
||||
else
|
||||
moveToNullspace() // ????
|
||||
if(use_static)
|
||||
GLOB.cameranet.visibility(src)
|
||||
if(ai.client)
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
var/newcardloc = P
|
||||
P = new /obj/item/device/paicard(newcardloc)
|
||||
P.setPersonality(src)
|
||||
loc = P
|
||||
forceMove(P)
|
||||
card = P
|
||||
sradio = new(src)
|
||||
if(!radio)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
"<span class='notice'>You insert the new cell into [src].</span>")
|
||||
else if(istype(I, /obj/item/crowbar) && open && cell)
|
||||
cell.add_fingerprint(usr)
|
||||
cell.loc = loc
|
||||
cell.forceMove(loc)
|
||||
cell = null
|
||||
visible_message("[user] crowbars out the power cell from [src].",
|
||||
"<span class='notice'>You pry the powercell out of [src].</span>")
|
||||
@@ -361,7 +361,7 @@
|
||||
if(!load_mob(AM))
|
||||
return
|
||||
else
|
||||
AM.loc = src
|
||||
AM.forceMove(src)
|
||||
|
||||
load = AM
|
||||
mode = BOT_IDLE
|
||||
@@ -400,7 +400,7 @@
|
||||
unbuckle_all_mobs()
|
||||
|
||||
if(load)
|
||||
load.loc = loc
|
||||
load.forceMove(loc)
|
||||
load.pixel_y = initial(load.pixel_y)
|
||||
load.layer = initial(load.layer)
|
||||
load.plane = initial(load.plane)
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
I.pulledby.stop_pulling()
|
||||
|
||||
I.screen_loc = null // will get moved if inventory is visible
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
I.layer = ABOVE_HUD_LAYER
|
||||
I.plane = ABOVE_HUD_PLANE
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
|
||||
I.pulledby.stop_pulling()
|
||||
|
||||
I.screen_loc = null // will get moved if inventory is visible
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
I.equipped(src, slot)
|
||||
I.layer = ABOVE_HUD_LAYER
|
||||
I.plane = ABOVE_HUD_PLANE
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
|
||||
/obj/guardian_bomb/proc/disguise(obj/A)
|
||||
A.loc = src
|
||||
A.forceMove(src)
|
||||
stored_obj = A
|
||||
opacity = A.opacity
|
||||
anchored = A.anchored
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
else if(mind) // Let's make this a feature
|
||||
egg.origin = mind
|
||||
for(var/obj/item/organ/I in src)
|
||||
I.loc = egg
|
||||
I.forceMove(egg)
|
||||
visible_message("<span class='warning'>[src] plants something in [victim]'s flesh!</span>", \
|
||||
"<span class='danger'>We inject our egg into [victim]'s body!</span>")
|
||||
egg_lain = 1
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
. = ..()
|
||||
if(mapload) //eat shit
|
||||
for(var/obj/item/I in loc)
|
||||
I.loc = src
|
||||
I.forceMove(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/crate/DestroyPathToTarget()
|
||||
..()
|
||||
@@ -89,7 +89,7 @@
|
||||
var/obj/structure/closet/crate/C = new(get_turf(src))
|
||||
// Put loot in crate
|
||||
for(var/obj/O in src)
|
||||
O.loc = C
|
||||
O.forceMove(C)
|
||||
..()
|
||||
|
||||
GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/cable, /obj/structure/window))
|
||||
@@ -116,7 +116,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/death()
|
||||
for(var/atom/movable/M in src)
|
||||
M.loc = get_turf(src)
|
||||
M.forceMove(get_turf(src))
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/ListTargets()
|
||||
@@ -136,7 +136,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(obj/O, mob/living/user, destroy_original = 0)
|
||||
if(destroy_original || CheckObject(O))
|
||||
O.loc = src
|
||||
O.forceMove(src)
|
||||
name = O.name
|
||||
desc = O.desc
|
||||
icon = O.icon
|
||||
@@ -249,15 +249,15 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
|
||||
..()
|
||||
else
|
||||
visible_message("<span class='danger'>The <b>[src]</b> clears a jam!</span>")
|
||||
Pewgun.chambered.loc = loc //rip revolver immersions, blame shotgun snowflake procs
|
||||
Pewgun.chambered.forceMove(loc) //rip revolver immersions, blame shotgun snowflake procs
|
||||
Pewgun.chambered = null
|
||||
if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len)
|
||||
Pewgun.chambered = Pewgun.magazine.get_round(0)
|
||||
Pewgun.chambered.loc = Pewgun
|
||||
Pewgun.chambered.forceMove(Pewgun)
|
||||
Pewgun.update_icon()
|
||||
else if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len) //only true for pumpguns i think
|
||||
Pewgun.chambered = Pewgun.magazine.get_round(0)
|
||||
Pewgun.chambered.loc = Pewgun
|
||||
Pewgun.chambered.forceMove(Pewgun)
|
||||
visible_message("<span class='danger'>The <b>[src]</b> cocks itself!</span>")
|
||||
else
|
||||
ranged = 0 //BANZAIIII
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
src.say("[pick(available_channels)] BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
|
||||
else
|
||||
src.say("BAWWWWWK LEAVE THE HEADSET BAWKKKKK!")
|
||||
ears.loc = src.loc
|
||||
ears.forceMove(src.loc)
|
||||
ears = null
|
||||
for(var/possible_phrase in speak)
|
||||
if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys)
|
||||
@@ -504,7 +504,7 @@
|
||||
else //This should ensure that we only grab the item we want, and make sure it's not already collected on our perch
|
||||
if(!parrot_perch || parrot_interest.loc != parrot_perch.loc)
|
||||
held_item = parrot_interest
|
||||
parrot_interest.loc = src
|
||||
parrot_interest.forceMove(src)
|
||||
visible_message("[src] grabs [held_item]!", "<span class='notice'>You grab [held_item]!</span>", "<span class='italics'>You hear the sounds of wings flapping furiously.</span>")
|
||||
|
||||
parrot_interest = null
|
||||
@@ -526,7 +526,7 @@
|
||||
return
|
||||
|
||||
if(Adjacent(parrot_perch))
|
||||
src.loc = parrot_perch.loc
|
||||
forceMove(parrot_perch.loc)
|
||||
drop_held_item()
|
||||
parrot_state = PARROT_PERCH
|
||||
icon_state = icon_sit
|
||||
|
||||
Reference in New Issue
Block a user