Merge pull request #11105 from PsiOmegaDelta/150914-ForcedWheelchair

Converts some loc = to forceMove()
This commit is contained in:
mwerezak
2015-09-14 12:11:09 -04:00
10 changed files with 37 additions and 37 deletions

View File

@@ -75,7 +75,7 @@
set_dir(direction) set_dir(direction)
if(pulling) // Driver if(pulling) // Driver
if(pulling.loc == src.loc) // We moved onto the wheelchair? Revert! if(pulling.loc == src.loc) // We moved onto the wheelchair? Revert!
pulling.loc = T pulling.forceMove(T)
else else
spawn(0) spawn(0)
if(get_dist(src, pulling) > 1) // We are too far away? Losing control. if(get_dist(src, pulling) > 1) // We are too far away? Losing control.
@@ -107,7 +107,7 @@
pulling = null pulling = null
else else
if (occupant && (src.loc != occupant.loc)) if (occupant && (src.loc != occupant.loc))
src.loc = occupant.loc // Failsafe to make sure the wheelchair stays beneath the occupant after driving src.forceMove(occupant.loc) // Failsafe to make sure the wheelchair stays beneath the occupant after driving
/obj/structure/bed/chair/wheelchair/attack_hand(mob/living/user as mob) /obj/structure/bed/chair/wheelchair/attack_hand(mob/living/user as mob)
if (pulling) if (pulling)

View File

@@ -225,7 +225,7 @@
if(target) if(target)
var/obj/item/firing = new fabrication_type() var/obj/item/firing = new fabrication_type()
firing.loc = get_turf(src) firing.forceMove(get_turf(src))
H.visible_message("<span class='danger'>[H] launches \a [firing]!</span>") H.visible_message("<span class='danger'>[H] launches \a [firing]!</span>")
firing.throw_at(target,fire_force,fire_distance) firing.throw_at(target,fire_force,fire_distance)
else else
@@ -233,7 +233,7 @@
H << "<span class='danger'>Your hands are full." H << "<span class='danger'>Your hands are full."
else else
var/obj/item/new_weapon = new fabrication_type() var/obj/item/new_weapon = new fabrication_type()
new_weapon.loc = H new_weapon.forceMove(H)
H << "<font color='blue'><b>You quickly fabricate \a [new_weapon].</b></font>" H << "<font color='blue'><b>You quickly fabricate \a [new_weapon].</b></font>"
H.put_in_hands(new_weapon) H.put_in_hands(new_weapon)

View File

@@ -68,9 +68,9 @@
if(!verb_holder) if(!verb_holder)
verb_holder = new(src) verb_holder = new(src)
if(integrated_ai) if(integrated_ai)
verb_holder.loc = integrated_ai verb_holder.forceMove(integrated_ai)
else else
verb_holder.loc = src verb_holder.forceMove(src)
/obj/item/rig_module/ai_container/accepts_item(var/obj/item/input_device, var/mob/living/user) /obj/item/rig_module/ai_container/accepts_item(var/obj/item/input_device, var/mob/living/user)
@@ -179,7 +179,7 @@
else if(user) else if(user)
user.put_in_hands(ai_card) user.put_in_hands(ai_card)
else else
ai_card.loc = get_turf(src) ai_card.forceMove(get_turf(src))
ai_card = null ai_card = null
integrated_ai = null integrated_ai = null
update_verb_holder() update_verb_holder()
@@ -209,7 +209,7 @@
return 0 return 0
else else
user.drop_from_inventory(ai) user.drop_from_inventory(ai)
ai.loc = src ai.forceMove(src)
ai_card = ai ai_card = ai
ai_mob << "<font color='blue'>You have been transferred to \the [holder]'s [src].</font>" ai_mob << "<font color='blue'>You have been transferred to \the [holder]'s [src].</font>"
user << "<font color='blue'>You load [ai_mob] into \the [holder]'s [src].</font>" user << "<font color='blue'>You load [ai_mob] into \the [holder]'s [src].</font>"

View File

@@ -123,13 +123,13 @@
H << "<span class='warning'>You cannot teleport to a location with solid objects.</span>" H << "<span class='warning'>You cannot teleport to a location with solid objects.</span>"
phase_out(H,get_turf(H)) phase_out(H,get_turf(H))
H.loc = T H.forceMove(T)
phase_in(H,get_turf(H)) phase_in(H,get_turf(H))
for(var/obj/item/weapon/grab/G in H.contents) for(var/obj/item/weapon/grab/G in H.contents)
if(G.affecting) if(G.affecting)
phase_out(G.affecting,get_turf(G.affecting)) phase_out(G.affecting,get_turf(G.affecting))
G.affecting.loc = locate(T.x+rand(-1,1),T.y+rand(-1,1),T.z) G.affecting.forceMove(locate(T.x+rand(-1,1),T.y+rand(-1,1),T.z))
phase_in(G.affecting,get_turf(G.affecting)) phase_in(G.affecting,get_turf(G.affecting))
return 1 return 1

View File

@@ -304,7 +304,7 @@
if(istype(piece.loc, /mob/living)) if(istype(piece.loc, /mob/living))
M = piece.loc M = piece.loc
M.drop_from_inventory(piece) M.drop_from_inventory(piece)
piece.loc = src piece.forceMove(src)
if(!istype(wearer) || loc != wearer || wearer.back != src || canremove || !cell || cell.charge <= 0) if(!istype(wearer) || loc != wearer || wearer.back != src || canremove || !cell || cell.charge <= 0)
if(!cell || cell.charge <= 0) if(!cell || cell.charge <= 0)
@@ -558,7 +558,7 @@
if(M && M.back == src) if(M && M.back == src)
M.back = null M.back = null
M.drop_from_inventory(src) M.drop_from_inventory(src)
src.loc = get_turf(src) src.forceMove(get_turf(src))
return return
if(istype(M) && M.back == src) if(istype(M) && M.back == src)
@@ -614,10 +614,10 @@
H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "retract" : "retracts"] swiftly.</b></font>" H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "retract" : "retracts"] swiftly.</b></font>"
use_obj.canremove = 1 use_obj.canremove = 1
holder.drop_from_inventory(use_obj) holder.drop_from_inventory(use_obj)
use_obj.loc = get_turf(src) use_obj.forceMove(get_turf(src))
use_obj.dropped() use_obj.dropped()
use_obj.canremove = 0 use_obj.canremove = 0
use_obj.loc = src use_obj.forceMove(src)
else if (deploy_mode != ONLY_RETRACT) else if (deploy_mode != ONLY_RETRACT)
if(check_slot) if(check_slot)
@@ -625,9 +625,9 @@
H << "<span class='danger'>You are unable to deploy \the [piece] as \the [check_slot] [check_slot.gender == PLURAL ? "are" : "is"] in the way.</span>" H << "<span class='danger'>You are unable to deploy \the [piece] as \the [check_slot] [check_slot.gender == PLURAL ? "are" : "is"] in the way.</span>"
return return
else else
use_obj.loc = H use_obj.forceMove(H)
if(!H.equip_to_slot_if_possible(use_obj, equip_to, 0)) if(!H.equip_to_slot_if_possible(use_obj, equip_to, 0))
use_obj.loc = src use_obj.forceMove(src)
else else
H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "deploy" : "deploys"] swiftly.</b></span>" H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "deploy" : "deploys"] swiftly.</b></span>"

View File

@@ -66,7 +66,7 @@
user.drop_from_inventory(W) user.drop_from_inventory(W)
air_supply = W air_supply = W
W.loc = src W.forceMove(src)
user << "You slot [W] into [src] and tighten the connecting valve." user << "You slot [W] into [src] and tighten the connecting valve."
return return
@@ -95,7 +95,7 @@
user << "You install \the [mod] into \the [src]." user << "You install \the [mod] into \the [src]."
user.drop_from_inventory(mod) user.drop_from_inventory(mod)
installed_modules |= mod installed_modules |= mod
mod.loc = src mod.forceMove(src)
mod.installed(src) mod.installed(src)
update_icon() update_icon()
return 1 return 1
@@ -104,7 +104,7 @@
user << "You jack \the [W] into \the [src]'s battery mount." user << "You jack \the [W] into \the [src]'s battery mount."
user.drop_from_inventory(W) user.drop_from_inventory(W)
W.loc = src W.forceMove(src)
src.cell = W src.cell = W
return return
@@ -115,7 +115,7 @@
return return
if(user.r_hand && user.l_hand) if(user.r_hand && user.l_hand)
air_supply.loc = get_turf(user) air_supply.forceMove(get_turf(user))
else else
user.put_in_hands(air_supply) user.put_in_hands(air_supply)
user << "You detach and remove \the [air_supply]." user << "You detach and remove \the [air_supply]."
@@ -147,9 +147,9 @@
for(var/obj/item/rig_module/module in installed_modules) for(var/obj/item/rig_module/module in installed_modules)
module.deactivate() module.deactivate()
if(user.r_hand && user.l_hand) if(user.r_hand && user.l_hand)
cell.loc = get_turf(user) cell.forceMove(get_turf(user))
else else
cell.loc = user.put_in_hands(cell) cell.forceMove(user.put_in_hands(cell))
cell = null cell = null
else else
user << "There is nothing loaded in that mount." user << "There is nothing loaded in that mount."
@@ -172,7 +172,7 @@
var/obj/item/rig_module/removed = possible_removals[removal_choice] var/obj/item/rig_module/removed = possible_removals[removal_choice]
user << "You detatch \the [removed] from \the [src]." user << "You detatch \the [removed] from \the [src]."
removed.loc = get_turf(src) removed.forceMove(get_turf(src))
removed.removed() removed.removed()
installed_modules -= removed installed_modules -= removed
update_icon() update_icon()

View File

@@ -78,13 +78,13 @@ var/list/slot_equipment_priority = list( \
if(istype(src.back,/obj/item/weapon/storage)) if(istype(src.back,/obj/item/weapon/storage))
var/obj/item/weapon/storage/backpack = src.back var/obj/item/weapon/storage/backpack = src.back
if(backpack.contents.len < backpack.storage_slots) if(backpack.contents.len < backpack.storage_slots)
newitem.loc = src.back newitem.forceMove(src.back)
return 1 return 1
// Try to place it in any item that can store stuff, on the mob. // Try to place it in any item that can store stuff, on the mob.
for(var/obj/item/weapon/storage/S in src.contents) for(var/obj/item/weapon/storage/S in src.contents)
if (S.contents.len < S.storage_slots) if (S.contents.len < S.storage_slots)
newitem.loc = S newitem.forceMove(S)
return 1 return 1
return 0 return 0
@@ -106,7 +106,7 @@ var/list/slot_equipment_priority = list( \
if(lying) return 0 if(lying) return 0
if(!istype(W)) return 0 if(!istype(W)) return 0
if(!l_hand) if(!l_hand)
W.loc = src //TODO: move to equipped? W.forceMove(src) //TODO: move to equipped?
l_hand = W l_hand = W
W.layer = 20 //TODO: move to equipped? W.layer = 20 //TODO: move to equipped?
// l_hand.screen_loc = ui_lhand // l_hand.screen_loc = ui_lhand
@@ -122,7 +122,7 @@ var/list/slot_equipment_priority = list( \
if(lying) return 0 if(lying) return 0
if(!istype(W)) return 0 if(!istype(W)) return 0
if(!r_hand) if(!r_hand)
W.loc = src W.forceMove(src)
r_hand = W r_hand = W
W.layer = 20 W.layer = 20
// r_hand.screen_loc = ui_rhand // r_hand.screen_loc = ui_rhand
@@ -157,7 +157,7 @@ var/list/slot_equipment_priority = list( \
update_inv_r_hand() update_inv_r_hand()
return 1 return 1
else else
W.loc = get_turf(src) W.forceMove(get_turf(src))
W.layer = initial(W.layer) W.layer = initial(W.layer)
W.dropped() W.dropped()
return 0 return 0
@@ -245,7 +245,7 @@ var/list/slot_equipment_priority = list( \
O.screen_loc = null O.screen_loc = null
if(istype(O, /obj/item)) if(istype(O, /obj/item))
var/obj/item/I = O var/obj/item/I = O
I.loc = src.loc I.forceMove(src.loc)
I.dropped(src) I.dropped(src)
return 1 return 1

View File

@@ -87,8 +87,8 @@ default behaviour is:
if((tmob.mob_always_swap || (tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || src.restrained())) && tmob.canmove && canmove && !dense && can_move_mob(tmob, 1, 0)) // mutual brohugs all around! if((tmob.mob_always_swap || (tmob.a_intent == I_HELP || tmob.restrained()) && (a_intent == I_HELP || src.restrained())) && tmob.canmove && canmove && !dense && can_move_mob(tmob, 1, 0)) // mutual brohugs all around!
var/turf/oldloc = loc var/turf/oldloc = loc
loc = tmob.loc forceMove(tmob.loc)
tmob.loc = oldloc tmob.forceMove(oldloc)
now_pushing = 0 now_pushing = 0
for(var/mob/living/carbon/slime/slime in view(1,tmob)) for(var/mob/living/carbon/slime/slime in view(1,tmob))
if(slime.Victim == tmob) if(slime.Victim == tmob)
@@ -606,7 +606,7 @@ default behaviour is:
src << "<span class='warning'>You wriggle out of [M]'s grip!</span>" src << "<span class='warning'>You wriggle out of [M]'s grip!</span>"
else if(istype(H.loc,/obj/item)) else if(istype(H.loc,/obj/item))
src << "<span class='warning'>You struggle free of [H.loc].</span>" src << "<span class='warning'>You struggle free of [H.loc].</span>"
H.loc = get_turf(H) H.forceMove(get_turf(H))
if(istype(M)) if(istype(M))
for(var/atom/A in M.contents) for(var/atom/A in M.contents)

View File

@@ -940,7 +940,7 @@ mob/proc/yank_out_object()
var/mob/living/carbon/human/human_user = U var/mob/living/carbon/human/human_user = U
human_user.bloody_hands(H) human_user.bloody_hands(H)
selection.loc = get_turf(src) selection.forceMove(get_turf(src))
if(!(U.l_hand && U.r_hand)) if(!(U.l_hand && U.r_hand))
U.put_in_hands(selection) U.put_in_hands(selection)

View File

@@ -165,7 +165,7 @@
if(!mob.control_object) return if(!mob.control_object) return
mob.control_object.dir = direct mob.control_object.dir = direct
else else
mob.control_object.loc = get_step(mob.control_object,direct) mob.control_object.forceMove(get_step(mob.control_object,direct))
return return
@@ -373,7 +373,7 @@
mob << "<span class='warning'>You cannot get past holy grounds while you are in this plane of existence!</span>" mob << "<span class='warning'>You cannot get past holy grounds while you are in this plane of existence!</span>"
return return
else else
mob.loc = get_step(mob, direct) mob.forceMove(get_step(mob, direct))
mob.dir = direct mob.dir = direct
if(2) if(2)
if(prob(50)) if(prob(50))
@@ -402,7 +402,7 @@
return return
else else
return return
mob.loc = locate(locx,locy,mobloc.z) mob.forceMove(locate(locx,locy,mobloc.z))
spawn(0) spawn(0)
var/limit = 2//For only two trailing shadows. var/limit = 2//For only two trailing shadows.
for(var/turf/T in getline(mobloc, mob.loc)) for(var/turf/T in getline(mobloc, mob.loc))
@@ -413,7 +413,7 @@
else else
spawn(0) spawn(0)
anim(mobloc,mob,'icons/mob/mob.dmi',,"shadow",,mob.dir) anim(mobloc,mob,'icons/mob/mob.dmi',,"shadow",,mob.dir)
mob.loc = get_step(mob, direct) mob.forceMove(get_step(mob, direct))
mob.dir = direct mob.dir = direct
// Crossed is always a bit iffy // Crossed is always a bit iffy
for(var/obj/S in mob.loc) for(var/obj/S in mob.loc)