Skip to content

Commit

Permalink
Vehicles hear exterior audio (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Nov 1, 2023
1 parent a504dfa commit a367c55
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/controllers/subsystem/interior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion code/modules/vehicles/interior/interior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a367c55

Please sign in to comment.