mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Fixes stacks acting strange for cyborgs
Robot modules weren't handling qdel'd stacks properly, so now they simply don't get qdel'd. They shouldn't get deleted often enough for this to hurt performance. Also, the module slot of a stack will now be deselected when it's used up, and it will show up immediately when respawned while recharging.
This commit is contained in:
@@ -220,3 +220,8 @@
|
||||
while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up.
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/unEquip(obj/item/I)
|
||||
if(I == module_active)
|
||||
deselect_module(get_selected_module())
|
||||
return ..()
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
if(!stacktypes || !stacktypes.len) return
|
||||
|
||||
var/stack_respawned = 0
|
||||
for(var/T in stacktypes)
|
||||
var/O = locate(T) in src.modules
|
||||
var/obj/item/stack/S = O
|
||||
@@ -46,9 +47,12 @@
|
||||
S = new T(src)
|
||||
src.modules += S
|
||||
S.amount = 1
|
||||
stack_respawned = 1
|
||||
|
||||
if(S && S.amount < stacktypes[T])
|
||||
S.amount++
|
||||
if(stack_respawned && istype(R) && R.hud_used)
|
||||
R.hud_used.update_robot_modules_display()
|
||||
|
||||
/obj/item/weapon/robot_module/proc/rebuild()//Rebuilds the list so it's possible to add/remove items from the module
|
||||
var/list/temp_list = modules
|
||||
|
||||
Reference in New Issue
Block a user