diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm
index 389e79d15d7..5e5a38d5a3e 100644
--- a/code/defines/procs/helpers.dm
+++ b/code/defines/procs/helpers.dm
@@ -108,8 +108,8 @@
var/list/old_list = shufflelist.Copy()
while(old_list.len)
var/item = pick(old_list)
- new_list.Add(item)
- old_list.Remove(item)
+ new_list += item
+ old_list -= item
return new_list
/proc/uniquelist(var/list/L)
@@ -198,18 +198,9 @@
var/list/result = new()
while(Li <= L.len && Ri <= R.len)
if(sorttext(L[Li], R[Ri]) < 1)
- var/item = R[Ri++]
- if(istext(item) && !isnull(R[item]))
- result[item] = R[item]
- else
- result += item
-
+ result += R[Ri++]
else
- var/item = L[Li++]
- if(istext(item) && !isnull(L[item]))
- result[item] = L[item]
- else
- result += item
+ result += L[Li++]
if(Li <= L.len)
return (result + L.Copy(Li, 0))
@@ -781,35 +772,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
select = input("AI signals detected:", "AI selection") in ais
return ais[select]
-/proc/get_sorted_mobs()
- var/list/old_list = getmobs()
- var/list/AI_list = list()
- var/list/Dead_list = list()
- var/list/keyclient_list = list()
- var/list/key_list = list()
- var/list/logged_list = list()
- for(var/named in old_list)
- var/mob/M = old_list[named]
- if(issilicon(M))
- AI_list |= M
- else if(isobserver(M) || M.stat == 2)
- Dead_list |= M
- else if(M.key && M.client)
- keyclient_list |= M
- else if(M.key)
- key_list |= M
- else
- logged_list |= M
- old_list.Remove(named)
- var/list/new_list = list()
- new_list += AI_list
- new_list += keyclient_list
- new_list += key_list
- new_list += logged_list
- new_list += Dead_list
- return new_list
-
-
/proc/getmobs()
var/list/mobs = sortmobs()
@@ -840,34 +802,34 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/sortmobs()
- var/list/temp_list = list()
+ var/list/mob_list = list()
for(var/mob/living/silicon/ai/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/silicon/pai/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/silicon/robot/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/carbon/human/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/carbon/brain/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/carbon/alien/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/dead/observer/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/new_player/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/carbon/monkey/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/carbon/metroid/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
for(var/mob/living/simple_animal/M in world)
- temp_list.Add(M)
+ mob_list.Add(M)
// for(var/mob/living/silicon/hivebot/M in world)
// mob_list.Add(M)
// for(var/mob/living/silicon/hive_mainframe/M in world)
// mob_list.Add(M)
- return temp_list
+ return mob_list
/proc/convert2energy(var/M)
var/E = M*(SPEED_OF_LIGHT_SQ)
@@ -1587,4 +1549,4 @@ proc/get_opposite(var/checkdir)
var/a = copytext(text,i,i+1)
if(a == character)
count++
- return count
+ return count
\ No newline at end of file
diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm
index f65634c70ba..72761409472 100644
--- a/code/modules/admin/player_panel.dm
+++ b/code/modules/admin/player_panel.dm
@@ -5,7 +5,7 @@
dat += "
| Name/Real Name | Type | Assigned Job | Info | Options | Traitor? |
"
//add IP: | to this if wanting to add back in IP checking
//add (IP: [M.lastKnownIP]) | if you want to know their ip to the lists below
- var/list/mobs = get_sorted_mobs()
+ var/list/mobs = sortmobs()
var/i = 1
for(var/mob/M in mobs)
@@ -120,7 +120,7 @@
dat += "| Name | Real Name | Assigned Job | Key | Options | PM | Traitor? |
"
//add IP: | to this if wanting to add back in IP checking
//add (IP: [M.lastKnownIP]) | if you want to know their ip to the lists below
- var/list/mobs = get_sorted_mobs()
+ var/list/mobs = sortmobs()
for(var/mob/M in mobs)
if(!M.ckey) continue
diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm
index 6c9bee0fe0f..e9c3497c49e 100644
--- a/code/modules/admin/verbs/adminjump.dm
+++ b/code/modules/admin/verbs/adminjump.dm
@@ -28,7 +28,7 @@
alert("Admin jumping disabled")
return
-/client/proc/jumptomob()
+/client/proc/jumptomob(var/mob/M in world)
set category = "Admin"
set name = "Jump to Mob"
@@ -37,20 +37,15 @@
return
if(config.allow_admin_jump)
- var/mobs = getmobs()
- var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in mobs
- if(!selection)
- return
-
- var/mob/M = mobs[selection]
- var/mob/A = src.mob
- var/turf/T = get_turf(M)
- if(T && isturf(T))
- A.loc = T
- log_admin("[key_name(usr)] jumped to [key_name(M)]")
- message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
- else
- A << "This mob is not located in the game world."
+ log_admin("[key_name(usr)] jumped to [key_name(M)]")
+ message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
+ if(src.mob)
+ var/mob/A = src.mob
+ var/turf/T = get_turf(M)
+ if(T && isturf(T))
+ A.loc = T
+ else
+ A << "This mob is not located in the game world."
else
alert("Admin jumping disabled")
@@ -76,7 +71,7 @@
else
alert("Admin jumping disabled")
-/client/proc/Getmob()
+/client/proc/Getmob(var/mob/M in world)
set category = "Admin"
set name = "Get Mob"
set desc = "Mob to teleport"
@@ -84,19 +79,9 @@
src << "Only administrators may use this command."
return
if(config.allow_admin_jump)
- var/mobs = getmobs()
- var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in mobs
- var/mob/M = mobs[selection]
- if(!istype(M))
- return
- var/mob/A = src.mob
- var/turf/T = get_turf(A)
- if(T && isturf(T))
- M.loc = T
- log_admin("[key_name(usr)] teleported [key_name(M)]")
- message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]", 1)
- else
- A << "You are not located in the game world."
+ log_admin("[key_name(usr)] teleported [key_name(M)]")
+ message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]", 1)
+ M.loc = get_turf(usr)
else
alert("Admin jumping disabled")
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index 5ec9e14b966..f4b5783ac22 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -62,7 +62,7 @@
var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world
if("mob reference")
- var_value = input("Select reference:","Reference") as null|mob in get_sorted_mobs()
+ var_value = input("Select reference:","Reference") as null|mob in sortmobs()
if("file")
var_value = input("Pick file:","File") as null|file
@@ -127,7 +127,7 @@
var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world
if("mob reference")
- var_value = input("Select reference:","Reference") as null|mob in get_sorted_mobs()
+ var_value = input("Select reference:","Reference") as null|mob in sortmobs()
if("file")
var_value = input("Pick file:","File") as null|file
@@ -305,7 +305,7 @@
if("mob reference")
variable = input("Select reference:","Reference",\
- variable) as null|mob in get_sorted_mobs()
+ variable) as null|mob in sortmobs()
if("file")
variable = input("Pick file:","File",variable) \
@@ -547,7 +547,7 @@
O.vars[variable] = var_new
if("mob reference")
- var/var_new = input("Select reference:","Reference",O.vars[variable]) as null|mob in get_sorted_mobs()
+ var/var_new = input("Select reference:","Reference",O.vars[variable]) as null|mob in sortmobs()
if(var_new==null) return
O.vars[variable] = var_new