Skip to content

Commit

Permalink
[MIRROR] Fixes tram counter with head-related injuries [MDB IGNORE] (…
Browse files Browse the repository at this point in the history
…#25302) (#858)

* Fixes tram counter with head-related injuries (#79947)

## About The Pull Request

Fixes counter not incrementing when the tram kills via the head.
Beheadings are worth triple points.
Closes tgstation/tgstation#79802

## Changelog

:cl: LT3
fix: Getting beheaded by the tram increments the scoreboard
/:cl:

---------



* Fixes tram counter with head-related injuries

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: lessthanthree <[email protected]>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
  • Loading branch information
4 people authored Nov 28, 2023
1 parent 4a88e8a commit 1677721
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions code/modules/transport/tram/tram_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@
SEND_TRANSPORT_SIGNAL(COMSIG_COMMS_STATUS, src, TRUE)
log_transport("TC: [specific_transport_id] ending Tram Malfunction event.")

/datum/transport_controller/linear/tram/proc/register_collision()
tram_registration.collisions += 1
/datum/transport_controller/linear/tram/proc/register_collision(points = 1)
tram_registration.collisions += points
SEND_TRANSPORT_SIGNAL(COMSIG_TRAM_COLLISION, SSpersistence.tram_hits_this_round)

/datum/transport_controller/linear/tram/proc/power_lost()
Expand Down
16 changes: 10 additions & 6 deletions code/modules/transport/transport_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
head.dismember()
victim_living.regenerate_icons()
add_overlay(mutable_appearance(icon, "blood_overlay"))
register_collision(points = 3)

if(FALSE)
log_combat(src, victim_living, "collided with")
Expand Down Expand Up @@ -452,17 +453,20 @@
victim_living.throw_at(throw_target, 200 * collision_lethality, 4 * collision_lethality, callback = land_slam)

//increment the hit counters
if(ismob(victim_living) && victim_living.client)
if(istype(transport_controller_datum, /datum/transport_controller/linear/tram))
SSpersistence.tram_hits_this_round++
SSblackbox.record_feedback("amount", "tram_collision", 1)
var/datum/transport_controller/linear/tram/tram_controller = transport_controller_datum
tram_controller.register_collision()
if(ismob(victim_living) && victim_living.client && istype(transport_controller_datum, /datum/transport_controller/linear/tram))
register_collision(points = 1)

unset_movement_registrations(exited_locs)
group_move(things_to_move, travel_direction)
set_movement_registrations(entering_locs)

/obj/structure/transport/linear/proc/register_collision(points = 1)
SSpersistence.tram_hits_this_round += points
SSblackbox.record_feedback("amount", "tram_collision", points)
var/datum/transport_controller/linear/tram/tram_controller = transport_controller_datum
ASSERT(istype(tram_controller))
tram_controller.register_collision(points)

///move the movers list of movables on our tile to destination if we successfully move there first.
///this is like calling forceMove() on everything in movers and ourselves, except nothing in movers
///has destination.Entered() and origin.Exited() called on them, as only our movement can be perceived.
Expand Down

0 comments on commit 1677721

Please sign in to comment.