Skip to content

Commit 961f4b9

Browse files
authored
Misc Borg Bugfixes (#38401)
* borgbugfix * bonus
1 parent 8544321 commit 961f4b9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

code/game/objects/items/robot/robot_upgrades.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
if(required_modules.len)
3838
if(!(R.modtype in required_modules))
39-
to_chat(user, "<span class='warning'>\The [src] will not fit into \the [R.module.name]!</span>")
39+
to_chat(user, "<span class='warning'>\The [src] is not compatible with \the [R.module.name]!</span>")
4040
return FAILED_TO_ADD
4141

4242
if(required_upgrades.len)

code/modules/mob/living/silicon/robot/robot.dm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,23 @@
251251
if(module)
252252
return
253253
var/list/modules = getModules()
254+
var/selected_module
254255
if(forced_module)
255-
modtype = forced_module
256+
selected_module = forced_module
256257
else
257-
modtype = input("Please, select a module!", "Robot", null, null) as null|anything in modules
258+
selected_module = input("Please, select a module!", "Robot", null, null) as null|anything in modules
258259
// END forced modules.
259260

261+
if(!selected_module)
262+
return
260263
if(module)
261264
return
262-
if(!(modtype in all_robot_modules))
265+
if(!(selected_module in all_robot_modules))
263266
return
264267

265-
var/module_type = all_robot_modules[modtype]
268+
var/module_type = all_robot_modules[selected_module]
266269
module = new module_type(src)
270+
modtype = selected_module
267271

268272
feedback_inc("cyborg_[lowertext(modtype)]",1)
269273
updatename()

code/modules/tgui/states.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
/mob/living/silicon/robot/shared_ui_interaction(src_object)
8181
// Disable UIs if the object isn't installed in the borg AND the borg is either locked, has a dead cell, or no cell.
8282
var/atom/device = src_object
83-
if((istype(device) && device.loc != src) && (get_cell_charge() <= 0 || lockdown))
83+
if((istype(device) && device.loc != src) && (get_cell_charge(src) <= 0 || lockdown))
8484
return UI_DISABLED
8585
return UI_INTERACTIVE
8686

0 commit comments

Comments
 (0)