Skip to content

Commit

Permalink
Fix some runtimes & posibrain oddities
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaers committed Jun 20, 2015
1 parent 088be52 commit 96dfb72
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
2 changes: 2 additions & 0 deletions code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ Pipelines + Other Objects -> Pipe network
qdel(src)

/obj/machinery/atmospherics/proc/nullifyPipenet(datum/pipeline/P)
if(!P)
return
P.other_atmosmch -= src

/obj/machinery/atmospherics/proc/getpipeimage(var/iconset, var/iconstate, var/direction, var/col=rgb(255,255,255))
Expand Down
2 changes: 2 additions & 0 deletions code/ATMOSPHERICS/components/unary_devices/unary_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Housekeeping and pipe network stuff below

/obj/machinery/atmospherics/unary/nullifyPipenet()
..()
if(!parent)
return
parent.other_airs -= air_contents
parent = null

Expand Down
2 changes: 2 additions & 0 deletions code/ATMOSPHERICS/datum_pipeline.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ var/pipenetwarnings = 10

for(var/i=1;i<=PL.len;i++)
var/datum/pipeline/P = PL[i]
if(!P)
return
GL += P.air
GL += P.other_airs
for(var/obj/machinery/atmospherics/binary/valve/V in P.other_atmosmch)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
var/obj/screen/alert/path_as_obj = text2path("/obj/screen/alert/[id]")
// BYOND magic-fu - we'll be storing a path in this reference and retrieving vars from it.
if(!path_as_obj)
ERROR("[src] threw alert [category] with invalid path /obj/screen/alert/[id]")
// ERROR("[src] threw alert [category] with invalid path /obj/screen/alert/[id]")
return 0
alert.name = initial(path_as_obj.name)
alert.desc = initial(path_as_obj.desc)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,8 @@ var/list/admin_verbs_hideable = list(
var/list/Lines = file2list("config/admins.txt")
for(var/line in Lines)
var/list/splitline = text2list(line, " = ")
if(splitline.len >= 2)
if(cmptext(splitline[1], src.ckey))
if(lowertext(splitline[1]) == ckey)
if(splitline.len >= 2)
rank = ckeyEx(splitline[2])
break
continue
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/brain/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
O.show_message(text("<span class='userdanger'>[]'s MMI flatlines!</span>", src), 1, "<span class='danger'>You hear something flatline.</span>", 2)
if(istype(src,/obj/item/organ/brain/alien))
container.icon_state = "mmi_alien_dead"
if(istype(container, /obj/item/device/mmi/posibrain))
container.icon_state = "posibrain"
else
container.icon_state = "mmi_dead"
stat = DEAD
Expand Down
29 changes: 20 additions & 9 deletions code/modules/mob/living/carbon/brain/posibrain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ var/global/posibrain_notif_cooldown = 0
if((brainmob && brainmob.key) || jobban_isbanned(user,"posibrain") || istype(src.loc, /mob/living/silicon))
return


var/posi_ask = alert("Become a positronic brain? (Warning, You can no longer be cloned, and all past lives will be forgotten!)","Are you positive?","Yes","No")
if(posi_ask == "No" || gc_destroyed)
return
if((brainmob && brainmob.key) || istype(src.loc, /mob/living/silicon)) //Prevents hostile takeover if two ghosts get the prompt for the same brain.
user << "This brain has already been taken! Please try your possesion again later!"
return
create_brainmob()

transfer_personality(user)

/obj/item/device/mmi/posibrain/transfer_identity(var/mob/living/carbon/H)
Expand Down Expand Up @@ -84,7 +90,6 @@ var/global/posibrain_notif_cooldown = 0
notified = 0
brainmob.mind = candidate.mind
brainmob.ckey = candidate.ckey
brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI","HBL","MSO","RR"))]-[rand(100, 999)]" //Re-initialize the name so it doesn't repeat
name = "positronic brain ([brainmob.name])"

// brainmob.mind.remove_all_antag()
Expand Down Expand Up @@ -127,14 +132,6 @@ var/global/posibrain_notif_cooldown = 0

/obj/item/device/mmi/posibrain/New()

brainmob = new(src)
brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI","HBL","MSO","RR"))]-[rand(100, 999)]" //I bet these initial are references to tg admins, we could use some new ones
brainmob.real_name = brainmob.name
brainmob.loc = src
brainmob.container = src
brainmob.stat = 0
brainmob.silent = 0
dead_mob_list -= brainmob
ping_ghosts("created")

..()
Expand All @@ -154,3 +151,17 @@ var/global/posibrain_notif_cooldown = 0
icon_state = "posibrain-occupied"
else
icon_state = "posibrain"


/obj/item/device/mmi/posibrain/proc/create_brainmob()
if(brainmob)
qdel(brainmob)
brainmob = null //empty it out first
brainmob = new(src)
brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI","HBL","MSO","RR"))]-[rand(100, 999)]"
brainmob.real_name = brainmob.name
brainmob.loc = src
brainmob.container = src
brainmob.stat = 0
brainmob.silent = 0
dead_mob_list -= brainmob
2 changes: 2 additions & 0 deletions code/modules/reagents/Chemistry-Holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ datum/reagents/proc/trans_to(var/obj/target, var/amount=1, var/multiplier=1, var
return
R = target.reagents
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
if(!total_volume) //well why are we here anyways?
return
var/part = amount / src.total_volume
var/trans_data = null
for (var/datum/reagent/current_reagent in src.reagent_list)
Expand Down

0 comments on commit 96dfb72

Please sign in to comment.