mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user