mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
DNA2 Bug Fixes - Part 2 (CHERRY PICK)
We discovered that most of the problems were were having was because of BYOND passing lists (e.g. SE and UI) by-ref instead of the assumed by-val. This commit adds dna.Clone() and (UI|SE).Copy() where needed. These should be used where DNA or SE/UI lists are COPIED, otherwise changes made in the reference will affect the real strand. This change also messes with the gene activation logic. Conflicts: code/game/dna/dna2_domutcheck.dm code/game/dna/genes/powers.dm
This commit is contained in:
@@ -39,12 +39,14 @@
|
||||
|
||||
//Save original dna for when the disease is cured.
|
||||
src.original_dna["name"] = affected_mob.real_name
|
||||
src.original_dna["UI"] = affected_mob.dna.UI
|
||||
src.original_dna["SE"] = affected_mob.dna.SE
|
||||
src.original_dna["UI"] = affected_mob.dna.UI.Copy()
|
||||
src.original_dna["SE"] = affected_mob.dna.SE.Copy()
|
||||
|
||||
affected_mob << "\red You don't feel like yourself.."
|
||||
affected_mob.UpdateAppearance(strain_data["UI"])
|
||||
affected_mob.dna.SE = strain_data["SE"]
|
||||
var/list/newUI=strain_data["UI"]
|
||||
var/list/newSE=strain_data["SE"]
|
||||
affected_mob.UpdateAppearance(newUI.Copy())
|
||||
affected_mob.dna.SE = newSE.Copy()
|
||||
affected_mob.dna.UpdateSE()
|
||||
affected_mob.real_name = strain_data["name"]
|
||||
domutcheck(affected_mob)
|
||||
@@ -56,8 +58,10 @@
|
||||
|
||||
/datum/disease/dnaspread/Del()
|
||||
if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"]))
|
||||
affected_mob.UpdateAppearance(original_dna["UI"])
|
||||
affected_mob.dna.SE = original_dna["SE"]
|
||||
var/list/newUI=original_dna["UI"]
|
||||
var/list/newSE=original_dna["SE"]
|
||||
affected_mob.UpdateAppearance(newUI.Copy())
|
||||
affected_mob.dna.SE = newSE.Copy()
|
||||
affected_mob.dna.UpdateSE()
|
||||
affected_mob.real_name = original_dna["name"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user