Merge pull request #10456 from datlo/photocopierfix

Add global cap on printing papers
This commit is contained in:
variableundefined
2018-12-18 16:36:19 +08:00
committed by GitHub
2 changed files with 17 additions and 2 deletions
+6 -1
View File
@@ -78,4 +78,9 @@ GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the hos
// However it'd be ok to use for accessing attack logs and such too, which are even laggier.
var/fileaccess_timer = 0
GLOBAL_VAR_INIT(gametime_offset, 432000) // 12:00 in seconds
GLOBAL_VAR_INIT(gametime_offset, 432000) // 12:00 in seconds
//printers shutdown if too much shit printed
var/copier_items_printed = 0
var/copier_max_items = 300
var/copier_items_printed_logged = FALSE
+11 -1
View File
@@ -62,6 +62,16 @@
if(toner <= 0)
break
if(copier_items_printed >= copier_max_items) //global vars defined in misc.dm
if(prob(10))
visible_message("<span class='warning'>The printer screen reads \"PC LOAD LETTER\".</span>")
else
visible_message("<span class='warning'>The printer screen reads \"PHOTOCOPIER NETWORK OFFLINE, PLEASE CONTACT SYSTEM ADMINISTRATOR\".</span>")
if(!copier_items_printed_logged)
message_admins("Photocopier cap of [copier_max_items] papers reached, all photocopiers are now disabled. This may be the cause of any lag.")
copier_items_printed_logged = TRUE
break
if(emag_cooldown > world.time)
return
@@ -86,7 +96,7 @@
else
to_chat(usr, "<span class='warning'>\The [copyitem] can't be copied by \the [src].</span>")
break
copier_items_printed++
use_power(active_power_usage)
updateUsrDialog()
else if(href_list["remove"])