Skip to content

Commit

Permalink
bugfix: Fixing Runtime Popup (ss220-space#5501)
Browse files Browse the repository at this point in the history
* Fixing Runtime Popup

* Try1

* try2

* fix4

* fix5

* Fix6

* Fix7
  • Loading branch information
Gottfrei authored Jul 18, 2024
1 parent 9de0d84 commit 1b244e9
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 153 deletions.
9 changes: 0 additions & 9 deletions code/__DEFINES/error_handler.dm

This file was deleted.

25 changes: 13 additions & 12 deletions code/game/objects/items/weapons/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@

var/obj/item/card/id/guest/guest_pass = null // Guest pass attached to the ID

/obj/item/card/id/New()
..()
/obj/item/card/id/Initialize(mapload)
. = ..()
spawn(30)
if(ishuman(loc) && blood_type == "\[UNSET\]")
var/mob/living/carbon/human/H = loc
Expand Down Expand Up @@ -391,9 +391,9 @@
/obj/item/card/id/syndicate/anyone
anyone = TRUE

/obj/item/card/id/syndicate/New()
/obj/item/card/id/syndicate/Initialize(mapload)
access = initial_access.Copy()
..()
. = ..()
save_slots.len = num_of_save_slots
for(var/i = 1 to num_of_save_slots)
save_slots[i] = list()
Expand Down Expand Up @@ -814,10 +814,10 @@
registered_name = "Captain"
assignment = JOB_TITLE_CAPTAIN

/obj/item/card/id/captains_spare/New()
/obj/item/card/id/captains_spare/Initialize(mapload)
var/datum/job/captain/J = new/datum/job/captain
access = J.get_access()
..()
. = ..()

/obj/item/card/id/admin
name = "admin ID card"
Expand All @@ -827,9 +827,9 @@
assignment = "Testing Shit"
untrackable = 1

/obj/item/card/id/admin/New()
/obj/item/card/id/admin/Initialize(mapload)
access = get_absolutely_all_accesses()
..()
. = ..()

/obj/item/card/id/centcom
name = "central command ID card"
Expand All @@ -839,9 +839,9 @@
registered_name = "Central Command"
assignment = "General"

/obj/item/card/id/centcom/New()
/obj/item/card/id/centcom/Initialize(mapload)
access = get_all_centcom_access()
..()
. = ..()

/obj/item/card/id/nanotrasen
name = "nanotrasen ID card"
Expand Down Expand Up @@ -890,8 +890,9 @@
registered_name = "Prisoner #13-007"

/obj/item/card/id/prisoner/random
/obj/item/card/id/prisoner/random/New()
..()

/obj/item/card/id/prisoner/random/Initialize(mapload)
. = ..()
var/random_number = "#[rand(0, 99)]-[rand(0, 999)]"
name = "Prisoner [random_number]"
registered_name = name
Expand Down
9 changes: 5 additions & 4 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3580,14 +3580,15 @@
return 1

else if(href_list["viewruntime"])
var/datum/ErrorViewer/error_viewer = locateUID(href_list["viewruntime"])
var/datum/error_viewer/error_viewer = locate(href_list["viewruntime"])
if(!istype(error_viewer))
to_chat(usr, "<span class='warning'>That runtime viewer no longer exists.</span>")
to_chat(usr, span_warning("That runtime viewer no longer exists."))
return

if(href_list["viewruntime_backto"])
error_viewer.showTo(usr, locateUID(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
error_viewer.show_to(usr, locateUID(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
else
error_viewer.showTo(usr, null, href_list["viewruntime_linear"])
error_viewer.show_to(usr, null, href_list["viewruntime_linear"])

else if(href_list["add_station_goal"])
if(!check_rights(R_EVENT))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
if(!check_rights(R_DEBUG|R_VIEWRUNTIMES))
return

GLOB.error_cache.showTo(usr)
GLOB.error_cache.show_to(usr)

/client/proc/jump_to_ruin()
set category = "Debug"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/error_handler/error_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
var/static/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error)
If negative, starts at -1, and goes down by 1 each time that error gets skipped*/

if(!error_last_seen) // A runtime is occurring too early in start-up initialization
if(!stack_workaround) // A runtime is occurring too early in start-up initialization
return ..()

if(stack_workaround.Find(E.name))
Expand Down Expand Up @@ -80,7 +80,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
error_cooldown[erroruid] = 0
if(skipcount > 0)
log_world("\[[time_stamp()]] Skipped [skipcount] runtimes in [E.file],[E.line].")
GLOB.error_cache.logError(E, skipCount = skipcount)
GLOB.error_cache.log_error(E, skip_count = skipcount)

error_last_seen[erroruid] = world.time
error_cooldown[erroruid] = cooldown
Expand Down Expand Up @@ -138,7 +138,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
log_world(line)
log_runtime_txt(line)
if(GLOB.error_cache)
GLOB.error_cache.logError(E, desclines, e_src = e_src)
GLOB.error_cache.log_error(E, desclines, e_src = e_src)

#undef ERROR_USEFUL_LEN
#endif
Expand Down
Loading

0 comments on commit 1b244e9

Please sign in to comment.