mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Fixes more input sort runtimes (#47957)
* Fixes another sorting runtiming. * sortNames copy list, another wrong sort.
This commit is contained in:
@@ -353,7 +353,7 @@
|
||||
|
||||
//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
|
||||
/proc/sortNames(list/L, order=1)
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
|
||||
return sortTim(L.Copy(), order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
|
||||
|
||||
|
||||
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
||||
|
||||
@@ -1036,7 +1036,7 @@
|
||||
var/mob/living/L = I
|
||||
da_list[L.real_name] = L
|
||||
|
||||
var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in sortNames(da_list)
|
||||
var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in sortList(da_list)
|
||||
|
||||
choice = da_list[choice]
|
||||
|
||||
|
||||
@@ -964,7 +964,7 @@
|
||||
for(var/i in artpaths)
|
||||
var/datum/martial_art/M = i
|
||||
artnames[initial(M.name)] = M
|
||||
var/result = input(usr, "Choose the martial art to teach","JUDO CHOP") as null|anything in sortNames(artnames)
|
||||
var/result = input(usr, "Choose the martial art to teach","JUDO CHOP") as null|anything in sortList(artnames, /proc/cmp_typepaths_asc)
|
||||
if(!usr)
|
||||
return
|
||||
if(QDELETED(src))
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
var/toggle = FALSE
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/ranged/ToggleMode()
|
||||
if(src.loc == summoner)
|
||||
if(loc == summoner)
|
||||
if(toggle)
|
||||
ranged = initial(ranged)
|
||||
melee_damage_lower = initial(melee_damage_lower)
|
||||
@@ -83,12 +83,12 @@
|
||||
set name = "Set Surveillance Snare"
|
||||
set category = "Guardian"
|
||||
set desc = "Set an invisible snare that will alert you when living creatures walk over it. Max of 5"
|
||||
if(src.snares.len <6)
|
||||
var/turf/snare_loc = get_turf(src.loc)
|
||||
if(snares.len <6)
|
||||
var/turf/snare_loc = get_turf(loc)
|
||||
var/obj/effect/snare/S = new /obj/effect/snare(snare_loc)
|
||||
S.spawner = src
|
||||
S.name = "[get_area(snare_loc)] snare ([rand(1, 1000)])"
|
||||
src.snares |= S
|
||||
snares |= S
|
||||
to_chat(src, "<span class='danger'><B>Surveillance snare deployed!</span></B>")
|
||||
else
|
||||
to_chat(src, "<span class='danger'><B>You have too many snares deployed. Remove some first.</span></B>")
|
||||
@@ -97,9 +97,9 @@
|
||||
set name = "Remove Surveillance Snare"
|
||||
set category = "Guardian"
|
||||
set desc = "Disarm unwanted surveillance snares."
|
||||
var/picked_snare = input(src, "Pick which snare to remove", "Remove Snare") as null|anything in sortNames(src.snares)
|
||||
var/picked_snare = input(src, "Pick which snare to remove", "Remove Snare") as null|anything in sortNames(snares)
|
||||
if(picked_snare)
|
||||
src.snares -= picked_snare
|
||||
snares -= picked_snare
|
||||
qdel(picked_snare)
|
||||
to_chat(src, "<span class='danger'><B>Snare disarmed.</span></B>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user