Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicles hear exterior audio #36

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading