Fixes some runtimes (hopefully)

This commit is contained in:
Casey
2022-07-19 19:42:03 -04:00
committed by CHOMPStation2
parent 6bec21215a
commit 5e2328eba5
5 changed files with 35 additions and 20 deletions

View File

@@ -19,7 +19,7 @@
/obj/screen/Destroy() /obj/screen/Destroy()
master = null master = null
return ..() return ..()
/obj/screen/proc/component_click(obj/screen/component_button/component, params) /obj/screen/proc/component_click(obj/screen/component_button/component, params)
return return
@@ -46,9 +46,8 @@
object_overlays.Cut() object_overlays.Cut()
/obj/screen/inventory/proc/add_overlays() /obj/screen/inventory/proc/add_overlays()
var/mob/user = hud.mymob if(hud && hud.mymob && slot_id)
var/mob/user = hud.mymob
if(hud && user && slot_id)
var/obj/item/holding = user.get_active_hand() var/obj/item/holding = user.get_active_hand()
if(!holding || user.get_equipped_item(slot_id)) if(!holding || user.get_equipped_item(slot_id))
@@ -619,7 +618,7 @@
var/mob/living/carbon/C = hud.mymob var/mob/living/carbon/C = hud.mymob
if(C.handcuffed) if(C.handcuffed)
add_overlay(handcuff_overlay) add_overlay(handcuff_overlay)
// PIP stuff // PIP stuff
/obj/screen/component_button /obj/screen/component_button
var/obj/screen/parent var/obj/screen/parent
@@ -634,7 +633,7 @@
// Character setup stuff // Character setup stuff
/obj/screen/setup_preview /obj/screen/setup_preview
var/datum/preferences/pref var/datum/preferences/pref
/obj/screen/setup_preview/Destroy() /obj/screen/setup_preview/Destroy()
@@ -704,7 +703,7 @@
* size of the screen. This is not ideal, as filter() is faster, and has * size of the screen. This is not ideal, as filter() is faster, and has
* alpha masks, but the alpha masks it has can't be animated, so the 'ping' * alpha masks, but the alpha masks it has can't be animated, so the 'ping'
* mode of this device isn't possible using that technique. * mode of this device isn't possible using that technique.
* *
* The markers use that technique, though, so at least there's that. * The markers use that technique, though, so at least there's that.
*/ */
/obj/screen/movable/mapper_holder /obj/screen/movable/mapper_holder
@@ -722,7 +721,7 @@
var/obj/screen/mapper/mask_full/mask_full var/obj/screen/mapper/mask_full/mask_full
var/obj/screen/mapper/mask_ping/mask_ping var/obj/screen/mapper/mask_ping/mask_ping
var/obj/screen/mapper/bg/bg var/obj/screen/mapper/bg/bg
var/obj/screen/mapper/frame/frame var/obj/screen/mapper/frame/frame
var/obj/screen/mapper/powbutton/powbutton var/obj/screen/mapper/powbutton/powbutton
var/obj/screen/mapper/mapbutton/mapbutton var/obj/screen/mapper/mapbutton/mapbutton
@@ -732,7 +731,7 @@
/obj/screen/movable/mapper_holder/Initialize(mapload, newowner) /obj/screen/movable/mapper_holder/Initialize(mapload, newowner)
owner = newowner owner = newowner
mask_full = new(src) // Full white square mask mask_full = new(src) // Full white square mask
mask_ping = new(src) // Animated 'pinging' mask mask_ping = new(src) // Animated 'pinging' mask
bg = new(src) // Background color, holds map in vis_contents, uses mult against masks bg = new(src) // Background color, holds map in vis_contents, uses mult against masks
@@ -740,19 +739,19 @@
frame = new(src) // Decorative frame frame = new(src) // Decorative frame
powbutton = new(src) // Clickable button powbutton = new(src) // Clickable button
mapbutton = new(src) // Clickable button mapbutton = new(src) // Clickable button
frame.icon_state = initial(frame.icon_state)+owner.hud_frame_hint frame.icon_state = initial(frame.icon_state)+owner.hud_frame_hint
/** /**
* The vis_contents layout is: this(frame,extras_holder,mask(bg(map))) * The vis_contents layout is: this(frame,extras_holder,mask(bg(map)))
* bg is set to BLEND_MULTIPLY against the mask to crop it. * bg is set to BLEND_MULTIPLY against the mask to crop it.
*/ */
mask_full.vis_contents.Add(bg) mask_full.vis_contents.Add(bg)
mask_ping.vis_contents.Add(bg) mask_ping.vis_contents.Add(bg)
frame.vis_contents.Add(powbutton,mapbutton) frame.vis_contents.Add(powbutton,mapbutton)
vis_contents.Add(frame) vis_contents.Add(frame)
/obj/screen/movable/mapper_holder/Destroy() /obj/screen/movable/mapper_holder/Destroy()
qdel_null(mask_full) qdel_null(mask_full)
@@ -772,12 +771,12 @@
running = TRUE running = TRUE
if(ping) if(ping)
vis_contents.Add(mask_ping) vis_contents.Add(mask_ping)
else else
vis_contents.Add(mask_full) vis_contents.Add(mask_full)
bg.vis_contents.Cut() bg.vis_contents.Cut()
bg.vis_contents.Add(map) bg.vis_contents.Add(map)
if(extras && !extras_holder) if(extras && !extras_holder)
extras_holder = extras extras_holder = extras
vis_contents += extras_holder vis_contents += extras_holder
@@ -790,7 +789,7 @@
off() off()
else else
on() on()
/obj/screen/movable/mapper_holder/proc/mapClick() /obj/screen/movable/mapper_holder/proc/mapClick()
if(owner) if(owner)
if(running) if(running)
@@ -818,7 +817,7 @@
mouse_opacity = 0 mouse_opacity = 0
var/obj/screen/movable/mapper_holder/parent var/obj/screen/movable/mapper_holder/parent
/obj/screen/mapper/New() /obj/screen/mapper/New()
..() ..()
parent = loc parent = loc
@@ -921,10 +920,10 @@
var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4) var/static/list/ammo_screen_loc_list = list(ui_ammo_hud1, ui_ammo_hud2, ui_ammo_hud3 ,ui_ammo_hud4)
/obj/screen/ammo/proc/add_hud(var/mob/living/user, var/obj/item/weapon/gun/G) /obj/screen/ammo/proc/add_hud(var/mob/living/user, var/obj/item/weapon/gun/G)
if(!user?.client) if(!user?.client)
return return
if(!G) if(!G)
CRASH("/obj/screen/ammo/proc/add_hud() has been called from [src] without the required param of G") CRASH("/obj/screen/ammo/proc/add_hud() has been called from [src] without the required param of G")

View File

@@ -419,7 +419,7 @@
return return
ui = SStgui.try_update_ui(user, src, ui) ui = SStgui.try_update_ui(user, src, ui)
if(!ui) if(!ui)
ui = new(user, src, "PortableTurret", name, 500, 400) ui = new(user, src, "PortableTurret", name, ui_x = 500, ui_y = 400)
ui.open() ui.open()
/obj/machinery/porta_turret/tgui_data(mob/user) /obj/machinery/porta_turret/tgui_data(mob/user)

View File

@@ -125,7 +125,7 @@
/obj/machinery/turretid/tgui_interact(mob/user, datum/tgui/ui = null) /obj/machinery/turretid/tgui_interact(mob/user, datum/tgui/ui = null)
ui = SStgui.try_update_ui(user, src, ui) ui = SStgui.try_update_ui(user, src, ui)
if(!ui) if(!ui)
ui = new(user, src, "PortableTurret", name) // 500, 400 ui = new(user, src, "PortableTurret", name, ui_x = 500, ui_y = 400) // 500, 400
ui.open() ui.open()
/obj/machinery/turretid/tgui_data(mob/user) /obj/machinery/turretid/tgui_data(mob/user)

View File

@@ -232,6 +232,10 @@
return 1 return 1
. = OnTopic(href, href_list, usr) . = OnTopic(href, href_list, usr)
if(!pref_mob || !pref_mob.client) // Just in case we disappeared during OnTopic
return 1
if(. & TOPIC_UPDATE_PREVIEW) if(. & TOPIC_UPDATE_PREVIEW)
pref_mob.client.prefs.update_preview_icon() pref_mob.client.prefs.update_preview_icon()
if(. & TOPIC_REFRESH) if(. & TOPIC_REFRESH)

View File

@@ -320,7 +320,13 @@
if(M.ckey) if(M.ckey)
GLOB.prey_digested_roundstat++ GLOB.prey_digested_roundstat++
<<<<<<< HEAD
=======
var/personal_nutrition_modifier = M.get_digestion_nutrition_modifier()
>>>>>>> 29514067c6... Merge pull request #13368 from Heroman3003/runtime-fix
if((mode_flags & DM_FLAG_LEAVEREMAINS) && M.digest_leave_remains) if((mode_flags & DM_FLAG_LEAVEREMAINS) && M.digest_leave_remains)
handle_remains_leaving(M) handle_remains_leaving(M)
digestion_death(M) digestion_death(M)
@@ -328,6 +334,7 @@
owner.update_icons() owner.update_icons()
if(isrobot(owner)) if(isrobot(owner))
var/mob/living/silicon/robot/R = owner var/mob/living/silicon/robot/R = owner
<<<<<<< HEAD
if(reagent_mode_flags & DM_FLAG_REAGENTSDIGEST && reagents.total_volume < reagents.maximum_volume) //CHOMPedit: digestion producing reagents if(reagent_mode_flags & DM_FLAG_REAGENTSDIGEST && reagents.total_volume < reagents.maximum_volume) //CHOMPedit: digestion producing reagents
R.cell.charge += (nutrition_percent / 100) * compensation * 15 R.cell.charge += (nutrition_percent / 100) * compensation * 15
GenerateBellyReagents_digested() GenerateBellyReagents_digested()
@@ -339,6 +346,11 @@
GenerateBellyReagents_digested() GenerateBellyReagents_digested()
else else
owner.adjust_nutrition((nutrition_percent / 100) * compensation * 4.5) //CHOMPedit end owner.adjust_nutrition((nutrition_percent / 100) * compensation * 4.5) //CHOMPedit end
=======
R.cell.charge += (nutrition_percent / 100) * compensation * 25 * personal_nutrition_modifier
else
owner.adjust_nutrition((nutrition_percent / 100) * compensation * 4.5 * personal_nutrition_modifier)
>>>>>>> 29514067c6... Merge pull request #13368 from Heroman3003/runtime-fix
/obj/belly/proc/steal_nutrition(mob/living/L) /obj/belly/proc/steal_nutrition(mob/living/L)
if(L.nutrition >= 100) if(L.nutrition >= 100)