Code Cleanup: (Bump(), Bumped()) -> (Collide(), CollidedWith()) (#4349)

This PR rips out the old Bump() and Bumped() procs and replaces them with Collide() and CollidedWith() respectively. Behavior should be the same, but Bump() should no longer be double-called, and no longer relies on spawns.

Other changes:

LAssailant is now a weakref.
Some direct loc setting are now forceMove().
This commit is contained in:
Lohikar
2018-03-08 09:39:53 +02:00
committed by Erki
parent 057e787948
commit a86398d0d2
66 changed files with 231 additions and 216 deletions
+3 -2
View File
@@ -20,8 +20,9 @@
else
icon_state = initial(icon_state)
/obj/structure/grille/Bumped(atom/user)
if(ismob(user)) shock(user, 70)
/obj/structure/grille/CollidedWith(atom/user)
if(ismob(user))
shock(user, 70)
/obj/structure/grille/attack_hand(mob/user as mob)
+1 -1
View File
@@ -47,7 +47,7 @@
/obj/structure/simple_door/get_material()
return material
/obj/structure/simple_door/Bumped(atom/user)
/obj/structure/simple_door/CollidedWith(atom/user)
..()
if(!state)
return TryToSwitchState(user)
@@ -134,7 +134,7 @@
..()
/obj/structure/bed/chair/office/Move()
..()
. = ..()
if(buckled_mob)
var/mob/living/occupant = buckled_mob
occupant.buckled = null
@@ -144,13 +144,14 @@
if (propelled)
for (var/mob/O in src.loc)
if (O != occupant)
Bump(O)
Collide(O)
else
unbuckle_mob()
/obj/structure/bed/chair/office/Bump(atom/A)
..()
if(!buckled_mob) return
/obj/structure/bed/chair/office/Collide(atom/A)
. = ..()
if(!buckled_mob)
return
if(propelled)
var/mob/living/occupant = unbuckle_mob()
@@ -85,7 +85,7 @@
driving = 0
/obj/structure/bed/chair/wheelchair/Move()
..()
. = ..()
if(buckled_mob)
var/mob/living/occupant = buckled_mob
if(!driving)
@@ -96,7 +96,7 @@
if (propelled)
for (var/mob/O in src.loc)
if (O != occupant)
Bump(O)
Collide(O)
else
unbuckle_mob()
if (pulling && (get_dist(src, pulling) > 1))
@@ -133,9 +133,10 @@
pulling = null
return
/obj/structure/bed/chair/wheelchair/Bump(atom/A)
..()
if(!buckled_mob) return
/obj/structure/bed/chair/wheelchair/Collide(atom/A)
. = ..()
if(!buckled_mob)
return
if(propelled || (pulling && (pulling.a_intent == I_HURT)))
var/mob/living/occupant = unbuckle_mob()
@@ -98,7 +98,7 @@ obj/structure/ex_act(severity)
/obj/structure/transit_tube/Bumped(mob/AM as mob|obj)
/obj/structure/transit_tube/CollidedWith(mob/AM as mob|obj)
var/obj/structure/transit_tube/T = locate() in AM.loc
if(T)
AM << "<span class='warning'>The tube's support pylons block your way.</span>"
@@ -113,7 +113,7 @@ obj/structure/ex_act(severity)
/obj/structure/transit_tube/station/Bumped(mob/AM as mob|obj)
/obj/structure/transit_tube/station/CollidedWith(mob/AM as mob|obj)
if(!pod_moving && icon_state == "open" && istype(AM, /mob))
for(var/obj/structure/transit_tube_pod/pod in loc)
if(pod.contents.len)