mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-26 10:04:12 +00:00
yumyum radio go vroom hehe
This commit is contained in:
@@ -239,7 +239,7 @@ var/mobs_radio_range_fired = 1 //CHOMPEdit
|
||||
T.temp_check[our_iter] = TRUE //CHOMPEdit
|
||||
speaker_coverage[T] = R
|
||||
|
||||
|
||||
CHECK_TICK //CHOMPEdit
|
||||
// Try to find all the players who can hear the message
|
||||
//CHOMPEdit Begin
|
||||
//So, to explain a bit here: The old code that used to be here was pretty slow for a few reasons, most of which have been addressed now.
|
||||
@@ -251,6 +251,7 @@ var/mobs_radio_range_fired = 1 //CHOMPEdit
|
||||
var/turf/T = get_turf(M)
|
||||
if(istype(T) && T.temp_check[our_iter])
|
||||
. += M
|
||||
CHECK_TICK
|
||||
for(var/turf/T in speaker_coverage)
|
||||
T.temp_check -= our_iter //Freeing up the memory.
|
||||
//CHOMPEdit End
|
||||
|
||||
@@ -121,7 +121,6 @@ SUBSYSTEM_DEF(machines)
|
||||
while(current_run.len)
|
||||
var/obj/machinery/M = current_run[current_run.len]
|
||||
current_run.len--
|
||||
var/q = QDELETED(M) //CHOMPStation edit
|
||||
if(!istype(M) || QDELETED(M) || (M.process(wait) == PROCESS_KILL))
|
||||
global.processing_machines.Remove(M)
|
||||
if(!QDELETED(M))
|
||||
|
||||
@@ -15,4 +15,33 @@
|
||||
output += cand_turf
|
||||
continue
|
||||
return output
|
||||
/obj/item/device/radio/intercom
|
||||
var/list/broadcast_tiles
|
||||
|
||||
/obj/item/device/radio/intercom/proc/update_broadcast_tiles()
|
||||
var/list/output = list()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
var/dnumber = canhear_range*CANBROADCAST_INNERBOX
|
||||
for(var/cand_x = max(0, T.x - canhear_range), cand_x <= T.x + canhear_range, cand_x++)
|
||||
for(var/cand_y = max(0, T.y - canhear_range), cand_y <= T.y + canhear_range, cand_y++)
|
||||
var/turf/cand_turf = locate(cand_x,cand_y,T.z)
|
||||
if(!cand_turf)
|
||||
continue
|
||||
if((abs(T.x - cand_x) < dnumber) || (abs(T.y - cand_y) < dnumber))
|
||||
output += cand_turf
|
||||
continue
|
||||
if(sqrt((T.x - cand_x)**2 + (T.y - cand_y)**2) <= canhear_range)
|
||||
output += cand_turf
|
||||
continue
|
||||
broadcast_tiles = output
|
||||
|
||||
/obj/item/device/radio/intercom/Initialize()
|
||||
update_broadcast_tiles()
|
||||
|
||||
/obj/item/device/radio/intercom/can_broadcast_to()
|
||||
if(!broadcast_tiles)
|
||||
update_broadcast_tiles()
|
||||
return broadcast_tiles
|
||||
#undef CANBROADCAST_INNERBOX
|
||||
|
||||
Reference in New Issue
Block a user