mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
[MIRROR] Adds a check grep for using src as a trait source rather that REF(src) [MDB IGNORE] (#23264)
* Adds a check grep for using `src` as a trait source rather that `REF(src)` (#77836) ## About The Pull Request Using `src` as a trait source is an error and can often lead to hard-deletes If you wish to tie a source to a certain datum, it is common to use `REF(src)` instead. Ideally, we would lint or test for any use of a reference rather than a string in use in trait sources, but that's a bit harder to setup. Currently (from what I can see) the *only* erroneous use of references as sources are via `src`, so it being the most common error, I see it fine to lint for it. ## Changelog Nothing player facing. * Adds a check grep for using `src` as a trait source rather that `REF(src)` * Update style.dm --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
@@ -136,5 +136,5 @@
|
||||
|
||||
///Do any post-spawn edits you need to do
|
||||
/datum/shuttle_event/simple_spawner/proc/post_spawn(atom/movable/spawnee)
|
||||
ADD_TRAIT(spawnee, TRAIT_FREE_HYPERSPACE_SOFTCORDON_MOVEMENT, REF(src)) //Lets us spawn and move further away from the shuttle without being teleported into space
|
||||
ADD_TRAIT(spawnee, TRAIT_DEL_ON_SPACE_DUMP, REF(src)) //if we hit the cordon, we get deleted. If the shuttle can make you, it can qdel you
|
||||
ADD_TRAIT(spawnee, TRAIT_FREE_HYPERSPACE_SOFTCORDON_MOVEMENT, INNATE_TRAIT) //Lets us spawn and move further away from the shuttle without being teleported into space
|
||||
ADD_TRAIT(spawnee, TRAIT_DEL_ON_SPACE_DUMP, INNATE_TRAIT) //if we hit the cordon, we get deleted. If the shuttle can make you, it can qdel you
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
spawning_list = list(/obj/effect/meteor)
|
||||
|
||||
/datum/shuttle_event/simple_spawner/meteor/post_spawn(atom/movable/spawnee)
|
||||
ADD_TRAIT(spawnee, TRAIT_FREE_HYPERSPACE_MOVEMENT, src)
|
||||
..()
|
||||
. = ..()
|
||||
ADD_TRAIT(spawnee, TRAIT_FREE_HYPERSPACE_MOVEMENT, INNATE_TRAIT)
|
||||
|
||||
/datum/shuttle_event/simple_spawner/meteor/spawn_movable(spawn_type)
|
||||
var/turf/spawn_turf = get_spawn_turf()
|
||||
|
||||
Reference in New Issue
Block a user