mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 09:35:30 +01:00
[no gbp] fixes minebots crashing the server (#91746)
## About The Pull Request the element was wrongfully adding items to its list. since its meant to be a singleton, this list would get extremely large. ## Why It's Good For The Game closes #91738 ## Changelog 🆑 fix: 50 minebots no longer crash the server /🆑
This commit is contained in:
@@ -9,14 +9,10 @@
|
||||
. = ..()
|
||||
if(!isliving(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
for(var/access_path in accesses)
|
||||
if(!ispath(access_path))
|
||||
continue
|
||||
var/datum/id_trim/job/trim = SSid_access.trim_singletons_by_path[access_path]
|
||||
if(isnull(trim))
|
||||
continue
|
||||
my_access += trim.access
|
||||
|
||||
if(!length(accesses))
|
||||
stack_trace("attempted to assign an empty access list to a mob!")
|
||||
return
|
||||
my_access = accesses
|
||||
RegisterSignal(target, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access))
|
||||
|
||||
/datum/element/mob_access/proc/attempt_access(datum/source, obj/door_attempt)
|
||||
|
||||
@@ -83,10 +83,7 @@
|
||||
stored_gun = new(src)
|
||||
var/obj/item/implant/radio/mining/comms = new(src)
|
||||
comms.implant(src)
|
||||
var/static/list/accesses = list(
|
||||
/datum/id_trim/job/shaft_miner,
|
||||
)
|
||||
AddElement(/datum/element/mob_access, accesses)
|
||||
assign_access()
|
||||
|
||||
/mob/living/basic/mining_drone/set_combat_mode(new_mode, silent = TRUE)
|
||||
. = ..()
|
||||
@@ -273,3 +270,10 @@
|
||||
return
|
||||
|
||||
. += combat_mode ? combat_overlay : neutral_overlay
|
||||
|
||||
/mob/living/basic/mining_drone/proc/assign_access()
|
||||
var/static/list/required_access
|
||||
if(isnull(required_access))
|
||||
var/datum/id_trim/access_card = SSid_access.trim_singletons_by_path[/datum/id_trim/job/shaft_miner]
|
||||
required_access = access_card.access
|
||||
AddElement(/datum/element/mob_access, required_access)
|
||||
|
||||
Reference in New Issue
Block a user