Skip to content

Commit

Permalink
recent issues laundry list (#8495)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirRichardFrancis authored Jun 21, 2024
1 parent b1f0ce2 commit 3eaca32
Show file tree
Hide file tree
Showing 38 changed files with 186 additions and 187 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define SILENT 0x40 // Sneaky shoes and silenced tools
#define LOUD 0x80 // Loud as hell tools
#define HONKING 0x100 // Honking tools
#define MOVE_NOTIFY 0x200 // Call entered_with_container() on this item when mob containing it moves

//Flags for items (equipment)
#define THICKMATERIAL 0x1 // Prevents syringes, parapens and hyposprays if equiped to slot_suit or slot_head.
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@
#define MOB_PULL_SAME 2
#define MOB_PULL_LARGER 3

#define MOVED_DROP 1

//carbon taste sensitivity defines, used in mob/living/carbon/proc/ingest
#define TASTE_HYPERSENSITIVE 3 //anything below 5%
#define TASTE_SENSITIVE 2 //anything below 7%
Expand Down
5 changes: 4 additions & 1 deletion code/_onclick/hud/HUD_element/HUD_element.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ element identifiers are used to manage different hud parts for clients, f.e. the
/HUD_element/Click(location,control,params)
if (_clickProc)
if(_holder)
call(_holder, _clickProc)(arglist(_procArguments))
if(_procArguments)
call(_holder, _clickProc)(arglist(_procArguments))
else
call(_holder, _clickProc)(arglist(list(src, usr, location, control, params)))
else
call(_clickProc)(src, usr, location, control, params)

Expand Down
4 changes: 0 additions & 4 deletions code/controllers/subsystems/initialization/character_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ SUBSYSTEM_DEF(character_setup)
for(var/client/C in clients)
GLOB.lobbyScreen.play_music(C)

// These checks normally happen on Login(), but if user have Login()'ed before preferences are loaded,
// then magic is not going to happen. This is a workaround
C.fullscreen_check()

. = ..()
2 changes: 1 addition & 1 deletion code/datums/craft/recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
CS.craft_items[CO] = CS.req_amount - 1
CO.update()
if(flags & CRAFT_ON_FLOOR)
CR.forceMove(user.loc, MOVED_DROP)
CR.forceMove(destination = user.loc, special_event = TRUE)
else
user.put_in_hands(CR)
return CR
Expand Down
9 changes: 6 additions & 3 deletions code/datums/observation/dir_set.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GLOBAL_DATUM_INIT(dir_set_event, /decl/observ/dir_set, new)
name = "Direction Set"
expected_type = /atom

/decl/observ/dir_set/register(var/atom/dir_changer, var/datum/listener, var/proc_call)
/decl/observ/dir_set/register(atom/dir_changer, datum/listener, proc_call)
. = ..()

// Listen to the parent if possible.
Expand All @@ -31,11 +31,14 @@ GLOBAL_DATUM_INIT(dir_set_event, /decl/observ/dir_set, new)
if(old_dir != dir)
GLOB.dir_set_event.raise_event(src, old_dir, dir)

/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
/atom/movable/Entered(atom/movable/am, atom/old_loc)
. = ..()
if(GLOB.dir_set_event.has_listeners(am))
GLOB.dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
if(GLOB.moved_event.has_listeners(am))
GLOB.moved_event.register(src, am, /atom/movable/proc/recursive_move)

/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
/atom/movable/Exited(atom/movable/am, atom/old_loc)
. = ..()
GLOB.dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)
GLOB.moved_event.unregister(src, am, /atom/movable/proc/recursive_move)
15 changes: 0 additions & 15 deletions code/datums/observation/moved.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,9 @@ GLOBAL_DATUM_INIT(moved_event, /decl/observ/moved, new)
* Movement Handling *
********************/

/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
. = ..()
if(GLOB.moved_event.has_listeners(am))
GLOB.moved_event.register(src, am, /atom/movable/proc/recursive_move)

/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
GLOB.moved_event.unregister(src, am, /atom/movable/proc/recursive_move)

// Entered() typically lifts the moved event, but in the case of null-space we'll have to handle it.
/atom/movable/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, var/glide_size_override = 0)
var/old_loc = loc
. = ..()
if(. && !loc)
GLOB.moved_event.raise_event(src, old_loc, null)

/atom/movable/forceMove(atom/destination, var/special_event, glide_size_override=0)
var/old_loc = loc
. = ..()
if(. && !loc)
GLOB.moved_event.raise_event(src, old_loc, null)
10 changes: 3 additions & 7 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -736,13 +736,9 @@ its easier to just keep the beam vertical.
for(var/A in AM.light_sources) // Cycle through the light sources on this atom and tell them to update.
var/datum/light_source/L = A
L.source_atom.update_light()
if(loc)
for(var/i in AM.contents)
var/atom/movable/A = i
A.entered_with_container(old_loc)
if(MOVED_DROP == special_event)
AM.forceMove(loc, MOVED_DROP)
return CANCEL_MOVE_EVENT
if(loc && special_event)
AM.forceMove(destination = loc, special_event = TRUE)
return CANCEL_MOVE_EVENT

/atom/Exited(atom/movable/Obj, atom/newloc)
GLOB.exited_event.raise_event(src, Obj, newloc)
Expand Down
12 changes: 3 additions & 9 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
return checking


/atom/movable/proc/forceMove(atom/destination, var/special_event, glide_size_override=0)
/atom/movable/proc/forceMove(atom/destination, special_event, glide_size_override)
if(loc == destination)
return FALSE

if (glide_size_override)
if(glide_size_override)
set_glide_size(glide_size_override)

var/is_origin_turf = isturf(loc)
Expand Down Expand Up @@ -136,14 +136,8 @@

if(newContainer != oldContainer)
SEND_SIGNAL(src, COMSIG_ATOM_CONTAINERED, newContainer , oldContainer)
/*
// Only update plane if we're located on map
if(is_destination_turf)
// if we wasn't on map OR our Z coord was changed
if(!is_origin_turf || (get_z(loc) != get_z(origin)) )
update_plane()
*/

GLOB.moved_event.raise_event(src, origin, null)
return TRUE


Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items/_inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
SEND_SIGNAL_OLD(user, COMSIG_CLOTH_EQUIPPED, src) // Theres instances in which its usefull to keep track of it both on the user and individually
SEND_SIGNAL_OLD(src, COMSIG_CLOTH_EQUIPPED, user)
update_light()
if(flags & MOVE_NOTIFY)
user.update_on_move |= src

/obj/item/proc/dropped(mob/user)
GLOB.mob_unequipped_event.raise_event(user, src)
Expand All @@ -81,6 +83,7 @@
remove_hud_actions(user)
if(overslot && is_held())
remove_overslot_contents(user)
user.update_on_move -= src

/obj/item/proc/remove_overslot_contents(mob/user)
if(overslot_contents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dir = WEST
suitable_cell = /obj/item/cell/small
rarity_value = 5
flags = CONDUCT|MOVE_NOTIFY
var/tick_cost = 0.4

var/obj/effect/effect/light/light_spot
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/spy_sensor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if(.)
reset()

/obj/item/device/spy_sensor/forceMove()
/obj/item/device/spy_sensor/forceMove(atom/destination, special_event, glide_size_override)
. = ..()
if(.)
reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
if(.)
reset()

/obj/item/implant/carrion_spider/observer/forceMove()
/obj/item/implant/carrion_spider/observer/forceMove(atom/destination, special_event, glide_size_override)
. = ..()
if(.)
reset()
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/weapons/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
S.close(clientMob)

/obj/item/storage/proc/setupItemBackground(var/HUD_element/itemBackground, atom/item, itemCount)
itemBackground.setClickProc(PROC_REF(itemBackgroundClick))
itemBackground.setClickProc(TYPE_PROC_REF(/obj/item/storage, itemBackgroundClick), src)
itemBackground.setData("item", item)

var/HUD_element/itemIcon = itemBackground.add(new/HUD_element())
Expand Down Expand Up @@ -101,7 +101,7 @@
closeButton.setName("HUD Storage Close Button")
closeButton.setIcon(icon("icons/mob/screen1.dmi","x"))
closeButton.setHideParentOnClick(TRUE)
closeButton.setClickProc(PROC_REF(closeButtonClick))
closeButton.setClickProc(TYPE_PROC_REF(/obj/item/storage, closeButtonClick), src)
closeButton.setData("item", src)

//storage space based items
Expand All @@ -115,7 +115,7 @@
storageBackground.setName("HUD Storage Background")
storageBackground.setHideParentOnHide(TRUE)

storageBackground.setClickProc(PROC_REF(storageBackgroundClick))
storageBackground.setClickProc(TYPE_PROC_REF(/obj/item/storage, storageBackgroundClick), src)
storageBackground.setData("item", src)

var/paddingSides = 2 //in pixels
Expand Down Expand Up @@ -199,7 +199,7 @@

currentItemNumber++
else //empty slots
itemBackground.setClickProc(PROC_REF(storageBackgroundClick))
itemBackground.setClickProc(TYPE_PROC_REF(/obj/item/storage, storageBackgroundClick), src)
itemBackground.setData("item", src)

totalWidth += itemBackground.getWidth() + spacingBetweenSlots
Expand Down
26 changes: 17 additions & 9 deletions code/game/objects/structures/low_wall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
/turf/wall/low/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(window_type) // Full-tile glass blocks everything
return FALSE
if(isnull(mover)) // Air, fire, and flamethorower spread
if(blocks_air || (target && target.blocks_air))
return FALSE
return TRUE
if(istype(mover.loc, /turf/wall/low)) // Mover is located on a connected low wall
return TRUE
if(istype(mover, /obj/item/projectile))
Expand All @@ -129,17 +133,21 @@
if(mover.checkpass(PASSTABLE) && mover.layer > layer)
return TRUE
return FALSE
else
if(target.blocks_air || blocks_air)

if(blocks_air || (target && target.blocks_air))
return FALSE
for(var/obj/obstacle in src)
if(!obstacle.CanPass(mover, target, height, air_group))
return FALSE
for(var/obj/obstacle in src)
if(!obstacle.CanPass(mover, target, height, air_group))
if(target != src)
for(var/obj/obstacle in target)
if(!obstacle.CanPass(mover, src, height, air_group))
return FALSE
if(target != src)
for(var/obj/obstacle in target)
if(!obstacle.CanPass(mover, src, height, air_group))
return FALSE
return TRUE
if(target != src)
for(var/obj/obstacle in target)
if(!obstacle.CanPass(mover, src, height, air_group))
return FALSE
return TRUE

//checks if projectile 'P' from turf 'from' can hit whatever is behind the table. Returns 1 if it can, 0 if bullet stops.
/turf/wall/low/proc/check_cover(obj/item/projectile/P, turf/from)
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/simulated/wall_attacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
var/obj/item/frame/F = I
F.try_build(src)

else if(is_low_wall && !window_type && istype(I, /obj/item/stack/material/glass))
else if(is_low_wall && !window_type && ispath(I.type, /obj/item/stack/material/glass))
var/obj/item/stack/material/glass/glass_stack = I
if(glass_stack.get_amount() < 6)
to_chat(user, SPAN_NOTICE("There isn't enough glass sheets, you need at least six."))
Expand Down
17 changes: 15 additions & 2 deletions code/game/turfs/simulated/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@


/turf/wall/bullet_act(obj/item/projectile/Proj)
if(!is_simulated)
return
if(ricochet_id != 0)
if(ricochet_id == Proj.ricochet_id)
ricochet_id = 0
Expand Down Expand Up @@ -225,6 +227,8 @@


/turf/wall/hitby(atom/movable/AM, speed = THROWFORCE_SPEED_DIVISOR)
if(!is_simulated)
return
if(density)
AM.throwing = FALSE
if(ismob(AM))
Expand All @@ -247,7 +251,8 @@


/turf/wall/examine(mob/user, extra_description = "")
if(!simulated)
if(!is_simulated)
extra_description += SPAN_NOTICE("It looks very tough.")
return ..(user, extra_description)

if(health == max_health)
Expand Down Expand Up @@ -315,6 +320,8 @@
visible_message(SPAN_DANGER("\The [src] spontaneously combusts!")) //!!OH SHIT!!

/turf/wall/take_damage(damage)
if(!is_simulated)
return
if(damage < 1)
return
if(locate(/obj/effect/overlay/wallrot) in src)
Expand All @@ -328,18 +335,24 @@


/turf/wall/explosion_act(target_power, explosion_handler/handler)
if(!is_simulated)
return 0
var/absorbed = take_damage(target_power)
// All health has been blocked
if(absorbed == target_power)
return target_power
return absorbed + ..(target_power - absorbed)

/turf/wall/adjacent_fire_act(turf/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume)
if(!is_simulated)
return
var/melting_point = (hardness > 100) ? 6000 : 1800
if(adj_temp > melting_point)
take_damage(log(RAND_DECIMAL(0.9, 1.1) * (adj_temp - melting_point)))

/turf/wall/proc/thermitemelt(mob/user) // TODO: Refactor this --KIROV
/turf/wall/proc/thermitemelt(mob/user)
if(!is_simulated)
return
var/obj/effect/overlay/burn_overlay = new/obj/effect/overlay(src)
burn_overlay.name = "Thermite"
burn_overlay.desc = "Looks hot."
Expand Down
8 changes: 8 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,17 @@


/turf/Entered(atom/movable/Obj, atom/OldLoc)
..()
for(var/entry in Obj.light_sources)
var/datum/light_source/light_source = entry
light_source.source_atom.update_light()
if(is_simulated)
if(isliving(Obj))
var/mob/living/M = Obj

for(var/atom/movable/updatee in M.update_on_move)
updatee.entered_with_container(OldLoc)

if(!M.lying)
var/obj/effect/plant/plant = locate() in contents
if(plant)
Expand Down
25 changes: 17 additions & 8 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -767,16 +767,25 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(

init_verbs()

/client/proc/fullscreen_check()
if(get_preference_value(/datum/client_preference/fullscreen) == GLOB.PREF_YES)
winset(src, null, "mainwindow.titlebar=false mainwindow.menu=none mainwindow.is-maximized=true split.pos=0,0")
else
winset(src, null, "mainwindow.titlebar=true mainwindow.menu=menu split.pos=3,0")
fit_viewport()

/client/verb/toggle_fullscreen() // F11 hotkey
set name = "Toogle Fullscreen"
set category = "OOC"

src << output("", "browseroutput:fullscreen_check")


/client/verb/enable_fullscreen()
set hidden = TRUE
winset(usr, "mainwindow", "titlebar=false")
winset(usr, "mainwindow", "menu=")
winset(usr, "mainwindow", "is-maximized=false")
winset(usr, "mainwindow", "is-maximized=true")
fit_viewport()

cycle_preference(/datum/client_preference/fullscreen)
fullscreen_check()
/client/verb/disable_fullscreen()
set hidden = TRUE
winset(usr, "mainwindow", "titlebar=true")
winset(usr, "mainwindow", "menu=menu")
winset(usr, "mainwindow", "is-maximized=false")
fit_viewport()
Loading

0 comments on commit 3eaca32

Please sign in to comment.