mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 18:13:34 +01:00
-Killed the updateDialog lag. I added a check to see if there were any mobs to update, if not it will stop checking until a user uses the machine again. I had to replace all the machine = src and machine = null with procs to help make it manageable. I believe this is one of the culprits causing the server to lag as the round goes on, as more players will interact with machines.
-Atmos delay is now based on active players, to help fight lag for massive player rounds. -Changed some for(blah in world) loops to use the correct lists. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4958 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -233,7 +233,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
//NOTE: graphic resources are loaded on client login
|
||||
/obj/item/device/pda/attack_self(mob/user as mob)
|
||||
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
|
||||
if(active_uplink_check(user))
|
||||
return
|
||||
@@ -438,14 +438,14 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
if ( !(U.stat || U.restrained()) )
|
||||
|
||||
add_fingerprint(U)
|
||||
U.machine = src
|
||||
U.set_machine(src)
|
||||
|
||||
switch(href_list["choice"])
|
||||
|
||||
//BASIC FUNCTIONS===================================
|
||||
|
||||
if("Close")//Self explanatory
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
if("Refresh")//Refresh, goes to the end of the proc.
|
||||
@@ -635,7 +635,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
else
|
||||
U << "PDA not found."
|
||||
else
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
@@ -656,11 +656,11 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
cartridge.mode = mode
|
||||
cartridge.unlock()
|
||||
else//If can't interact.
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
else//If not in range or not using the pda.
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
@@ -676,7 +676,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
if(U.machine == src && href_list["skiprefresh"]!="1")//Final safety.
|
||||
attack_self(U)//It auto-closes the menu prior if the user is not in range and so on.
|
||||
else
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
|
||||
@@ -641,7 +641,7 @@ Code:
|
||||
..()
|
||||
|
||||
if (!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
usr.machine = null
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=pda")
|
||||
return
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
attack_self(mob/user)
|
||||
if (!in_range(src, user))
|
||||
return
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = "<TT><B>Intelicard</B><BR>"
|
||||
var/laws
|
||||
for(var/mob/living/silicon/ai/A in src)
|
||||
@@ -82,16 +82,16 @@
|
||||
var/mob/U = usr
|
||||
if (!in_range(src, U)||U.machine!=src)//If they are not in range of 1 or less or their machine is not the card (ie, clicked on something else).
|
||||
U << browse(null, "window=aicard")
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
return
|
||||
|
||||
add_fingerprint(U)
|
||||
U.machine = src
|
||||
U.set_machine(src)
|
||||
|
||||
switch(href_list["choice"])//Now we switch based on choice.
|
||||
if ("Close")
|
||||
U << browse(null, "window=aicard")
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
return
|
||||
|
||||
if ("Wipe")
|
||||
@@ -99,7 +99,7 @@
|
||||
if(confirm == "Yes")
|
||||
if(isnull(src)||!in_range(src, U)||U.machine!=src)
|
||||
U << browse(null, "window=aicard")
|
||||
U.machine = null
|
||||
U.unset_machine()
|
||||
return
|
||||
else
|
||||
flush = 1
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
/obj/item/device/paicard/attack_self(mob/user)
|
||||
if (!in_range(src, user))
|
||||
return
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = "<TT><B>Personal AI Device</B><BR>"
|
||||
if(pai && (!pai.master_dna || !pai.master))
|
||||
dat += "<a href='byond://?src=\ref[src];setdna=1'>Imprint Master DNA</a><br>"
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
if(((istype(usr, /mob/living/carbon/human) && ((!( ticker ) || (ticker && ticker.mode != "monkey")) && usr.contents.Find(src))) || (usr.contents.Find(master) || (in_range(src, usr) && istype(loc, /turf)))))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if(href_list["freq"])
|
||||
var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"]))
|
||||
set_frequency(new_frequency)
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
if(!istype(user, /mob/living/carbon/human))
|
||||
return
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = {"<TT>
|
||||
<A href='?src=\ref[src];power=1'>Turn [on ? "Off" : "On"]</A><BR>
|
||||
<B>Frequency/Code</B> for electropack:<BR>
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
// ..()
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
|
||||
return
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
|
||||
/obj/item/device/radio/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/item/device/radio/proc/interact(mob/user as mob)
|
||||
@@ -129,7 +129,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
if (!(issilicon(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
@@ -643,7 +643,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) ))
|
||||
return
|
||||
b_stat = !( b_stat )
|
||||
@@ -675,7 +675,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
// ..()
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
|
||||
return
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
|
||||
/obj/item/device/transfer_valve/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = {"<B> Valve properties: </B>
|
||||
<BR> <B> Attachment one:</B> [tank_one] [tank_one ? "<A href='?src=\ref[src];tankone=1'>Remove</A>" : ""]
|
||||
<BR> <B> Attachment two:</B> [tank_two] [tank_two ? "<A href='?src=\ref[src];tanktwo=1'>Remove</A>" : ""]
|
||||
|
||||
@@ -314,7 +314,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid
|
||||
return 0
|
||||
|
||||
if ((usr.contents.Find(src.loc) || (in_range(src.loc, usr) && istype(src.loc.loc, /turf))))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if(href_list["lock"])
|
||||
toggle()
|
||||
usr << browse(null, "window=hidden")
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
|
||||
/obj/item/device/violin/attack_self(mob/user as mob)
|
||||
if(!isliving(user) || user.stat || user.restrained() || user.lying) return
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<HEAD><TITLE>Violin</TITLE></HEAD><BODY>"
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
return
|
||||
if (!src || amount<=0)
|
||||
user << browse(null, "window=stack")
|
||||
user.machine = src //for correct work of onclose
|
||||
user.set_machine(src) //for correct work of onclose
|
||||
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
|
||||
for(var/i=1;i<=recipes.len,i++)
|
||||
var/datum/stack_recipe/R = recipes[i]
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if (usr.contents.Find(src))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if (href_list["remove"])
|
||||
var/obj/item/P = locate(href_list["remove"])
|
||||
if ((P && P.loc == src))
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
/obj/item/weapon/flamethrower/attack_self(mob/user as mob)
|
||||
if(user.stat || user.restrained() || user.lying) return
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
if(!ptank)
|
||||
user << "<span class='notice'>Attach a plasma tank first!</span>"
|
||||
return
|
||||
@@ -148,11 +148,11 @@
|
||||
|
||||
/obj/item/weapon/flamethrower/Topic(href,href_list[])
|
||||
if(href_list["close"])
|
||||
usr.machine = null
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=flamethrower")
|
||||
return
|
||||
if(usr.stat || usr.restrained() || usr.lying) return
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if(href_list["light"])
|
||||
if(!ptank) return
|
||||
if(ptank.air_contents.toxins < 1) return
|
||||
@@ -168,7 +168,7 @@
|
||||
usr.put_in_hands(ptank)
|
||||
ptank = null
|
||||
lit = 0
|
||||
usr.machine = null
|
||||
usr.unset_machine()
|
||||
usr << browse(null, "window=flamethrower")
|
||||
for(var/mob/M in viewers(1, loc))
|
||||
if((M.client && M.machine == src))
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/health_text = ""
|
||||
if(src.occupant)
|
||||
if(src.occupant.health <= -100)
|
||||
@@ -48,7 +48,7 @@
|
||||
dat += "<B>Implants:</B> [src.implant_list.len ? "[implant_list.len]" : "<A href='?src=\ref[src];replenish=1'>Replenish</A>"]<BR>"
|
||||
if(src.occupant)
|
||||
dat += "[src.ready ? "<A href='?src=\ref[src];implant=1'>Implant</A>" : "Recharging"]<BR>"
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
user << browse(dat, "window=implant")
|
||||
onclose(user, "implant")
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = "<B>Implant Mini-Computer:</B><HR>"
|
||||
if (src.case)
|
||||
if(src.case.imp)
|
||||
@@ -83,7 +83,7 @@
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((usr.contents.Find(src)) || ((in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if (href_list["tracking_id"])
|
||||
var/obj/item/weapon/implant/tracking/T = src.case.imp
|
||||
T.id += text2num(href_list["tracking_id"])
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
origin_tech = "bluespace=4"
|
||||
|
||||
/obj/item/weapon/teleportation_scroll/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = "<B>Teleportation Scroll:</B><BR>"
|
||||
dat += "Number of uses: [src.uses]<BR>"
|
||||
dat += "<HR>"
|
||||
@@ -31,7 +31,7 @@
|
||||
if (!( istype(H, /mob/living/carbon/human)))
|
||||
return 1
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if (href_list["spell_teleport"])
|
||||
if (src.uses >= 1)
|
||||
src.uses -= 1
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/secstorage/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat = text("<TT><B>[]</B><BR>\n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
|
||||
var/message = "Code"
|
||||
if ((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
/obj/item/weapon/tank/attack_self(mob/user as mob)
|
||||
if (!(src.air_contents))
|
||||
return
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
|
||||
var/using_internal
|
||||
if(istype(loc,/mob/living/carbon))
|
||||
@@ -142,7 +142,7 @@
|
||||
if (usr.stat|| usr.restrained())
|
||||
return
|
||||
if (src.loc == usr)
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if (href_list["dist_p"])
|
||||
var/cp = text2num(href_list["dist_p"])
|
||||
src.distribute_pressure += cp
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Locator
|
||||
*/
|
||||
/obj/item/weapon/locator/attack_self(mob/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
|
||||
@@ -35,7 +35,7 @@ Frequency:
|
||||
usr << "The [src] is malfunctioning."
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
if (href_list["refresh"])
|
||||
src.temp = "<B>Persistent Signal Locator</B><HR>"
|
||||
var/turf/sr = get_turf(src)
|
||||
|
||||
Reference in New Issue
Block a user