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:
Rob Nelson
2014-02-10 22:46:28 -06:00
committed by Ccomp5950
parent 1088888791
commit fa20b9c2ee
22 changed files with 240 additions and 414 deletions
@@ -28,7 +28,7 @@
brainmob = new(src)
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = H.dna
brainmob.dna = H.dna.Clone()
brainmob.timeofhostdeath = H.timeofdeath
if(H.mind)
H.mind.transfer_to(brainmob)
@@ -365,8 +365,18 @@ proc/get_damage_icon_part(damage_state, body_part)
var/add_image = 0
var/g = "m"
if(gender == FEMALE) g = "f"
// DNA2 - Drawing underlays.
for(var/datum/dna/gene/gene in dna_genes)
if(!gene.block)
continue
if(gene.is_active(src))
var/underlay=gene.OnDrawUnderlays(src,g,fat)
if(underlay)
standing.underlays += underlay
add_image = 1
for(var/mut in mutations)
switch(mut)
/*
if(HULK)
if(fat)
standing.underlays += "hulk_[fat]_s"
@@ -379,6 +389,7 @@ proc/get_damage_icon_part(damage_state, body_part)
if(TK)
standing.underlays += "telekinesishead[fat]_s"
add_image = 1
*/
if(LASER)
standing.overlays += "lasereyes_s"
add_image = 1
@@ -41,7 +41,7 @@
M.real_name = src.real_name
if(src.dna)
M.dna = src.dna
M.dna = src.dna.Clone()
if(mind)
mind.transfer_to(M)
+3 -4
View File
@@ -29,10 +29,9 @@
O = new species.primitive(loc)
O.dna = dna
//O.dna.uni_identity = "000000000000000000DC00000660004DA0A0E00"
//O.dna.struc_enzymes = "[copytext(O.dna.struc_enzymes,1,1+3*(STRUCDNASIZE-1))]BB8"
O.dna = dna.Clone()
O.dna.SetSEState(MONKEYBLOCK,1)
O.dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF)
O.loc = loc
O.viruses = viruses
O.a_intent = "hurt"
@@ -166,7 +165,7 @@
mind.transfer_to(O)
if(O.mind.assigned_role == "Cyborg")
O.mind.original = O
else if(mind.special_role)
else if(mind&&mind.special_role)
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
else
O.key = key