diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 096f73a10d9..64f9949016d 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -72,6 +72,8 @@ #define EXAMINE_POSITION_BEFORE 2 //End positions #define COMPONENT_EXNAME_CHANGED 1 +#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon" //from base of atom/update_icon(): () + #define COMSIG_ATOM_NO_UPDATE_ICON_STATE 1 #define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable/entering, /atom) #define COMSIG_ATOM_EXIT "atom_exit" //from base of atom/Exit(): (/atom/movable/exiting, /atom/newloc) #define COMPONENT_ATOM_BLOCK_EXIT 1 @@ -234,7 +236,6 @@ #define COMSIG_OBJ_DECONSTRUCT "obj_deconstruct" //from base of obj/deconstruct(): (disassembled) #define COMSIG_OBJ_SETANCHORED "obj_setanchored" //called in /obj/structure/setAnchored(): (value) #define COMSIG_OBJ_DEFAULT_UNFASTEN_WRENCH "obj_default_unfasten_wrench" //from base of code/game/machinery -#define COMSIG_OBJ_UPDATE_ICON "obj_update_icon" //Called by obj to itself whenever update_icon is run. Useful for containers that want to detect this change // /obj/machinery signals #define COMSIG_MACHINERY_BROKEN "machinery_broken" //from /obj/machinery/obj_break(damage_flag): (damage_flag) diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 92b09149422..801b9ce73f7 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -83,7 +83,7 @@ pull_icon = new /obj/screen/pull() pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_movement static_inventory += pull_icon @@ -100,7 +100,7 @@ infodisplay += alien_queen_finder zone_select = new /obj/screen/zone_sel/alien() - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory)) diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 8281fe8e996..435017ceaae 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -17,7 +17,7 @@ infodisplay += alien_queen_finder pull_icon = new /obj/screen/pull() pull_icon.icon = 'icons/mob/screen_alien.dmi' - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_movement hotkeybuttons += pull_icon @@ -26,5 +26,5 @@ static_inventory += using zone_select = new /obj/screen/zone_sel/alien() - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select diff --git a/code/_onclick/hud/constructs.dm b/code/_onclick/hud/constructs.dm index 182495c2367..94dbab54244 100644 --- a/code/_onclick/hud/constructs.dm +++ b/code/_onclick/hud/constructs.dm @@ -5,7 +5,7 @@ ..() pull_icon = new /obj/screen/pull() pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_construct_pull static_inventory += pull_icon diff --git a/code/_onclick/hud/devil.dm b/code/_onclick/hud/devil.dm index 40fdc37da3d..63c3e542ed0 100644 --- a/code/_onclick/hud/devil.dm +++ b/code/_onclick/hud/devil.dm @@ -13,7 +13,7 @@ pull_icon = new /obj/screen/pull() pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_drone_pull static_inventory += pull_icon @@ -39,7 +39,7 @@ zone_select = new /obj/screen/zone_sel() zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() lingchemdisplay = new /obj/screen/ling/chems() devilsouldisplay = new /obj/screen/devil/soul_counter diff --git a/code/_onclick/hud/generic_dextrous.dm b/code/_onclick/hud/generic_dextrous.dm index ad8eb775fae..870bfc4b472 100644 --- a/code/_onclick/hud/generic_dextrous.dm +++ b/code/_onclick/hud/generic_dextrous.dm @@ -10,7 +10,7 @@ pull_icon = new /obj/screen/pull() pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_drone_pull static_inventory += pull_icon @@ -41,7 +41,7 @@ zone_select = new /obj/screen/zone_sel() zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select using = new /obj/screen/area_creator diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 99c77464276..d831e28d964 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -289,7 +289,7 @@ pull_icon = new /obj/screen/pull() pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_intent static_inventory += pull_icon @@ -304,7 +304,7 @@ zone_select = new /obj/screen/zone_sel() zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory)) diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index d3be91abe94..04a2f794b15 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -86,7 +86,7 @@ pull_icon = new /obj/screen/pull() pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_movement static_inventory += pull_icon @@ -99,7 +99,7 @@ zone_select = new /obj/screen/zone_sel() zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select mymob.client.screen = list() diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 54a81efddd1..d67b67aebda 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -169,13 +169,13 @@ pull_icon = new /obj/screen/pull() pull_icon.icon = 'icons/mob/screen_cyborg.dmi' - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_borg_pull hotkeybuttons += pull_icon zone_select = new /obj/screen/zone_sel/robot() - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 5ac4b16b077..ff3aba33d9e 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -104,21 +104,21 @@ // At this point in client Click() code we have passed the 1/10 sec check and little else // We don't even know if it's a middle click if(world.time <= usr.next_move) - return 1 + return TRUE if(usr.incapacitated()) - return 1 + return TRUE if(ismecha(usr.loc)) // stops inventory actions in a mech - return 1 + return TRUE - if(hud && hud.mymob && slot_id) + if(hud?.mymob && slot_id) var/obj/item/inv_item = hud.mymob.get_item_by_slot(slot_id) if(inv_item) return inv_item.Click(location, control, params) if(usr.attack_ui(slot_id)) usr.update_inv_hands() - return 1 + return TRUE /obj/screen/inventory/MouseEntered() ..() @@ -129,35 +129,37 @@ cut_overlay(object_overlays) object_overlays.Cut() -/obj/screen/inventory/update_icon() +/obj/screen/inventory/update_icon_state() if(!icon_empty) icon_empty = icon_state - if(hud && hud.mymob && slot_id && icon_full) + if(hud?.mymob && slot_id && icon_full) if(hud.mymob.get_item_by_slot(slot_id)) icon_state = icon_full else icon_state = icon_empty /obj/screen/inventory/proc/add_overlays() - var/mob/user = hud.mymob + var/mob/user = hud?.mymob - if(hud && user && slot_id) - var/obj/item/holding = user.get_active_held_item() + if(!user || !slot_id) + return - if(!holding || user.get_item_by_slot(slot_id)) - return + var/obj/item/holding = user.get_active_held_item() - var/image/item_overlay = image(holding) - item_overlay.alpha = 92 + if(!holding || user.get_item_by_slot(slot_id)) + return - if(!user.can_equip(holding, slot_id, TRUE)) - item_overlay.color = "#FF0000" - else - item_overlay.color = "#00ff00" + var/image/item_overlay = image(holding) + item_overlay.alpha = 92 - object_overlays += item_overlay - add_overlay(object_overlays) + if(!user.can_equip(holding, slot_id, TRUE)) + item_overlay.color = "#FF0000" + else + item_overlay.color = "#00ff00" + + object_overlays += item_overlay + add_overlay(object_overlays) /obj/screen/inventory/hand var/mutable_appearance/handcuff_overlay @@ -165,45 +167,50 @@ var/held_index = 0 /obj/screen/inventory/hand/update_icon() - ..() + . = ..() if(!handcuff_overlay) var/state = (!(held_index % 2)) ? "markus" : "gabrielle" handcuff_overlay = mutable_appearance('icons/mob/screen_gen.dmi', state) - cut_overlays() + cut_overlay(list(handcuff_overlay, blocked_overlay, "hand_active")) - if(hud && hud.mymob) - if(iscarbon(hud.mymob)) - var/mob/living/carbon/C = hud.mymob - if(C.handcuffed) - add_overlay(handcuff_overlay) + if(!hud?.mymob) + return - if(held_index) - if(!C.has_hand_for_held_index(held_index)) - add_overlay(blocked_overlay) + if(iscarbon(hud.mymob)) + var/mob/living/carbon/C = hud.mymob + if(C.handcuffed) + add_overlay(handcuff_overlay) - if(held_index == hud.mymob.active_hand_index) - add_overlay("hand_active") + if(held_index) + if(!C.has_hand_for_held_index(held_index)) + add_overlay(blocked_overlay) + + if(held_index == hud.mymob.active_hand_index) + add_overlay("hand_active") /obj/screen/inventory/hand/Click(location, control, params) // At this point in client Click() code we have passed the 1/10 sec check and little else // We don't even know if it's a middle click - if(world.time <= usr.next_move) - return 1 - if(usr.incapacitated() || isobserver(usr)) - return 1 - if (ismecha(usr.loc)) // stops inventory actions in a mech - return 1 + var/mob/user = hud?.mymob + if(usr != user) + return TRUE + if(world.time <= user.next_move) + return TRUE + if(user.incapacitated()) + return TRUE + if (ismecha(user.loc)) // stops inventory actions in a mech + return TRUE - if(hud.mymob.active_hand_index == held_index) - var/obj/item/I = hud.mymob.get_active_held_item() + if(user.active_hand_index == held_index) + var/obj/item/I = user.get_active_held_item() if(I) I.Click(location, control, params) else - hud.mymob.swap_hand(held_index) - return 1 + user.swap_hand(held_index) + return TRUE /obj/screen/close name = "close" @@ -334,12 +341,8 @@ /obj/screen/mov_intent/Click() toggle(usr) -/obj/screen/mov_intent/update_icon(mob/user) - if(!user && hud) - user = hud.mymob - if(!user) - return - switch(user.m_intent) +/obj/screen/mov_intent/update_icon_state() + switch(hud?.mymob?.m_intent) if(MOVE_INTENT_WALK) icon_state = "walking" if(MOVE_INTENT_RUN) @@ -360,10 +363,8 @@ return usr.stop_pulling() -/obj/screen/pull/update_icon(mob/mymob) - if(!mymob) - return - if(mymob.pulling) +/obj/screen/pull/update_icon_state() + if(hud?.mymob?.pulling) icon_state = "pull" else icon_state = "pull0" @@ -392,11 +393,12 @@ var/mob/living/L = usr L.lay_down() -/obj/screen/rest/update_icon(mob/mymob) - if(!isliving(mymob)) +/obj/screen/rest/update_icon_state() + var/mob/living/user = hud?.mymob + if(!istype(user)) return - var/mob/living/L = mymob - if(!L.resting) + + if(!user.resting) icon_state = "act_rest" else icon_state = "act_rest0" @@ -442,6 +444,7 @@ var/selecting = BODY_ZONE_CHEST var/static/list/hover_overlays_cache = list() var/hovering + var/mutable_appearance/selecting_appearance /obj/screen/zone_sel/Click(location, control,params) if(isobserver(usr)) @@ -532,26 +535,31 @@ return BODY_ZONE_HEAD /obj/screen/zone_sel/proc/set_selected_zone(choice, mob/user) - if(isobserver(user)) + if(user != hud?.mymob) return if(choice != selecting) selecting = choice - update_icon(usr) - return 1 + update_icon() + + return TRUE -/obj/screen/zone_sel/update_icon(mob/user) - cut_overlays() - add_overlay(mutable_appearance('icons/mob/screen_gen.dmi', "[selecting]")) - user.zone_selected = selecting +/obj/screen/zone_sel/update_icon() + . = ..() + cut_overlay(selecting_appearance) + selecting_appearance = mutable_appearance('icons/mob/screen_gen.dmi', "[selecting]") + add_overlay(selecting_appearance) + hud?.mymob?.zone_selected = selecting /obj/screen/zone_sel/alien icon = 'icons/mob/screen_alien.dmi' -/obj/screen/zone_sel/alien/update_icon(mob/user) - cut_overlays() - add_overlay(mutable_appearance('icons/mob/screen_alien.dmi', "[selecting]")) - user.zone_selected = selecting +/obj/screen/zone_sel/alien/update_icon() + . = ..() + cut_overlay(selecting_appearance) + selecting_appearance = mutable_appearance('icons/mob/screen_alien.dmi', "[selecting]") + add_overlay(selecting_appearance) + hud?.mymob?.zone_selected = selecting /obj/screen/zone_sel/robot icon = 'icons/mob/screen_cyborg.dmi' diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index dd1c7b6c0df..fe06467134e 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -209,9 +209,8 @@ righthand_file = 'icons/mob/inhands/weapons/staves_righthand.dmi' block_chance = 50 -/obj/item/twohanded/bostaff/update_icon() +/obj/item/twohanded/bostaff/update_icon_state() icon_state = "bostaff[wielded]" - return /obj/item/twohanded/bostaff/attack(mob/target, mob/living/user) add_fingerprint(user) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 3d9b7b0047d..f8c0a5a8515 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -443,12 +443,12 @@ GLOBAL_LIST_EMPTY(teleportlocs) L.update() /** - * Update the icon of the area + * Update the icon state of the area * * Im not sure what the heck this does, somethign to do with weather being able to set icon * states on areas?? where the heck would that even display? */ -/area/proc/update_icon() +/area/update_icon_state() var/weather_icon for(var/V in SSweather.processing) var/datum/weather/W = V @@ -461,7 +461,7 @@ GLOBAL_LIST_EMPTY(teleportlocs) /** * Update the icon of the area (overridden to always be null for space */ -/area/space/update_icon() +/area/space/update_icon_state() icon_state = null diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e4c20f665bf..5f8dfcb1220 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -485,6 +485,16 @@ SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .) +/// Updates the icon of the atom +/atom/proc/update_icon() + // I expect we're going to need more return flags and options in this proc + var/signalOut = SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON) + if(!(signalOut & COMSIG_ATOM_NO_UPDATE_ICON_STATE)) + update_icon_state() + +/// Updates the icon state of the atom +/atom/proc/update_icon_state() + /** * An atom we are buckled or is contained within us has tried to move * diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 6abbdebe4e8..1d4b7cd3c88 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -176,7 +176,7 @@ if(device) device.pulsed() - addtimer(CALLBACK(src, .proc/update_icon), 15) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 15) /obj/machinery/button/door name = "door button" diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 0981469eb6a..5b012089f8e 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -224,7 +224,7 @@ merge_gases() for(var/i in 1 to 6) - addtimer(CALLBACK(src, .proc/update_icon), 20 + (i - 1) * 10) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 20 + (i - 1) * 10) else if(valve_open && tank_one && tank_two) split_gases() diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index fcee24c1e1b..3502194cb27 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -770,7 +770,7 @@ /obj/item/borg/apparatus/Exited(atom/A) if(A == stored) //sanity check - UnregisterSignal(stored, COMSIG_OBJ_UPDATE_ICON) + UnregisterSignal(stored, COMSIG_ATOM_UPDATE_ICON) stored = null update_icon() . = ..() @@ -804,7 +804,7 @@ var/obj/item/O = A O.forceMove(src) stored = O - RegisterSignal(stored, COMSIG_OBJ_UPDATE_ICON, .proc/update_icon) + RegisterSignal(stored, COMSIG_ATOM_UPDATE_ICON, /atom/.proc/update_icon) update_icon() return else @@ -832,7 +832,7 @@ /obj/item/borg/apparatus/beaker/Initialize() . = ..() stored = new /obj/item/reagent_containers/glass/beaker/large(src) - RegisterSignal(stored, COMSIG_OBJ_UPDATE_ICON, .proc/update_icon) + RegisterSignal(stored, COMSIG_ATOM_UPDATE_ICON, /atom/.proc/update_icon) update_icon() /obj/item/borg/apparatus/beaker/Destroy() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 9d703136fca..57c00a6d3cb 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -176,10 +176,6 @@ /obj/proc/container_resist(mob/living/user) return -/obj/proc/update_icon() - SEND_SIGNAL(src, COMSIG_OBJ_UPDATE_ICON) - return - /mob/proc/unset_machine() if(machine) machine.on_unset_machine(src) diff --git a/code/game/objects/structures/divine.dm b/code/game/objects/structures/divine.dm index 5ce34d4476f..b97485607d3 100644 --- a/code/game/objects/structures/divine.dm +++ b/code/game/objects/structures/divine.dm @@ -41,7 +41,7 @@ to_chat(user, "The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.") user.reagents.add_reagent(/datum/reagent/medicine/omnizine/godblood,20) update_icon() - addtimer(CALLBACK(src, .proc/update_icon), time_between_uses) + addtimer(CALLBACK(src, /atom/.proc/update_icon), time_between_uses) /obj/structure/healingfountain/update_icon() diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 0a2e98a2888..b9f61a9ea0b 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -104,9 +104,9 @@ /turf/open/floor/blob_act(obj/structure/blob/B) return -/turf/open/floor/proc/update_icon() +/turf/open/floor/update_icon() + . = ..() update_visuals() - return 1 /turf/open/floor/attack_paw(mob/user) return attack_hand(user) diff --git a/code/game/turfs/simulated/wall/reinf_walls.dm b/code/game/turfs/simulated/wall/reinf_walls.dm index b97c79ae5b3..9b9e2ae7e0b 100644 --- a/code/game/turfs/simulated/wall/reinf_walls.dm +++ b/code/game/turfs/simulated/wall/reinf_walls.dm @@ -190,15 +190,20 @@ return 1 return 0 -/turf/closed/wall/r_wall/proc/update_icon() +/turf/closed/wall/r_wall/update_icon() + . = ..() if(d_state != INTACT) smooth = SMOOTH_FALSE clear_smooth_overlays() - icon_state = "r_wall-[d_state]" else smooth = SMOOTH_TRUE queue_smooth_neighbors(src) queue_smooth(src) + +/turf/closed/wall/r_wall/update_icon_state() + if(d_state != INTACT) + icon_state = "r_wall-[d_state]" + else icon_state = "r_wall" /turf/closed/wall/r_wall/wall_singularity_pull(current_size) diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index 8416684e73a..1deb5303d30 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -78,10 +78,13 @@ for(var/atom/movable/AM in src) throw_atom(AM) -/turf/open/space/transit/proc/update_icon() - icon_state = "speedspace_ns_[get_transit_state(src)]" +/turf/open/space/transit/update_icon() + . = ..() transform = turn(matrix(), get_transit_angle(src)) +/turf/open/space/transit/update_icon_state() + icon_state = "speedspace_ns_[get_transit_state(src)]" + /proc/get_transit_state(turf/T) var/p = 9 . = 1 diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index dd74e86fd71..e482f0c6115 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -39,7 +39,7 @@ if(flash) add_overlay(flashing_overlay) attached_overlays += flashing_overlay - addtimer(CALLBACK(src, .proc/update_icon), 5) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 5) if(holder) holder.update_icon() diff --git a/code/modules/cargo/gondolapod.dm b/code/modules/cargo/gondolapod.dm index a5c30eb5468..7ecbc6fd152 100644 --- a/code/modules/cargo/gondolapod.dm +++ b/code/modules/cargo/gondolapod.dm @@ -32,7 +32,7 @@ name = linked_pod.name . = ..() -/mob/living/simple_animal/pet/gondola/gondolapod/proc/update_icon() +/mob/living/simple_animal/pet/gondola/gondolapod/update_icon_state() if(opened) icon_state = "gondolapod_open" else diff --git a/code/modules/holodeck/turfs.dm b/code/modules/holodeck/turfs.dm index 3b9351a153e..5aa0a15ba42 100644 --- a/code/modules/holodeck/turfs.dm +++ b/code/modules/holodeck/turfs.dm @@ -112,11 +112,10 @@ /turf/open/floor/holofloor/carpet/Initialize() . = ..() - addtimer(CALLBACK(src, .proc/update_icon), 1) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 1) /turf/open/floor/holofloor/carpet/update_icon() - if(!..()) - return 0 + . = ..() if(intact) queue_smooth(src) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 8b1ac633f56..92b12cdd524 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -171,7 +171,9 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) * Hair will always update its dir, so if your sprite has no dirs the haircut will go all over the place. * |- Ricotez */ -/mob/dead/observer/proc/update_icon(new_form) +/mob/dead/observer/update_icon(new_form) + . = ..() + if(client) //We update our preferences in case they changed right before update_icon was called. ghost_accs = client.prefs.ghost_accs ghost_others = client.prefs.ghost_others diff --git a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm index c81c71704ea..518572b1449 100644 --- a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm +++ b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm @@ -51,7 +51,7 @@ weapon.attack(C, src) playsound(src, 'sound/weapons/blade1.ogg', 50, TRUE, -1) if(C.stat == DEAD) - addtimer(CALLBACK(src, .proc/update_icon), 2) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 2) back_to_idle() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index a8637f9e0c4..02a52fa4f39 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -833,7 +833,7 @@ Pass a positive integer as an argument to override a bot's default speed. ejectpai(usr) update_controls() -/mob/living/simple_animal/bot/proc/update_icon() +/mob/living/simple_animal/bot/update_icon_state() icon_state = "[initial(icon_state)][on]" // Machinery to simplify topic and access calls diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index db367da3d70..68f996f549a 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -50,7 +50,7 @@ /mob/living/simple_animal/bot/honkbot/proc/sensor_blink() icon_state = "honkbot-c" - addtimer(CALLBACK(src, .proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE) //honkbots react with sounds. /mob/living/simple_animal/bot/honkbot/proc/react_ping() @@ -176,7 +176,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"}, playsound(src, "honkbot_e", 50, FALSE) spam_flag = TRUE // prevent spam icon_state = "honkbot-e" - addtimer(CALLBACK(src, .proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE) addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntimehorn) /mob/living/simple_animal/bot/honkbot/proc/honk_attack(mob/living/carbon/C) // horn attack diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 7b5e21743b8..dba9a594849 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -272,7 +272,7 @@ Auto Patrol: []"}, var/judgement_criteria = judgement_criteria() playsound(src, 'sound/weapons/egloves.ogg', 50, TRUE, -1) icon_state = "[initial(icon_state)]-c" - addtimer(CALLBACK(src, .proc/update_icon), 2) + addtimer(CALLBACK(src, /atom/.proc/update_icon), 2) var/threat = 5 if(harm) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 70ec722b39d..030b6388746 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -478,15 +478,11 @@ ///Update the pulling hud icon /mob/proc/update_pull_hud_icon() - if(hud_used) - if(hud_used.pull_icon) - hud_used.pull_icon.update_icon(src) + hud_used?.pull_icon?.update_icon() ///Update the resting hud icon /mob/proc/update_rest_hud_icon() - if(hud_used) - if(hud_used.rest_icon) - hud_used.rest_icon.update_icon(src) + hud_used?.rest_icon?.update_icon() /** * Verb to activate the object in your held hand diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 485235b5d41..9b1a2cc10bf 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -459,7 +459,7 @@ m_intent = MOVE_INTENT_RUN if(hud_used && hud_used.static_inventory) for(var/obj/screen/mov_intent/selector in hud_used.static_inventory) - selector.update_icon(src) + selector.update_icon() ///Moves a mob upwards in z level /mob/verb/up()