Fixes item quirks giving items on charslot change (#5671)

## About The Pull Request

Title.

Closes https://github.com/Bubberstation/Bubberstation/issues/5632

The exact implementation is a new variable on quirks that qdels the
items they spawn or early returns if its a path.

Family heirloom and medicine allergy are exempt.

## Why It's Good For The Game

bugs bad
## Proof Of Testing
<details>
<summary>Screenshots/Videos</summary>

<img width="1556" height="628" alt="image"
src="https://github.com/user-attachments/assets/0162d509-4dab-48a5-8a78-ded340fad641"
/>

ignore the runtimes thats a tg error

</details>

## Changelog
🆑
fix: Item quirks no longer give items on char slot change
/🆑
This commit is contained in:
nikothedude
2026-05-31 18:29:01 +02:00
committed by GitHub
parent c2aba7a814
commit 2729331d93
9 changed files with 32 additions and 5 deletions
+8
View File
@@ -224,6 +224,14 @@
* * notify_player - If TRUE, adds strings to where_items_spawned list to be output to the player in [/datum/quirk/item_quirk/post_add()]
*/
/datum/quirk/item_quirk/proc/give_item_to_holder(obj/item/quirk_item, list/valid_slots, flavour_text = null, default_location = "at your feet", notify_player = FALSE)
// BUBBER EDIT ADDITION BEGIN - dont give items on quirk reapply
if (item_giving_paused && !always_spawn_item)
if (ispath(quirk_item))
return // nothing needs to be done
qdel(quirk_item)
return
// BUBBER EDIT ADDITION END
if(ispath(quirk_item))
quirk_item = new quirk_item(get_turf(quirk_holder))
@@ -230,7 +230,7 @@
var/datum/species/ethereal/ethereal = patient.dna.species
ethereal.refresh_light_color(patient)
open_machine()
SSquirks.OverrideQuirks(patient, patient.client)
SSquirks.OverrideQuirks(patient, patient.client, spawn_items = FALSE)
/// Ejection and shut down of the machine, used before the preferences have been applied to the player. Damage optional.
/obj/machinery/self_actualization_device/proc/eject_old_you(damaged_goods = FALSE)
@@ -4,7 +4,7 @@
var/cleanup = TRUE
/// Remove any quirks that the client's prefs do not have, and apply any new ones
/datum/controller/subsystem/processing/quirks/proc/OverrideQuirks(mob/living/user, client/applied_client)
/datum/controller/subsystem/processing/quirks/proc/OverrideQuirks(mob/living/user, client/applied_client, spawn_items = TRUE)
var/list/required_quirks = applied_client.prefs.all_quirks
var/list/present_quirks = list()
for(var/datum/quirk/quirk in user.quirks)
@@ -16,5 +16,8 @@
var/existing_quirk = present_quirks[quirk_name]
var/quirk_type = quirks[quirk_name]
var/datum/quirk/quirk = new quirk_type
if (!spawn_items)
quirk.set_item_giving_paused(TRUE)
quirk.add_to_holder(user, existing_quirk, applied_client)
quirk.set_item_giving_paused(FALSE)
@@ -6,6 +6,18 @@
/// Whitelist of species for this quirk
var/list/species_whitelist = null
/datum/quirk/item_quirk
/// If TRUE, giving an item to our holder will instead delete it. Used for quirk reapplying.
var/item_giving_paused = FALSE
/// if TRUE, item_giving_paused is ignored.
var/always_spawn_item = FALSE
/datum/quirk/proc/set_item_giving_paused(new_value)
return
/datum/quirk/item_quirk/set_item_giving_paused(new_value)
item_giving_paused = new_value
/datum/quirk/is_species_appropriate(datum/species/mob_species)
if(LAZYLEN(species_blacklist) && (mob_species.id in species_blacklist))
return FALSE
@@ -0,0 +1,2 @@
/datum/quirk/item_quirk/allergic
always_spawn_item = TRUE
@@ -7,6 +7,7 @@ GLOBAL_LIST_INIT(invalid_heirloom_types, typecacheof(list(
/datum/quirk/item_quirk/family_heirloom
/// The temporary mark action we give to users who have opted out of random items.
var/datum/action/mark_family_heirloom/mark_action
always_spawn_item = TRUE
/datum/quirk/item_quirk/family_heirloom/remove()
. = ..()
@@ -45,7 +45,7 @@
target_client.prefs.safe_transfer_prefs_to_with_damage(human_owner)
human_owner.real_name = name
human_owner.name = name
SSquirks.OverrideQuirks(human_owner, target_client)
SSquirks.OverrideQuirks(human_owner, target_client, spawn_items = FALSE)
human_owner.dna.update_dna_identity()
target_client.prefs.load_character(lycan_brain.last_slot)
@@ -73,7 +73,7 @@
else
target_client.prefs.load_character(lycan_brain.last_slot)
target_client.prefs.safe_transfer_prefs_to_with_damage(human_owner)
SSquirks.OverrideQuirks(human_owner, target_client)
SSquirks.OverrideQuirks(human_owner, target_client, spawn_items = FALSE)
human_owner.dna.update_dna_identity()
else
human_owner.set_species(initial_species, TRUE, TRUE, FALSE)
@@ -700,7 +700,7 @@
target.apply_status_effect(/datum/status_effect/shapeshift_transformed, original_name)
char_source.safe_transfer_prefs_to_with_damage(target)
target.dna.update_dna_identity()
SSquirks.OverrideQuirks(target, char_source.parent)
SSquirks.OverrideQuirks(target, char_source.parent, spawn_items = FALSE)
var/output = "[key_name(target)] has been transformed by [key_name(alterer)] using polymorph, at [loc_name(target)]. Original Name: [original_name], New Name: [target.dna.real_name]."
message_admins(output)
+1
View File
@@ -9046,6 +9046,7 @@
#include "modular_zubbers\code\datums\mutations\visuals_override.dm"
#include "modular_zubbers\code\datums\quirks\_quirk.dm"
#include "modular_zubbers\code\datums\quirks\negative_quirks\all_nighter.dm"
#include "modular_zubbers\code\datums\quirks\negative_quirks\allergies.dm"
#include "modular_zubbers\code\datums\quirks\negative_quirks\blooddeficiency.dm"
#include "modular_zubbers\code\datums\quirks\negative_quirks\bloodloss_dusting.dm"
#include "modular_zubbers\code\datums\quirks\negative_quirks\brainproblems.dm"