removes var/ inside all procs (#19450)

* removes var/ inside all procs

* .

* ugh
This commit is contained in:
Kashargul
2026-05-05 10:55:17 +02:00
committed by GitHub
parent 13162d13a2
commit 5926589c16
1987 changed files with 7376 additions and 7377 deletions
@@ -15,12 +15,12 @@ GLOBAL_VAR_INIT(ntnrc_uid, 0)
GLOB.ntnet_global.chat_channels.Add(src)
..()
/datum/ntnet_conversation/proc/add_message(var/message, var/username)
/datum/ntnet_conversation/proc/add_message(message, username)
message = "[stationtime2text()] [username]: [message]"
messages.Add(message)
trim_message_list()
/datum/ntnet_conversation/proc/add_status_message(var/message)
/datum/ntnet_conversation/proc/add_status_message(message)
messages.Add("[stationtime2text()] -!- [message]")
trim_message_list()
@@ -29,7 +29,7 @@ GLOBAL_VAR_INIT(ntnrc_uid, 0)
return
messages.Cut(1, (messages.len-49))
/datum/ntnet_conversation/proc/add_client(var/datum/computer_file/program/chatclient/C)
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/C)
if(!istype(C))
return
clients.Add(C)
@@ -38,7 +38,7 @@ GLOBAL_VAR_INIT(ntnrc_uid, 0)
if(!operator)
changeop(C)
/datum/ntnet_conversation/proc/remove_client(var/datum/computer_file/program/chatclient/C)
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/C)
if(!istype(C) || !(C in clients))
return
clients.Remove(C)
@@ -52,12 +52,12 @@ GLOBAL_VAR_INIT(ntnrc_uid, 0)
changeop(newop)
/datum/ntnet_conversation/proc/changeop(var/datum/computer_file/program/chatclient/newop)
/datum/ntnet_conversation/proc/changeop(datum/computer_file/program/chatclient/newop)
if(istype(newop))
operator = newop
add_status_message("Channel operator status transferred to [newop.username].")
/datum/ntnet_conversation/proc/change_title(var/newtitle, var/datum/computer_file/program/chatclient/client)
/datum/ntnet_conversation/proc/change_title(newtitle, datum/computer_file/program/chatclient/client)
if(operator != client)
return 0 // Not Authorised
@@ -49,12 +49,12 @@
build_emails_list()
add_log("NTNet logging system activated.")
/datum/ntnet/proc/add_log_with_ids_check(var/log_string, var/obj/item/computer_hardware/network_card/source = null)
/datum/ntnet/proc/add_log_with_ids_check(log_string, obj/item/computer_hardware/network_card/source = null)
if(intrusion_detection_enabled)
add_log(log_string, source)
// Simplified logging: Adds a log. log_string is mandatory parameter, source is optional.
/datum/ntnet/proc/add_log(var/log_string, var/obj/item/computer_hardware/network_card/source = null)
/datum/ntnet/proc/add_log(log_string, obj/item/computer_hardware/network_card/source = null)
var/log_text = "[stationtime2text()] - "
if(source)
log_text += "[source.get_network_tag()] - "
@@ -88,7 +88,7 @@
return FALSE
// Checks whether NTNet operates. If parameter is passed checks whether specific function is enabled.
/datum/ntnet/proc/check_function(var/specific_action = 0)
/datum/ntnet/proc/check_function(specific_action = 0)
if(!relays || !relays.len) // No relays found. NTNet is down
return 0
@@ -142,7 +142,7 @@
email_accounts += new F(TRUE)
// Attempts to find a downloadable file according to filename var
/datum/ntnet/proc/find_ntnet_file_by_name(var/filename)
/datum/ntnet/proc/find_ntnet_file_by_name(filename)
for(var/datum/computer_file/program/P in available_station_software)
if(filename == P.filename)
return P
@@ -166,7 +166,7 @@
add_log("-!- LOGS DELETED BY SYSTEM OPERATOR -!-")
// Updates maximal amount of stored logs. Use this instead of setting the number, it performs required checks.
/datum/ntnet/proc/update_max_log_count(var/lognumber)
/datum/ntnet/proc/update_max_log_count(lognumber)
if(!lognumber)
return 0
// Trim the value if necessary
@@ -174,7 +174,7 @@
setting_maxlogcount = lognumber
add_log("Configuration Updated. Now keeping [setting_maxlogcount] logs in system memory.")
/datum/ntnet/proc/toggle_function(var/function)
/datum/ntnet/proc/toggle_function(function)
if(!function)
return
function = text2num(function)
@@ -192,7 +192,7 @@
setting_systemcontrol = !setting_systemcontrol
add_log("Configuration Updated. Wireless network firewall now [setting_systemcontrol ? "allows" : "disallows"] remote control of station's systems.")
/datum/ntnet/proc/does_email_exist(var/login)
/datum/ntnet/proc/does_email_exist(login)
for(var/datum/computer_file/data/email_account/A in GLOB.ntnet_global.email_accounts)
if(A.login == login)
return 1
@@ -79,7 +79,7 @@
data["dos_crashed"] = dos_failure
return data
/obj/machinery/ntnet_relay/attack_hand(var/mob/living/user)
/obj/machinery/ntnet_relay/attack_hand(mob/living/user)
tgui_interact(user)
/obj/machinery/ntnet_relay/tgui_act(action, params)
@@ -138,7 +138,7 @@
QDEL_NULL(soundloop)
. = ..()
/obj/machinery/ntnet_relay/attackby(var/obj/item/W as obj, var/mob/user as mob)
/obj/machinery/ntnet_relay/attackby(obj/item/W as obj, mob/user as mob)
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
@@ -36,7 +36,7 @@
/datum/computer_file/data/email_account/proc/all_emails()
return (inbox | spam | deleted)
/datum/computer_file/data/email_account/proc/send_mail(var/recipient_address, var/datum/computer_file/data/email_message/message, var/relayed = 0)
/datum/computer_file/data/email_account/proc/send_mail(recipient_address, datum/computer_file/data/email_message/message, relayed = 0)
var/datum/computer_file/data/email_account/recipient
for(var/datum/computer_file/data/email_account/account in GLOB.ntnet_global.email_accounts)
if(account.login == recipient_address)
@@ -52,7 +52,7 @@
GLOB.ntnet_global.add_log_with_ids_check("EMAIL LOG: [login] -> [recipient.login] title: [message.title].")
return 1
/datum/computer_file/data/email_account/proc/receive_mail(var/datum/computer_file/data/email_message/received_message, var/relayed)
/datum/computer_file/data/email_account/proc/receive_mail(datum/computer_file/data/email_message/received_message, relayed)
received_message.set_timestamp()
if(!GLOB.ntnet_global.intrusion_detection_enabled)
inbox.Add(received_message)
@@ -77,7 +77,7 @@
/datum/computer_file/data/email_account/service/broadcaster
login = EMAIL_BROADCAST
/datum/computer_file/data/email_account/service/broadcaster/receive_mail(var/datum/computer_file/data/email_message/received_message, var/relayed)
/datum/computer_file/data/email_account/service/broadcaster/receive_mail(datum/computer_file/data/email_message/received_message, relayed)
if(suspended || !istype(received_message) || relayed)
return FALSE
// Possibly exploitable for user spamming so keep admins informed.
@@ -98,7 +98,7 @@
/datum/computer_file/data/email_account/service/sysadmin
login = EMAIL_SYSADMIN
/datum/computer_file/data/email_account/service/broadcaster/receive_mail(var/datum/computer_file/data/email_message/received_message, var/relayed)
/datum/computer_file/data/email_account/service/broadcaster/receive_mail(datum/computer_file/data/email_message/received_message, relayed)
if(!istype(received_message) || relayed)
return 0
// Possibly exploitable for user spamming so keep admins informed.
@@ -61,7 +61,7 @@
paired_uavs.Cut()
return ..()
/obj/item/modular_computer/emag_act(var/remaining_charges, var/mob/user)
/obj/item/modular_computer/emag_act(remaining_charges, mob/user)
if(computer_emagged)
to_chat(user, "\The [src] was already emagged.")
return //NO_EMAG_ACT
@@ -102,7 +102,7 @@
return add_overlay(.)
/obj/item/modular_computer/proc/turn_on(var/mob/user)
/obj/item/modular_computer/proc/turn_on(mob/user)
if(bsod)
return
if(tesla_link)
@@ -129,7 +129,7 @@
to_chat(user, "You press the power button but \the [src] does not respond")
// Relays kill program request to currently active program. Use this to quit current program.
/obj/item/modular_computer/proc/kill_program(var/forced = 0)
/obj/item/modular_computer/proc/kill_program(forced = 0)
if(active_program)
active_program.kill_program(forced)
active_program = null
@@ -137,7 +137,7 @@
addtimer(CALLBACK(src, PROC_REF(delayed_reopen_ui), user), 1, TIMER_DELETE_ME)
update_icon()
/obj/item/modular_computer/proc/delayed_reopen_ui(var/mob/user)
/obj/item/modular_computer/proc/delayed_reopen_ui(mob/user)
// Re-open the UI on this computer. It should show the main screen now.
// Expected from kill_program()
PRIVATE_PROC(TRUE)
@@ -147,18 +147,18 @@
tgui_interact(user)
// Returns 0 for No Signal, 1 for Low Signal and 2 for Good Signal. 3 is for wired connection (always-on)
/obj/item/modular_computer/proc/get_ntnet_status(var/specific_action = 0)
/obj/item/modular_computer/proc/get_ntnet_status(specific_action = 0)
if(network_card)
return network_card.get_signal(specific_action)
else
return 0
/obj/item/modular_computer/proc/add_log(var/text)
/obj/item/modular_computer/proc/add_log(text)
if(!get_ntnet_status())
return 0
return GLOB.ntnet_global.add_log(text, network_card)
/obj/item/modular_computer/proc/shutdown_computer(var/loud = 1)
/obj/item/modular_computer/proc/shutdown_computer(loud = 1)
kill_program(1)
for(var/datum/computer_file/program/P in idle_threads)
P.kill_program(1)
@@ -168,7 +168,7 @@
enabled = 0
update_icon()
/obj/item/modular_computer/proc/enable_computer(var/mob/user = null)
/obj/item/modular_computer/proc/enable_computer(mob/user = null)
enabled = 1
update_icon()
@@ -285,7 +285,7 @@
else
autorun.stored_data = program
/obj/item/modular_computer/proc/find_file_by_uid(var/uid)
/obj/item/modular_computer/proc/find_file_by_uid(uid)
if(hard_drive)
. = hard_drive.find_file_by_uid(uid)
if(portable_drive && !.)
@@ -1,4 +1,4 @@
/obj/item/modular_computer/examine(var/mob/user)
/obj/item/modular_computer/examine(mob/user)
. = ..()
if(damage > broken_damage)
. += span_danger("It is heavily damaged!")
@@ -16,7 +16,7 @@
H.take_damage(rand(10,30))
qdel()
/obj/item/modular_computer/take_damage(var/amount, var/component_probability, var/damage_casing = 1, var/randomize = 1)
/obj/item/modular_computer/take_damage(amount, component_probability, damage_casing = 1, randomize = 1)
if(randomize)
// 75%-125%, rand() works with integers, apparently.
amount *= (rand(75, 125) / 100.0)
@@ -35,7 +35,7 @@
// Stronger explosions cause serious damage to internal components
// Minor explosions are mostly mitigitated by casing.
/obj/item/modular_computer/ex_act(var/severity)
/obj/item/modular_computer/ex_act(severity)
take_damage(rand(100,200) / severity, 30 / severity)
// EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components
@@ -48,7 +48,7 @@
// "Stun" weapons can cause minor damage to components (short-circuits?)
// "Burn" damage is equally strong against internal components and exterior casing
// "Brute" damage mostly damages the casing.
/obj/item/modular_computer/bullet_act(var/obj/item/projectile/Proj)
/obj/item/modular_computer/bullet_act(obj/item/projectile/Proj)
switch(Proj.damage_type)
if(BRUTE)
take_damage(Proj.damage, Proj.damage / 2)
@@ -1,5 +1,5 @@
// Attempts to install the hardware into apropriate slot.
/obj/item/modular_computer/proc/try_install_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = 0)
/obj/item/modular_computer/proc/try_install_component(mob/living/user, obj/item/computer_hardware/H, found = 0)
// "USB" flash drive.
if(istype(H, /obj/item/computer_hardware/hard_drive/portable))
if(portable_drive)
@@ -57,7 +57,7 @@
update_verbs()
// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware.
/obj/item/modular_computer/proc/uninstall_component(var/mob/living/user, var/obj/item/computer_hardware/H, var/found = 0, var/critical = 0)
/obj/item/modular_computer/proc/uninstall_component(mob/living/user, obj/item/computer_hardware/H, found = 0, critical = 0)
if(portable_drive == H)
portable_drive = null
found = 1
@@ -98,7 +98,7 @@
// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null
/obj/item/modular_computer/proc/find_hardware_by_name(var/name)
/obj/item/modular_computer/proc/find_hardware_by_name(name)
if(portable_drive && (portable_drive.name == name))
return portable_drive
if(hard_drive && (hard_drive.name == name))
@@ -97,7 +97,7 @@
uninstall_component(user, portable_drive)
update_uis()
/obj/item/modular_computer/attack_ghost(var/mob/observer/dead/user)
/obj/item/modular_computer/attack_ghost(mob/observer/dead/user)
if(enabled)
tgui_interact(user)
else if(check_rights_for(user.client, R_ADMIN|R_EVENT|R_DEBUG))
@@ -105,10 +105,10 @@
if(response == "Yes")
turn_on(user)
/obj/item/modular_computer/attack_ai(var/mob/user)
/obj/item/modular_computer/attack_ai(mob/user)
return attack_self(user)
/obj/item/modular_computer/attack_hand(var/mob/user)
/obj/item/modular_computer/attack_hand(mob/user)
if(anchored || ispAI(user))
return attack_self(user)
return ..()
@@ -134,7 +134,7 @@
return
turn_on(user)
/obj/item/modular_computer/attackby(var/obj/item/W, var/mob/user)
/obj/item/modular_computer/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/card/id)) // ID Card, try to insert it.
var/obj/item/card/id/I = W
if(!card_slot)
@@ -1,4 +1,4 @@
/obj/item/modular_computer/proc/power_failure(var/malfunction = 0)
/obj/item/modular_computer/proc/power_failure(malfunction = 0)
if(enabled) // Shut down the computer
visible_message(span_danger("\The [src]'s screen flickers briefly and then goes dark."))
if(active_program)
@@ -8,7 +8,7 @@
shutdown_computer(0)
// Tries to use power from battery. Passing 0 as parameter results in this proc returning whether battery is functional or not.
/obj/item/modular_computer/proc/battery_power(var/power_usage = 0)
/obj/item/modular_computer/proc/battery_power(power_usage = 0)
apc_powered = FALSE
if(!battery_module || !battery_module.check_functionality() || battery_module.battery.charge <= 0)
return FALSE
@@ -23,7 +23,7 @@
..()
// Tries to use power from APC, if present.
/obj/item/modular_computer/proc/apc_power(var/power_usage = 0)
/obj/item/modular_computer/proc/apc_power(power_usage = 0)
apc_powered = TRUE
// Tesla link was originally limited to machinery only, but this probably works too, and the benefit of being able to power all devices from an APC outweights
// the possible minor performance loss.
@@ -19,7 +19,7 @@
broken_damage = 150
w_class = ITEMSIZE_HUGE
/obj/item/modular_computer/telescreen/attackby(var/obj/item/W as obj, var/mob/user as mob)
/obj/item/modular_computer/telescreen/attackby(obj/item/W as obj, mob/user as mob)
if(W.has_tool_quality(TOOL_CROWBAR))
if(anchored)
shutdown_computer()
@@ -43,7 +43,7 @@ GLOBAL_VAR_INIT(file_uid, 0)
return ..()
// Returns independent copy of this file.
/datum/computer_file/proc/clone(var/rename = 0)
/datum/computer_file/proc/clone(rename = 0)
var/datum/computer_file/temp = new type
temp.unsendable = unsendable
temp.undeletable = undeletable
@@ -9,7 +9,7 @@
var/archived // Set to 1 for older stuff
var/cover //filename of cover.
/datum/computer_file/data/news_article/New(var/load_from_file = 0)
/datum/computer_file/data/news_article/New(load_from_file = 0)
..()
if(server_file_path && load_from_file)
stored_data = file2text(server_file_path)
@@ -38,7 +38,7 @@
/// Name of the tgui interface
var/tgui_id
/datum/computer_file/program/New(var/obj/item/modular_computer/comp = null)
/datum/computer_file/program/New(obj/item/modular_computer/comp = null)
..()
if(comp && istype(comp))
computer = comp
@@ -66,19 +66,19 @@
computer.update_icon()
// Attempts to create a log in global ntnet datum. Returns 1 on success, 0 on fail.
/datum/computer_file/program/proc/generate_network_log(var/text)
/datum/computer_file/program/proc/generate_network_log(text)
if(computer)
return computer.add_log(text)
return 0
/datum/computer_file/program/proc/is_supported_by_hardware(var/hardware_flag = 0, var/loud = 0, var/mob/user = null)
/datum/computer_file/program/proc/is_supported_by_hardware(hardware_flag = 0, loud = 0, mob/user = null)
if(!(hardware_flag & usage_flags))
if(loud && computer && user)
to_chat(user, span_warning("\The [computer] flashes: \"Hardware Error - Incompatible software\"."))
return 0
return 1
/datum/computer_file/program/proc/get_signal(var/specific_action = 0)
/datum/computer_file/program/proc/get_signal(specific_action = 0)
if(computer)
return computer.get_ntnet_status(specific_action)
return 0
@@ -102,7 +102,7 @@
// User has to wear their ID or have it inhand for ID Scan to work.
// Can also be called manually, with optional parameter being access_to_check to scan the user's ID.
// explicit_card can be passed by callers that already have a card reference (e.g. the laptop's inserted card).
/datum/computer_file/program/proc/can_run(var/mob/living/user, var/loud = 0, var/access_to_check, var/obj/item/card/id/explicit_card)
/datum/computer_file/program/proc/can_run(mob/living/user, loud = 0, access_to_check, obj/item/card/id/explicit_card)
// Defaults to required_access
if(!access_to_check)
access_to_check = required_access
@@ -138,7 +138,7 @@
// This is performed on program startup. May be overriden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure.
// When implementing new program based device, use this to run the program.
/datum/computer_file/program/proc/run_program(var/mob/living/user)
/datum/computer_file/program/proc/run_program(mob/living/user)
if(can_run(user, 1) || !requires_access_to_run)
computer.active_program = src
if(tguimodule_path)
@@ -154,7 +154,7 @@
return 0
// Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client.
/datum/computer_file/program/proc/kill_program(var/forced = 0)
/datum/computer_file/program/proc/kill_program(forced = 0)
program_state = PROGRAM_STATE_KILLED
if(network_destination)
generate_network_log("Connection to [network_destination] closed.")
@@ -2,15 +2,15 @@
// Always include a parent call when overriding an event.
// Called when the ID card is removed from computer. ID is removed AFTER this proc.
/datum/computer_file/program/proc/event_idremoved(var/background)
/datum/computer_file/program/proc/event_idremoved(background)
return
// Called when the computer fails due to power loss. Override when program wants to specifically react to power loss.
/datum/computer_file/program/proc/event_powerfailure(var/background)
/datum/computer_file/program/proc/event_powerfailure(background)
kill_program(1)
// Called when the network connectivity fails. Computer does necessary checks and only calls this when requires_ntnet_feature and similar variables are not met.
/datum/computer_file/program/proc/event_networkfailure(var/background)
/datum/computer_file/program/proc/event_networkfailure(background)
kill_program(1)
if(background)
computer.visible_message(span_warning("\The [computer]'s screen displays an error: \"Network connectivity lost - process [filename].[filetype] (PID [rand(100,999)]) terminated.\""))
@@ -18,7 +18,7 @@
var/datum/access/target_access = null
var/list/restricted_access_codes = list(ACCESS_CHANGE_IDS, ACCESS_NETWORK) // access codes that are not hackable due to balance reasons
/datum/computer_file/program/access_decrypter/kill_program(var/forced)
/datum/computer_file/program/access_decrypter/kill_program(forced)
reset()
..(forced)
@@ -32,7 +32,7 @@
target = null
error = "Connection to destination relay lost."
/datum/computer_file/program/ntnet_dos/kill_program(var/forced)
/datum/computer_file/program/ntnet_dos/kill_program(forced)
if(target)
target.dos_sources.Remove(src)
target = null
@@ -12,7 +12,7 @@
tgui_id = "NtosRevelation"
var/armed = 0
/datum/computer_file/program/revelation/run_program(var/mob/living/user)
/datum/computer_file/program/revelation/run_program(mob/living/user)
. = ..(user)
if(armed)
activate()
@@ -14,7 +14,7 @@
category = PROG_COMMAND
var/datum/comm_message_listener/message_core
/datum/computer_file/program/comm/New(var/obj/item/modular_computer/comp = null)
/datum/computer_file/program/comm/New(obj/item/modular_computer/comp = null)
..()
message_core = new
@@ -32,7 +32,7 @@ General message handling stuff
GLOB.last_message_id = GLOB.last_message_id + 1
return GLOB.last_message_id
/proc/post_comm_message(var/message_title, var/message_text)
/proc/post_comm_message(message_title, message_text)
var/list/message = list()
message["id"] = get_comm_message_id()
message["title"] = message_title
@@ -49,8 +49,8 @@ General message handling stuff
messages = list()
GLOB.comm_message_listeners.Add(src)
/datum/comm_message_listener/proc/Add(var/list/message)
/datum/comm_message_listener/proc/Add(list/message)
messages[++messages.len] = message
/datum/comm_message_listener/proc/Remove(var/list/message)
/datum/comm_message_listener/proc/Remove(list/message)
messages -= list(message)
@@ -1,5 +1,5 @@
// Returns which access is relevant to passed network. Used by the program.
/proc/get_camera_access(var/network)
/proc/get_camera_access(network)
if(!network)
return 0
. = using_map.get_network_access(network)
@@ -33,7 +33,7 @@
..()
abort_file_download()
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(var/filename)
/datum/computer_file/program/ntnetdownload/proc/begin_file_download(filename)
if(downloaded_file)
return 0
@@ -56,7 +56,7 @@
downloaded_file = PRG.clone()
/datum/computer_file/program/ntnetdownload/proc/check_file_download(var/filename)
/datum/computer_file/program/ntnetdownload/proc/check_file_download(filename)
//returns 1 if file can be downloaded, returns 0 if download prohibited
var/datum/computer_file/program/PRG = GLOB.ntnet_global.find_ntnet_file_by_name(filename)
@@ -47,7 +47,7 @@ GLOBAL_VAR_INIT(nttransfer_uid, 0)
if(!remote)
crash_download("Connection to remote server lost")
/datum/computer_file/program/nttransfer/kill_program(var/forced = 0)
/datum/computer_file/program/nttransfer/kill_program(forced = 0)
if(downloaded_file) // Client mode, clean up variables for next use
finalize_download()
@@ -64,7 +64,7 @@ GLOBAL_VAR_INIT(nttransfer_uid, 0)
finalize_download()
// Crashes the download and displays specific error message
/datum/computer_file/program/nttransfer/proc/crash_download(var/message)
/datum/computer_file/program/nttransfer/proc/crash_download(message)
error = message ? message : "An unknown error has occurred during download"
finalize_download()
@@ -18,7 +18,7 @@
usage_flags = PROGRAM_ALL
category = PROG_OFFICE
/datum/computer_file/program/wordprocessor/proc/get_file(var/filename)
/datum/computer_file/program/wordprocessor/proc/get_file(filename)
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
if(!HDD)
return
@@ -27,14 +27,14 @@
return
return F
/datum/computer_file/program/wordprocessor/proc/open_file(var/filename)
/datum/computer_file/program/wordprocessor/proc/open_file(filename)
var/datum/computer_file/data/F = get_file(filename)
if(F)
open_file = F.filename
loaded_data = F.stored_data
return TRUE
/datum/computer_file/program/wordprocessor/proc/save_file(var/filename)
/datum/computer_file/program/wordprocessor/proc/save_file(filename)
var/datum/computer_file/data/F = get_file(filename)
if(!F) //try to make one if it doesn't exist
F = create_file(filename, loaded_data)
@@ -52,7 +52,7 @@
is_edited = 0
return TRUE
/datum/computer_file/program/wordprocessor/proc/create_file(var/newname, var/data = "")
/datum/computer_file/program/wordprocessor/proc/create_file(newname, data = "")
if(!newname)
return
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
@@ -56,7 +56,7 @@
/// Returns a list of lines containing diagnostic information for display.
/obj/item/computer_hardware/proc/diagnostics(var/mob/user)
/obj/item/computer_hardware/proc/diagnostics(mob/user)
to_chat(user, "Hardware Integrity Test... (Corruption: [damage]/[max_damage]) [damage > damage_failure ? "FAIL" : damage > damage_malfunction ? "WARN" : "PASS"]")
/obj/item/computer_hardware/Initialize(mapload)
@@ -84,7 +84,7 @@
// Good to go.
return TRUE
/obj/item/computer_hardware/examine(var/mob/user)
/obj/item/computer_hardware/examine(mob/user)
. = ..()
if(damage > damage_failure)
. += span_danger("It seems to be severely damaged!")
@@ -94,6 +94,6 @@
. += "It seems to be slightly damaged."
/// Damages the component. Contains necessary checks. Negative damage "heals" the component.
/obj/item/computer_hardware/take_damage(var/amount)
/obj/item/computer_hardware/take_damage(amount)
damage += round(amount) // We want nice rounded numbers here.
damage = between(0, damage, max_damage) // Clamp the value.
@@ -53,7 +53,7 @@
/obj/item/computer_hardware/battery_module/lambda/Initialize(mapload)
. = ..(mapload, /obj/item/cell/infinite)
/obj/item/computer_hardware/battery_module/diagnostics(var/mob/user)
/obj/item/computer_hardware/battery_module/diagnostics(mob/user)
..()
to_chat(user, "Internal battery charge: [battery.charge]/[battery.maxcharge] CU")
@@ -53,7 +53,7 @@
icon_state = "hdd_micro"
hardware_size = 1
/obj/item/computer_hardware/hard_drive/diagnostics(var/mob/user)
/obj/item/computer_hardware/hard_drive/diagnostics(mob/user)
..()
// 999 is a byond limit that is in place. It's unlikely someone will reach that many files anyway, since you would sooner run out of space.
to_chat(user, "NT-NFS File Table Status: [stored_files.len]/999")
@@ -61,7 +61,7 @@
to_chat(user, "Read-only mode: [(read_only ? "ON" : "OFF")]")
// Use this proc to add file to the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/computer_hardware/hard_drive/proc/store_file(var/datum/computer_file/F)
/obj/item/computer_hardware/hard_drive/proc/store_file(datum/computer_file/F)
if(!F || !istype(F))
return 0
@@ -91,7 +91,7 @@
// Use this proc to remove file from the drive. Returns 1 on success and 0 on failure. Contains necessary sanity checks.
/obj/item/computer_hardware/hard_drive/proc/remove_file(var/datum/computer_file/F)
/obj/item/computer_hardware/hard_drive/proc/remove_file(datum/computer_file/F)
if(!F || !istype(F))
return 0
@@ -117,7 +117,7 @@
used_capacity = total_size
// Checks whether file can be stored on the hard drive.
/obj/item/computer_hardware/hard_drive/proc/can_store_file(var/size = 1)
/obj/item/computer_hardware/hard_drive/proc/can_store_file(size = 1)
// In the unlikely event someone manages to create that many files.
// BYOND is acting weird with numbers above 999 in loops (infinite loop prevention)
if(stored_files.len >= 999)
@@ -128,7 +128,7 @@
return 1
// Checks whether we can store the file. We can only store unique files, so this checks whether we wouldn't get a duplicity by adding a file.
/obj/item/computer_hardware/hard_drive/proc/try_store_file(var/datum/computer_file/F)
/obj/item/computer_hardware/hard_drive/proc/try_store_file(datum/computer_file/F)
if(!F || !istype(F))
return 0
var/name = F.filename + "." + F.filetype
@@ -140,7 +140,7 @@
// Tries to find the file by filename. Returns null on failure
/obj/item/computer_hardware/hard_drive/proc/find_file_by_name(var/filename)
/obj/item/computer_hardware/hard_drive/proc/find_file_by_name(filename)
if(!check_functionality())
return null
@@ -156,7 +156,7 @@
return null
// Tries to find the file by unique ID. Returns null on failure
/obj/item/computer_hardware/hard_drive/proc/find_file_by_uid(var/uid)
/obj/item/computer_hardware/hard_drive/proc/find_file_by_uid(uid)
if(!check_functionality())
return null
@@ -8,11 +8,11 @@
var/stored_paper = 5
var/max_paper = 10
/obj/item/computer_hardware/nano_printer/diagnostics(var/mob/user)
/obj/item/computer_hardware/nano_printer/diagnostics(mob/user)
..()
to_chat(user, "Paper buffer level: [stored_paper]/[max_paper]")
/obj/item/computer_hardware/nano_printer/proc/print_text(var/text_to_print, var/paper_title = null)
/obj/item/computer_hardware/nano_printer/proc/print_text(text_to_print, paper_title = null)
if(!stored_paper)
return 0
if(!enabled)
@@ -36,7 +36,7 @@
stored_paper--
return 1
/obj/item/computer_hardware/nano_printer/proc/count_fields(var/info)
/obj/item/computer_hardware/nano_printer/proc/count_fields(info)
//Count the fields. This is taken directly from paper.dm, /obj/item/paper/proc/parsepencode(). -Hawk_v3
var/fields = 0
var/t = info
@@ -21,7 +21,7 @@ GLOBAL_VAR_INIT(ntnet_card_uid, 1)
/// If set, uses the value to funnel connections through another network card.
var/proxy_id
/obj/item/computer_hardware/network_card/diagnostics(var/mob/user)
/obj/item/computer_hardware/network_card/diagnostics(mob/user)
..()
to_chat(user, "NIX Unique ID: [identification_id]")
to_chat(user, "NIX User Tag: [identification_string]")
@@ -53,7 +53,7 @@ GLOBAL_VAR_INIT(ntnet_card_uid, 1)
icon_state = "netcard_advanced"
hardware_size = 1
/obj/item/computer_hardware/network_card/quantum/get_signal(var/specific_action = 0)
/obj/item/computer_hardware/network_card/quantum/get_signal(specific_action = 0)
if(!holder2)
return 0
@@ -87,7 +87,7 @@ GLOBAL_VAR_INIT(ntnet_card_uid, 1)
return GLOB.ntnet_global.check_banned(identification_id)
// 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection
/obj/item/computer_hardware/network_card/proc/get_signal(var/specific_action = 0)
/obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0)
if(!holder2) // Hardware is not installed in anything. No signal. How did this even get called?
return 0
@@ -46,7 +46,7 @@
dev_card = 0
// Recalculates the price and optionally even fabricates the device.
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(var/fabricate = 0)
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = 0)
total_price = 0
if(devtype == 1) // Laptop, generally cheaper to make it accessible for most station roles
if(fabricate)
@@ -214,7 +214,7 @@
/obj/machinery/lapvend/attack_hand(var/mob/user)
/obj/machinery/lapvend/attack_hand(mob/user)
tgui_interact(user)
/obj/machinery/lapvend/tgui_interact(mob/user, datum/tgui/ui)
@@ -274,7 +274,7 @@
return ..()
// Simplified payment processing, returns 1 on success.
/obj/machinery/lapvend/proc/process_payment(mob/user, var/obj/item/card/id/I, var/obj/item/ID_container)
/obj/machinery/lapvend/proc/process_payment(mob/user, obj/item/card/id/I, obj/item/ID_container)
if(I==ID_container || ID_container == null)
visible_message(span_info("\The [user] swipes \the [I] through \the [src]."))
else