mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 20:37:34 +01:00
DNA2 Bug Fixes - Part 2
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.
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
if (!(NOCLONE in M.mutations)) // prevents drained people from having their DNA changed
|
||||
if (buf.types & DNA2_BUF_UI)
|
||||
if (!block) //isolated block?
|
||||
M.UpdateAppearance(buf.dna)
|
||||
M.UpdateAppearance(buf.dna.UI.Copy())
|
||||
if (buf.types & DNA2_BUF_UE) //unique enzymes? yes
|
||||
M.real_name = buf.dna.real_name
|
||||
M.name = buf.dna.real_name
|
||||
@@ -83,7 +83,7 @@
|
||||
uses--
|
||||
if (buf.types & DNA2_BUF_SE)
|
||||
if (!block) //isolated block?
|
||||
M.dna.SE = buf.dna.SE
|
||||
M.dna.SE = buf.dna.SE.Copy()
|
||||
M.dna.UpdateSE()
|
||||
else
|
||||
M.dna.SetSEValue(block,src.GetValue())
|
||||
|
||||
Reference in New Issue
Block a user