From a367c55af4963e55a4298ea3d369d66a4120e6bf Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Wed, 1 Nov 2023 02:46:50 -0400 Subject: [PATCH] Vehicles hear exterior audio (#36) --- code/controllers/subsystem/interior.dm | 4 ++-- code/controllers/subsystem/sound.dm | 2 +- code/modules/vehicles/interior/interior.dm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/controllers/subsystem/interior.dm b/code/controllers/subsystem/interior.dm index 389e95fe60..be12bdee1b 100644 --- a/code/controllers/subsystem/interior.dm +++ b/code/controllers/subsystem/interior.dm @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(interior) continue if(x >= bounds[1].x && x <= bounds[2].x && y >= bounds[1].y && y <= bounds[2].y) return current_interior - return FALSE + return null /// Checks if an atom is in an interior /datum/controller/subsystem/interior/proc/in_interior(loc) @@ -51,7 +51,7 @@ SUBSYSTEM_DEF(interior) if(!isturf(loc)) loc = get_turf(loc) - var/datum/turf_reservation/interior/reservation = SSmapping.used_turfs[loc] + var/datum/weakref/reservation = SSmapping.used_turfs[loc] if(!istype(reservation)) return FALSE diff --git a/code/controllers/subsystem/sound.dm b/code/controllers/subsystem/sound.dm index 1935294394..4fdfd79353 100644 --- a/code/controllers/subsystem/sound.dm +++ b/code/controllers/subsystem/sound.dm @@ -41,5 +41,5 @@ SUBSYSTEM_DEF(sound) if(VI?.ready) var/list/bounds = VI.get_middle_coords() if(bounds.len >= 2) - hearers |= SSquadtree.players_in_range(RECT(bounds[1], bounds[2], VI.map_template.height, VI.map_template.width), bounds[3]) + hearers |= SSquadtree.players_in_range(RECT(bounds[1], bounds[2], VI.map_template.width, VI.map_template.height), bounds[3]) template_queue[template] = hearers diff --git a/code/modules/vehicles/interior/interior.dm b/code/modules/vehicles/interior/interior.dm index 046b42495a..f2afcd5ae5 100644 --- a/code/modules/vehicles/interior/interior.dm +++ b/code/modules/vehicles/interior/interior.dm @@ -318,7 +318,7 @@ var/turf/min = reservation.bottom_left_coords var/turf/max = reservation.top_right_coords - return list(Floor(min[1] + (max[1] - min[1])), Floor(min[2] + (max[2] - min[2])), min[3]) + return list(Floor(min[1] + (max[1] - min[1])/2), Floor(min[2] + (max[2] - min[2])/2), min[3]) /datum/interior/proc/get_middle_turf() var/list/turf/bounds = get_bound_turfs()