mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 07:27:57 +01:00
TG:
Removes poo. XSI and co. weren't very fond of it, and the last thing I would do is make them uncomfortable and challenge their leadership by keeping poo in. An experimental lagfix, which removes a couple THOUSAND unnecessary machines from the machine processing list. Please report any unresponsive machinery (as result of this commit) as HIGH PRIORITY issues. I'm not quite sure how much lag this will kill, but I'm confident that it will be at least slightly noticeable. More work on step_triggers. The escape shuttle should no longer blast things forever and give them infinite momentum. Runtimes goin down for the count Lookin at the ground I think they a hater Revision: r3370 r3371 Author: vageyenaman quartz235
This commit is contained in:
@@ -530,6 +530,7 @@
|
||||
#include "code\game\machinery\computer\aifixer.dm"
|
||||
#include "code\game\machinery\computer\arcade.dm"
|
||||
#include "code\game\machinery\computer\atmos.dm"
|
||||
#include "code\game\machinery\computer\atmos_alert.dm"
|
||||
#include "code\game\machinery\computer\buildandrepair.dm"
|
||||
#include "code\game\machinery\computer\camera_monitor.dm"
|
||||
#include "code\game\machinery\computer\cloning.dm"
|
||||
|
||||
@@ -25,7 +25,6 @@ obj/machinery/atmospherics
|
||||
|
||||
process()
|
||||
build_network()
|
||||
..()
|
||||
|
||||
proc
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
|
||||
@@ -30,15 +30,6 @@
|
||||
var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list())
|
||||
|
||||
|
||||
/obj/machinery/computer/atmos_alert
|
||||
name = "Atmospheric Alert Computer"
|
||||
desc = "Used to access the station's atmospheric sensors."
|
||||
icon_state = "alert:0"
|
||||
var/list/priority_alarms = list()
|
||||
var/list/minor_alarms = list()
|
||||
var/receive_frequency = 1437
|
||||
|
||||
|
||||
/obj/machinery/computer/atmosphere
|
||||
name = "atmos"
|
||||
desc = "A computer for Atmospherics."
|
||||
|
||||
@@ -266,7 +266,12 @@
|
||||
var/list/textList = new()
|
||||
var/searchPosition = 1
|
||||
var/findPosition = 1
|
||||
var/loops = 0
|
||||
while(1)
|
||||
if(loops >= 1000)
|
||||
break
|
||||
loops++
|
||||
|
||||
findPosition = findtext(text, separator, searchPosition, 0)
|
||||
var/buggyText = copytext(text, searchPosition, findPosition)
|
||||
if(!withinList || (buggyText in withinList)) textList += "[buggyText]"
|
||||
@@ -654,7 +659,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
total = rand(1, total)
|
||||
for (item in L)
|
||||
total -= L[item]
|
||||
total -=L [item]
|
||||
if (total <= 0)
|
||||
return item
|
||||
|
||||
@@ -819,9 +824,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
var/list/creatures = list()
|
||||
var/list/namecounts = list()
|
||||
for(var/mob/M in mobs)
|
||||
/*if((!M.name || !M.real_name) && !istype(M, /mob/new_player))
|
||||
var/turf/T = get_turf(M)
|
||||
message_admins("Alert! The mob with the key [M.key ? M.key : "NO KEY"] at ([T.x], [T.y], [T.z]) has no name!")*/
|
||||
var/name = M.name
|
||||
if (name in names)
|
||||
namecounts[name]++
|
||||
@@ -1008,8 +1010,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
output += A
|
||||
return output
|
||||
|
||||
// Returns the turf a movable atom (obj or mob) is on
|
||||
/proc/get_turf_loc(var/atom/movable/M)
|
||||
/proc/get_turf_loc(var/atom/movable/M) //gets the location of the turf that the atom is on, or what the atom is in is on, etc
|
||||
//in case they're in a closet or sleeper or something
|
||||
var/atom/loc = M.loc
|
||||
while(!istype(loc, /turf/))
|
||||
loc = loc.loc
|
||||
@@ -1020,6 +1022,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/get_edge_target_turf(var/atom/A, var/direction)
|
||||
|
||||
var/turf/target = locate(A.x, A.y, A.z)
|
||||
if(!A || !target)
|
||||
return 0
|
||||
//since NORTHEAST == NORTH & EAST, etc, doing it this way allows for diagonal mass drivers in the future
|
||||
//and isn't really any more complicated
|
||||
|
||||
@@ -1306,13 +1310,16 @@ proc/listclearnulls(list/list)
|
||||
var/target_loc = target.loc
|
||||
var/holding = user.equipped()
|
||||
sleep(time)
|
||||
if(!user || !target) return 0
|
||||
if ( user.loc == user_loc && target.loc == target_loc && user.equipped() == holding && !( user.stat ) && ( !user.stunned && !user.weakened && !user.paralysis && !user.lying ) )
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/*
|
||||
/proc/do_after(mob/M as mob, time as num)
|
||||
var/turf/T = get_turf(M)
|
||||
if(!M)
|
||||
return 0
|
||||
var/turf/T = M.loc
|
||||
var/holding = M.equipped()
|
||||
for(var/i=0, i<time)
|
||||
if(M)
|
||||
@@ -1322,6 +1329,24 @@ proc/listclearnulls(list/list)
|
||||
else
|
||||
return 0
|
||||
return 1
|
||||
*/
|
||||
|
||||
/proc/do_after(var/mob/user as mob, delay as num, var/numticks = 5) // Replacing the upper one with this one because Byond keeps feeling that the upper one is an infinate loop
|
||||
if(!user || isnull(user)) // This one should have less temptation
|
||||
return 0
|
||||
if(numticks == 0)
|
||||
return 0
|
||||
|
||||
var/delayfraction = round(delay/numticks)
|
||||
var/turf/T = user.loc
|
||||
var/holding = user.equipped()
|
||||
|
||||
for(var/i = 0, i<numticks, i++)
|
||||
sleep(delayfraction)
|
||||
if(!user || user.stat || user.weakened || user.stunned || !(user.loc == T) || !(user.equipped() == holding))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/proc/hasvar(var/datum/A, var/varname)
|
||||
//Takes: Anything that could possibly have variables and a varname to check.
|
||||
|
||||
+3
-2
@@ -166,16 +166,17 @@
|
||||
/////////////////////////// DNA HELPER-PROCS
|
||||
/proc/getleftblocks(input,blocknumber,blocksize)
|
||||
var/string
|
||||
string = copytext(input,1,((blocksize*blocknumber)-(blocksize-1)))
|
||||
|
||||
if (blocknumber > 1)
|
||||
string = copytext(input,1,((blocksize*blocknumber)-(blocksize-1)))
|
||||
return string
|
||||
else
|
||||
return null
|
||||
|
||||
/proc/getrightblocks(input,blocknumber,blocksize)
|
||||
var/string
|
||||
string = copytext(input,blocksize*blocknumber+1)
|
||||
if (blocknumber < (length(input)/blocksize))
|
||||
string = copytext(input,blocksize*blocknumber+1,length(input)+1)
|
||||
return string
|
||||
else
|
||||
return null
|
||||
|
||||
@@ -93,7 +93,6 @@ obj/machinery/computer/general_air_control
|
||||
|
||||
process()
|
||||
..()
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
attackby(I as obj, user as mob)
|
||||
@@ -442,94 +441,6 @@ Rate: [volume_rate] L/sec<BR>"}
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/computer/atmos_alert
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/computer/atmos_alert/initialize()
|
||||
set_frequency(receive_frequency)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
|
||||
if(!zone || !severity) return
|
||||
|
||||
minor_alarms -= zone
|
||||
priority_alarms -= zone
|
||||
if(severity=="severe")
|
||||
priority_alarms += zone
|
||||
else if (severity=="minor")
|
||||
minor_alarms += zone
|
||||
/*else "clear"*/
|
||||
//do nothing
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, receive_frequency)
|
||||
receive_frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, receive_frequency, RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/attack_hand(mob/user)
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.machine = src
|
||||
onclose(user, "computer")
|
||||
|
||||
/obj/machinery/computer/atmos_alert/process()
|
||||
..()
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/update_icon()
|
||||
if(priority_alarms.len)
|
||||
icon_state = "alert:2"
|
||||
|
||||
else if(minor_alarms.len)
|
||||
icon_state = "alert:1"
|
||||
|
||||
else
|
||||
icon_state = "alert:0"
|
||||
|
||||
/obj/machinery/computer/atmos_alert/proc/return_text()
|
||||
var/priority_text
|
||||
var/minor_text
|
||||
|
||||
if(priority_alarms.len)
|
||||
for(var/zone in priority_alarms)
|
||||
priority_text += "<FONT color='red'><B>[zone]</B></FONT> <A href='?src=\ref[src];priority_clear=[ckey(zone)]'>X</A><BR>"
|
||||
else
|
||||
priority_text = "No priority alerts detected.<BR>"
|
||||
|
||||
if(minor_alarms.len)
|
||||
for(var/zone in minor_alarms)
|
||||
minor_text += "<B>[zone]</B> <A href='?src=\ref[src];minor_clear=[ckey(zone)]'>X</A><BR>"
|
||||
else
|
||||
minor_text = "No minor alerts detected.<BR>"
|
||||
|
||||
var/output = {"<B>[name]</B><HR>
|
||||
<B>Priority Alerts:</B><BR>
|
||||
[priority_text]
|
||||
<BR>
|
||||
<HR>
|
||||
<B>Minor Alerts:</B><BR>
|
||||
[minor_text]
|
||||
<BR>"}
|
||||
|
||||
return output
|
||||
|
||||
/obj/machinery/computer/atmos_alert/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["priority_clear"])
|
||||
var/removing_zone = href_list["priority_clear"]
|
||||
for(var/zone in priority_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
priority_alarms -= zone
|
||||
|
||||
if(href_list["minor_clear"])
|
||||
var/removing_zone = href_list["minor_clear"]
|
||||
for(var/zone in minor_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
minor_alarms -= zone
|
||||
update_icon()
|
||||
@@ -10,7 +10,6 @@
|
||||
var/volume_rate = 800
|
||||
|
||||
/obj/machinery/zvent/process()
|
||||
..()
|
||||
|
||||
//all this object does, is make its turf share air with the ones above and below it, if they have a vent too.
|
||||
if (istype(loc,/turf/simulated)) //if we're not on a valid turf, forget it
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
|
||||
/obj/machinery/computer/atmos_alert
|
||||
name = "Atmospheric Alert Computer"
|
||||
desc = "Used to access the station's atmospheric sensors."
|
||||
icon_state = "alert:0"
|
||||
var
|
||||
list/priority_alarms = list()
|
||||
list/minor_alarms = list()
|
||||
receive_frequency = 1437
|
||||
datum/radio_frequency/radio_connection
|
||||
|
||||
|
||||
initialize()
|
||||
set_frequency(receive_frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
|
||||
if(!zone || !severity) return
|
||||
|
||||
minor_alarms -= zone
|
||||
priority_alarms -= zone
|
||||
if(severity=="severe")
|
||||
priority_alarms += zone
|
||||
else if (severity=="minor")
|
||||
minor_alarms += zone
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, receive_frequency)
|
||||
receive_frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, receive_frequency, RADIO_ATMOSIA)
|
||||
|
||||
|
||||
attack_hand(mob/user)
|
||||
user << browse(return_text(),"window=computer")
|
||||
user.machine = src
|
||||
onclose(user, "computer")
|
||||
|
||||
process()
|
||||
..()
|
||||
src.updateDialog()
|
||||
|
||||
update_icon()
|
||||
if(priority_alarms.len)
|
||||
icon_state = "alert:2"
|
||||
|
||||
else if(minor_alarms.len)
|
||||
icon_state = "alert:1"
|
||||
|
||||
else
|
||||
icon_state = "alert:0"
|
||||
return
|
||||
|
||||
|
||||
proc/return_text()
|
||||
var/priority_text
|
||||
var/minor_text
|
||||
|
||||
if(priority_alarms.len)
|
||||
for(var/zone in priority_alarms)
|
||||
priority_text += "<FONT color='red'><B>[zone]</B></FONT> <A href='?src=\ref[src];priority_clear=[ckey(zone)]'>X</A><BR>"
|
||||
else
|
||||
priority_text = "No priority alerts detected.<BR>"
|
||||
|
||||
if(minor_alarms.len)
|
||||
for(var/zone in minor_alarms)
|
||||
minor_text += "<B>[zone]</B> <A href='?src=\ref[src];minor_clear=[ckey(zone)]'>X</A><BR>"
|
||||
else
|
||||
minor_text = "No minor alerts detected.<BR>"
|
||||
|
||||
var/output = {"<B>[name]</B><HR>
|
||||
<B>Priority Alerts:</B><BR>
|
||||
[priority_text]
|
||||
<BR>
|
||||
<HR>
|
||||
<B>Minor Alerts:</B><BR>
|
||||
[minor_text]
|
||||
<BR>"}
|
||||
|
||||
return output
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["priority_clear"])
|
||||
var/removing_zone = href_list["priority_clear"]
|
||||
for(var/zone in priority_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
priority_alarms -= zone
|
||||
|
||||
if(href_list["minor_clear"])
|
||||
var/removing_zone = href_list["minor_clear"]
|
||||
for(var/zone in minor_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
minor_alarms -= zone
|
||||
update_icon()
|
||||
return
|
||||
@@ -62,7 +62,6 @@ obj/machinery/embedded_controller
|
||||
|
||||
update_icon()
|
||||
src.updateDialog()
|
||||
..()
|
||||
|
||||
radio
|
||||
var/frequency
|
||||
|
||||
@@ -100,7 +100,16 @@ Class Procs:
|
||||
..()
|
||||
|
||||
/obj/machinery/process()//If you dont use process or power why are you here
|
||||
// machines.Remove(src)Not going to do this till I test it a bit more
|
||||
|
||||
/*
|
||||
Big note: if do not call ..() in any machinery subtype process() call or it will
|
||||
be removed from the list of machines to iterate. It is, however, okay to call ..()
|
||||
if the machine has a parent process() call. For instance, machinery/atmosphereics has a
|
||||
root process() call, so things like cryocells can call ..() and not worry about
|
||||
it getting removed from machines.
|
||||
*/
|
||||
|
||||
machines.Remove(src) // uncommented by Doohl
|
||||
return
|
||||
|
||||
/obj/machinery/emp_act(severity)
|
||||
|
||||
@@ -129,7 +129,6 @@
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
on = 0
|
||||
|
||||
@@ -238,7 +237,6 @@
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
if(magnets.len == 0 && autolink)
|
||||
for(var/obj/machinery/magnetic_module/M in world)
|
||||
if(M.freq == frequency && M.code == code)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
build_icon()
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!(NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
@@ -140,8 +139,9 @@
|
||||
//Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO
|
||||
return
|
||||
usr.pulling = null
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
if(usr && usr.client)
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
/*for(var/obj/O in src)
|
||||
|
||||
@@ -519,7 +519,7 @@ Code:
|
||||
if (ml.z != cl.z)
|
||||
continue
|
||||
|
||||
ldat += "Mop - <b>\[[ml.x],[ml.y]\]</b> - [M.reagents.total_volume ? "Wet" : "Dry"]<br>"
|
||||
ldat += "Mop - <b>\[[ml.x],[ml.y]\]</b> - [M.reagents.total_volume ? "Wet" : "Dry"]<br>"
|
||||
|
||||
if (!ldat)
|
||||
menu += "None"
|
||||
@@ -532,10 +532,11 @@ Code:
|
||||
for (var/obj/structure/mopbucket/B in world)
|
||||
var/turf/bl = get_turf(B)
|
||||
|
||||
if (bl.z != cl.z)
|
||||
continue
|
||||
if(bl)
|
||||
if (bl.z != cl.z)
|
||||
continue
|
||||
|
||||
ldat += "Bucket - <b>\[[bl.x],[bl.y]\]</b> - Water level: [B.reagents.total_volume]/100<br>"
|
||||
ldat += "Bucket - <b>\[[bl.x],[bl.y]\]</b> - Water level: [B.reagents.total_volume]/100<br>"
|
||||
|
||||
if (!ldat)
|
||||
menu += "None"
|
||||
@@ -548,10 +549,11 @@ Code:
|
||||
for (var/obj/machinery/bot/cleanbot/B in world)
|
||||
var/turf/bl = get_turf(B)
|
||||
|
||||
if (bl.z != cl.z)
|
||||
continue
|
||||
if(bl)
|
||||
if (bl.z != cl.z)
|
||||
continue
|
||||
|
||||
ldat += "Cleanbot - <b>\[[bl.x],[bl.y]\]</b> - [B.on ? "Online" : "Offline"]<br>"
|
||||
ldat += "Cleanbot - <b>\[[bl.x],[bl.y]\]</b> - [B.on ? "Online" : "Offline"]<br>"
|
||||
|
||||
if (!ldat)
|
||||
menu += "None"
|
||||
|
||||
@@ -93,7 +93,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
|
||||
|
||||
switch(target_zone)
|
||||
if(1)
|
||||
if(isobj(H.head))
|
||||
if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper))
|
||||
Cl = H.head
|
||||
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
|
||||
// world << "Head pass [passed]"
|
||||
@@ -191,4 +191,4 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
|
||||
if(prob(5))
|
||||
v.carrier = 1
|
||||
return
|
||||
return
|
||||
return
|
||||
|
||||
@@ -190,7 +190,8 @@
|
||||
O.invisibility = 0
|
||||
O.name = "Cyborg"
|
||||
O.real_name = "Cyborg"
|
||||
O.lastKnownIP = client.address ? client.address : null
|
||||
if(client)
|
||||
O.lastKnownIP = client.address ? client.address : null
|
||||
if (mind)
|
||||
mind.transfer_to(O)
|
||||
if (mind.assigned_role == "Cyborg")
|
||||
|
||||
Reference in New Issue
Block a user