Robot code clean up and fixes.

Fixes runtime when a borg is reset.
Fixes issue where /proc/select_active_ai_with_fewest_borgs() would not always return the intended AI.
Fixes issues with new borgs spamming the master AI with creation messages under some circumstances.
This commit is contained in:
PsiOmega
2015-03-10 13:37:20 +01:00
parent d3d9e0b2ed
commit 533ccef0ab
11 changed files with 43 additions and 37 deletions
@@ -226,7 +226,6 @@
feedback_inc("cyborg_birth",1)
callHook("borgify", list(O))
O.notify_ai(1)
O.Namepick()
del(src)
@@ -36,12 +36,12 @@
icon = 'icons/mob/custom-synthetic.dmi'
R.icon_state = "[R.ckey]-Standard"
del(R.module)
R.notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, R.module.name)
R.module = null
R.camera.remove_networks(list("Engineering","Medical","MINE"))
R.updatename("Default")
R.status_flags |= CANPUSH
R.updateicon()
R.notify_ai(2)
return 1
@@ -57,7 +57,7 @@
/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R)
if(..()) return 0
R.notify_ai(3, R.name, heldname)
R.notify_ai(ROBOT_NOTIFICATION_NEW_NAME, R.name, heldname)
R.name = heldname
R.custom_name = heldname
R.real_name = heldname
@@ -84,7 +84,7 @@
R.stat = CONSCIOUS
dead_mob_list -= R
living_mob_list |= R
R.notify_ai(1)
R.notify_ai(ROBOT_NOTIFICATION_NEW_UNIT)
return 1