Skip to content

Commit

Permalink
Merge branch 'master' into Lisp_Radio
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 committed Jun 30, 2023
2 parents 4f5feb1 + 6a457d9 commit 5eeb1b1
Show file tree
Hide file tree
Showing 33 changed files with 186 additions and 116 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ These are the few directives we have for project maintainers.
- Try to get secondary maintainer approval before merging if you are able to.
- PRs with empty commits intended to generate a changelog.
- Do not merge PRs that contain content from the [banned content list](./CONTRIBUTING.md#banned-content).
- Do not merge PRs that contain balance changes without GA approval. Exceptions include:
- Any PR that has been un-reviewed by a GA for 7 days.
- Do not merge PRs that contain balance changes without Maintainer Manager approval. Exceptions include:
- Any PR that has been un-reviewed by a Maintainer Manager for 7 days.
- Do not remove the DNM label that another Maintainer has applied. Exceptions include:
- GAs removing a DNM label placed by a Maintainer for Balance/Design reasons
- Maintainer Managers removing a DNM label placed by a Maintainer for Balance/Design reasons

These are not steadfast rules as maintainers are expected to use their best judgement when operating.

Expand Down
4 changes: 3 additions & 1 deletion .github/guides/STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ While we normally encourage (and in some cases, even require) bringing out of da
This is a simple one - as we will eventually move to 515, we will need to ditch this kind of callback. So please don't add any new ones. Make our lives easier.

### PROC_REF Macros
When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF,TYPE_PROC_REF and GLOBAL_PROC_REF macros.
When referencing procs in RegisterSignal, Callback and other procs you should use PROC_REF, TYPE_PROC_REF and GLOBAL_PROC_REF macros.
They ensure compilation fails if the reffered to procs change names or get removed.
The macro to be used depends on how the proc you're in relates to the proc you want to use:

Expand Down Expand Up @@ -168,6 +168,8 @@ This is a simple one - as we will eventually move to 515, we will need to ditch
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(funny)), 100))
```

Note that the same rules go for verbs too! We have VERB_REF() and TYPE_VERB_REF() as you need it in these same cases. GLOBAL_VERB_REF() isn't a thing however, as verbs are not global.

### Signal Handlers

All procs that are registered to listen for signals using `RegisterSignal()` must contain at the start of the proc `SIGNAL_HANDLER` eg;
Expand Down
44 changes: 37 additions & 7 deletions code/_byond_version_compat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,49 @@
#define LIBCALL call_ext
#endif

// So we want to have compile time guarantees these procs exist on local type, unfortunately 515 killed the .proc/procname syntax so we have to use nameof()
// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof()
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global.

#if DM_VERSION < 515
/// Call by name proc reference, checks if the proc exists on this type or as a global proc

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (.proc/##X)
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (.verb/##X)

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name proc reference, checks if the proc is existing global proc
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X)

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#else
/// Call by name proc reference, checks if the proc exists on this type or as a global proc

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name proc reference, checks if the proc exists on given type or as a global proc
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (nameof(.verb/##X))

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X))
/// Call by name proc reference, checks if the proc is existing global proc
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (nameof(##TYPE.verb/##X))

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif

#if (DM_VERSION == 515)
/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows
/// var case matches documentation for fcopy.
/world/proc/__fcopy(Src, Dst)
if (istext(Src) && !fexists(Src))
return 0
return fcopy(Src, Dst)

#define fcopy(Src, Dst) world.__fcopy(Src, Dst)

#endif
4 changes: 2 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
return

face_atom(A)
if(mods["middle"])
if(mods["middle"])
return
// Special type of click.
if (is_mob_restrained())
Expand Down Expand Up @@ -334,7 +334,7 @@
if(prefs.adaptive_zoom)
INVOKE_ASYNC(src, PROC_REF(adaptive_zoom))
else if(prefs.auto_fit_viewport)
INVOKE_ASYNC(src, .verb/fit_viewport)
INVOKE_ASYNC(src, VERB_REF(fit_viewport))

/client/proc/get_adaptive_zoom_factor()
if(!prefs.adaptive_zoom)
Expand Down
22 changes: 16 additions & 6 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ SUBSYSTEM_DEF(minimaps)
* removes an image from raw tracked lists, invoked by callback
*/
/datum/controller/subsystem/minimaps/proc/removeimage(image/blip, atom/target)
var/turf/turf_gotten = get_turf(target)
if(!turf_gotten)
return
var/z_level = turf_gotten.z
for(var/flag in GLOB.all_minimap_flags)
minimaps_by_z["[target.z]"].images_raw["[flag]"] -= blip
minimaps_by_z["[z_level]"].images_raw["[flag]"] -= blip
blip.UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
removal_cbs -= target

Expand Down Expand Up @@ -391,18 +395,24 @@ SUBSYSTEM_DEF(minimaps)
owner.client.screen += map
minimap_displayed = !minimap_displayed

/datum/action/minimap/give_to(mob/M)
/datum/action/minimap/give_to(mob/target)
. = ..()

if(default_overwatch_level)
map = SSminimaps.fetch_minimap_object(default_overwatch_level, minimap_flags)
else
RegisterSignal(M, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))
if(!SSminimaps.minimaps_by_z["[M.z]"] || !SSminimaps.minimaps_by_z["[M.z]"].hud_image)
RegisterSignal(target, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(on_owner_z_change))

var/turf/turf_gotten = get_turf(target)
if(!turf_gotten)
return
var/z_level = turf_gotten.z

if(!SSminimaps.minimaps_by_z["[z_level]"] || !SSminimaps.minimaps_by_z["[z_level]"].hud_image)
return
map = SSminimaps.fetch_minimap_object(M.z, minimap_flags)
map = SSminimaps.fetch_minimap_object(z_level, minimap_flags)

/datum/action/minimap/remove_from(mob/M)
/datum/action/minimap/remove_from(mob/target)
. = ..()
if(minimap_displayed)
owner?.client?.screen -= map
Expand Down
6 changes: 4 additions & 2 deletions code/datums/emergency_calls/cryo_marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
shuttle_id = ""
var/leaders = 0

/datum/emergency_call/cryo_squad/spawn_candidates(announce, override_spawn_loc)
/datum/emergency_call/cryo_squad/spawn_candidates(announce, override_spawn_loc, announce_dispatch_message)
var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo]
leaders = cryo_squad.num_leaders
return ..()
. = ..()
if(length(members))
shipwide_ai_announcement("Successfully deployed [length(members)] Foxtrot marines.")

/datum/emergency_call/cryo_squad/create_member(datum/mind/M, turf/override_spawn_loc)
set waitfor = 0
Expand Down
6 changes: 4 additions & 2 deletions code/datums/emergency_calls/cryo_marines_heavy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

var/leaders = 0

/datum/emergency_call/cryo_squad_equipped/spawn_candidates(announce, override_spawn_loc)
/datum/emergency_call/cryo_squad_equipped/spawn_candidates(announce, override_spawn_loc, announce_dispatch_message)
var/datum/squad/marine/cryo/cryo_squad = RoleAuthority.squads_by_type[/datum/squad/marine/cryo]
leaders = cryo_squad.num_leaders
return ..()
. = ..()
if(length(members))
shipwide_ai_announcement("Successfully deployed [length(members)] Foxtrot marines.")

/datum/emergency_call/cryo_squad_equipped/create_member(datum/mind/M, turf/override_spawn_loc)
set waitfor = 0
Expand Down
8 changes: 3 additions & 5 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,9 @@
src.add_fingerprint(user)
afterbuckle(target)
if(buckle_lying) // Make sure buckling to beds/nests etc only turns, and doesn't give a random offset
var/matrix/M = matrix()
var/matrix/L = matrix() //Counterrotation for langchat text.
M.Turn(90)
L.Turn(270)
target.apply_transform(M)
var/matrix/new_matrix = matrix()
new_matrix.Turn(90)
target.apply_transform(new_matrix)
return TRUE

/obj/proc/send_buckling_message(mob/M, mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@
if(buckled_human.stat == DEAD )
buckled_mob_density = FALSE

. = ..()

var/mob/dead/observer/G = ghost_of_buckled_mob
var/datum/mind/M = G?.mind
ghost_of_buckled_mob = null

. = ..() //Very important that this comes after, since it deletes the nest and clears ghost_of_buckled_mob

if(!istype(buckled_human) || !istype(G) || !istype(M) || buckled_human.undefibbable || buckled_human.mind || M.original != buckled_human || buckled_human.chestburst)
return // Zealous checking as most is handled by ghost code
to_chat(G, FONT_SIZE_HUGE(SPAN_DANGER("You have been freed from your nest and may go back to your body! (Look for 'Re-enter Corpse' in Ghost verbs, or <a href='?src=\ref[G];reentercorpse=1'>click here</a>!)")))
Expand Down
13 changes: 12 additions & 1 deletion code/modules/cm_marines/dropship_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@
deployed_turret.start_processing()
deployed_turret.set_range()

deployed_turret.linked_cam = new(deployed_turret.loc, "[capitalize_first_letters(ship_base.name)] [capitalize_first_letters(name)]")
if (linked_shuttle.id == DROPSHIP_ALAMO)
deployed_turret.linked_cam.network = list(CAMERA_NET_ALAMO)
else if (linked_shuttle.id == DROPSHIP_NORMANDY)
deployed_turret.linked_cam.network = list(CAMERA_NET_NORMANDY)


/obj/structure/dropship_equipment/sentry_holder/proc/undeploy_sentry()
if(!deployed_turret)
return
Expand All @@ -267,8 +274,12 @@
deployed_turret.stop_processing()
deployed_turret.unset_range()
icon_state = "sentry_system_installed"
QDEL_NULL(deployed_turret.linked_cam)


/obj/structure/dropship_equipment/sentry_holder/Destroy()
if(deployed_turret)
QDEL_NULL(deployed_turret.linked_cam)
. = ..()


/// Holder for the dropship mannable machinegun system
Expand Down
2 changes: 2 additions & 0 deletions code/modules/defenses/sentry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,13 @@
choice_categories = list()
selected_categories = list()
var/obj/structure/dropship_equipment/sentry_holder/deployment_system
var/obj/structure/machinery/camera/cas/linked_cam

/obj/structure/machinery/defenses/sentry/premade/dropship/Destroy()
if(deployment_system)
deployment_system.deployed_turret = null
deployment_system = null
QDEL_NULL(linked_cam)
. = ..()

#define SENTRY_SNIPER_RANGE 10
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/is_nested = (buckled && istype(buckled, /obj/structure/bed/nest)) ? TRUE : FALSE
var/obj/structure/bed/nest/nest = FALSE
if(is_nested)
text_prompt += "\nSince you're nested, you will be given a chance to reenter your body upon being freed."
text_prompt += "\nSince you're nested, you will get a chance to reenter your body if freed."
nest = buckled
var/response = tgui_alert(src, text_prompt, "Are you sure you want to ghost?", options)
if(response == "Aghost")
Expand Down
18 changes: 7 additions & 11 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,19 @@ There are several things that need to be remembered:
if(lying == lying_prev && !force)
return
lying_prev = lying
var/matrix/M = matrix()
var/matrix/L = matrix() //Counter-rotation for langchat text.
var/matrix/new_matrix = matrix()
if(lying)
if(pulledby && pulledby.grab_level >= GRAB_CARRY)
M.Turn(90)
L.Turn(270)
new_matrix.Turn(90)
else
if(prob(50))
M.Turn(90)
L.Turn(270)
new_matrix.Turn(90)
else
M.Turn(270)
L.Turn(90)
M.Translate(rand(-10,10),rand(-10,10))
apply_transform(M)
new_matrix.Turn(270)
new_matrix.Translate(rand(-10,10), rand(-10,10))
apply_transform(new_matrix)
else
apply_transform(M)
apply_transform(new_matrix)

/mob/living/carbon/human/UpdateDamageIcon()
for(var/obj/limb/O in limbs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
can_be_shield_blocked = TRUE

/datum/action/xeno_action/activable/pounce/lurker/additional_effects_always()
var/mob/living/carbon/xenomorph/X = owner
if (!istype(X))
var/mob/living/carbon/xenomorph/xeno = owner
if (!istype(xeno))
return

if (X.mutation_type == LURKER_NORMAL)
if (xeno.mutation_type == LURKER_NORMAL)
var/found = FALSE
for (var/mob/living/carbon/human/H in get_turf(X))
for (var/mob/living/carbon/human/human in get_turf(xeno))
if(human.stat == DEAD)
continue
found = TRUE
break

if (found)
var/datum/action/xeno_action/onclick/lurker_invisibility/LIA = get_xeno_action_by_type(X, /datum/action/xeno_action/onclick/lurker_invisibility)
if (istype(LIA))
LIA.invisibility_off()
var/datum/action/xeno_action/onclick/lurker_invisibility/lurker_invis = get_xeno_action_by_type(xeno, /datum/action/xeno_action/onclick/lurker_invisibility)
if (istype(lurker_invis))
lurker_invis.invisibility_off()

/datum/action/xeno_action/activable/pounce/lurker/additional_effects(mob/living/L)
var/mob/living/carbon/xenomorph/X = owner
Expand Down
7 changes: 5 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
var/bonus_larva_spawn_chance = 1
var/hijack_burrowed_surge = FALSE //at hijack, start spawning lots of burrowed
/// how many burrowed is going to spawn during larva surge
var/hijack_burrowed_left = 0
var/hijack_burrowed_left = 0

var/ignore_slots = FALSE
var/dynamic_evolution = TRUE
Expand Down Expand Up @@ -1006,7 +1006,10 @@

/datum/hive_status/proc/can_spawn_as_hugger(mob/dead/observer/user)
if(!GLOB.hive_datum || ! GLOB.hive_datum[hivenumber])
return
return FALSE
if(jobban_isbanned(user, JOB_XENOMORPH)) // User is jobbanned
to_chat(user, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph."))
return FALSE
if(world.time < hugger_timelock)
to_chat(user, SPAN_WARNING("The hive cannot support facehuggers yet..."))
return FALSE
Expand Down
15 changes: 0 additions & 15 deletions html/changelogs/AutoChangeLog-pr-3298.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-3666.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-3675.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "TheGamerdk"
delete-after: True
changes:
- rscadd: "ARES will announce how many Foxtrot marines that woke up."
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-3717.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-3718.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-3723.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-3730.yml

This file was deleted.

Loading

0 comments on commit 5eeb1b1

Please sign in to comment.