From 0cd813a786dec71bcecbf66b0a7366ab80a6f3e9 Mon Sep 17 00:00:00 2001 From: "vageyenaman@gmail.com" Date: Tue, 28 Feb 2012 00:47:54 +0000 Subject: [PATCH] A couple more bugfixes and tweaks. Changed the way radio range works. Headsets have a range of 1, intercoms 3. If a person is in this range, they get to hear incoming messages. Fixed the disposal bug; items were dropping on the floor when placed in disposals... Changed the way NTSL::TCS broadcast() generates a dummy radio. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3206 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/radio/headset.dm | 1 + code/game/objects/radio/radio.dm | 4 +++- code/modules/recycling/disposal.dm | 3 ++- code/modules/scripting/Implementations/Telecomms.dm | 10 ++-------- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/code/game/objects/radio/headset.dm b/code/game/objects/radio/headset.dm index 83817fe232..78a25a401a 100644 --- a/code/game/objects/radio/headset.dm +++ b/code/game/objects/radio/headset.dm @@ -6,6 +6,7 @@ g_amt = 0 m_amt = 75 subspace_transmission = 1 + canhear_range = 1 // can't hear headsets from very far away var/protective_temperature = 0 var/translate_binary = 0 diff --git a/code/game/objects/radio/radio.dm b/code/game/objects/radio/radio.dm index 3b84d8e555..e9740b9a19 100644 --- a/code/game/objects/radio/radio.dm +++ b/code/game/objects/radio/radio.dm @@ -14,6 +14,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use last_transmission frequency = 1459 //common chat traitor_frequency = 0 //tune to frequency to unlock traitor supplies + canhear_range = 3 // the range which mobs can hear this radio from obj/item/device/radio/patch_link = null obj/item/weapon/syndicate_uplink/traitorradio = null wires = WIRE_SIGNAL | WIRE_RECEIVE | WIRE_TRANSMIT @@ -62,6 +63,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use checkpower() /obj/item/device/radio/initialize() + if(freerange) if(frequency < 1200 || frequency > 1600) frequency = sanitize_frequency(frequency) @@ -660,7 +662,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use /* Instead, let's individually search potential containers for mobs! More verbose but a LOT more efficient and less laggy */ // Check gamehelpers.dm for the proc definition: - return get_mobs_in_view(3, src) + return get_mobs_in_view(canhear_range, src) /obj/item/device/radio/examine() set src in view() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 5999d212ed..94d6b476dc 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -78,8 +78,9 @@ if(!I) return - I.loc = src user.drop_item() + if(I) + I.loc = src user << "You place \the [I] into the [src]." for(var/mob/M in viewers(src)) diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm index c7b627998a..d0306ffc61 100644 --- a/code/modules/scripting/Implementations/Telecomms.dm +++ b/code/modules/scripting/Implementations/Telecomms.dm @@ -222,16 +222,10 @@ datum/signal var/datum/radio_frequency/connection = radio_controller.return_frequency(freq) newsign.data["connection"] = connection - // This is a really hacky way of finding a source radio - but it works, i suppose. + // The radio is a radio headset! if(!hradio) - for(var/obj/item/device/radio/headset/r in world) - hradio = r - break - - // There are no radios in the world! Oh no! Just make a new one and pray to baby jesus - if(!hradio) - hradio = new + hradio = new /obj/item/device/radio/headset newsign.data["radio"] = hradio newsign.data["vmessage"] = H.voice_message