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-06 23:07:35 -08:00
committed by Ccomp5950
parent 1088888791
commit fa20b9c2ee
22 changed files with 240 additions and 414 deletions

View File

@@ -273,7 +273,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has made [M.key] a changeling.")
spawn(10)
M.absorbed_dna[M.real_name] = M.dna
M.absorbed_dna[M.real_name] = M.dna.Clone()
M.make_changeling()
if(M.mind)
M.mind.special_role = "Changeling"
@@ -986,3 +986,19 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
usr << list2text(dead_mob_list,",")
if("Clients")
usr << list2text(clients,",")
// DNA2 - Admin Hax
/client/proc/cmd_admin_toggle_block(var/mob/M,var/block)
if(!ticker)
alert("Wait until the game starts")
return
if(istype(M, /mob/living/carbon))
M.dna.SetSEState(block,!M.dna.GetSEState(block))
domutcheck(M,null,MUTCHK_FORCED)
M.update_mutations()
var/state="[M.dna.GetSEState(block)?"on":"off"]"
var/blockname=assigned_blocks[block]
message_admins("[key_name_admin(src)] has toggled [M.key]'s [blockname] block [state]!")
log_admin("[key_name(src)] has toggled [M.key]'s [blockname] block [state]!")
else
alert("Invalid mob")