mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
-Added a purchasing log for uplinks. To view it, view the variables of the item with the uplink, navigate to hidden_uplink, click on it and then look at the purchase log variable.
-Sorted the following admin commands/verbs: Get Key, Get Mob, Jump to Area, Jump to Key, Jump to Mob, Player Panel, Player Panel New, Send Mob, Show Player Panel, Show Traitor Panel -Because of the recent player poll, electrified grilles will now shock you when you bump into them. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4560 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -173,6 +173,29 @@ proc/listclearnulls(list/list)
|
||||
K += item
|
||||
return K
|
||||
|
||||
//Mergesort: divides up the list into halves to begin the sort
|
||||
/proc/sortKey(var/list/client/L, var/order = 1)
|
||||
if(isnull(L) || L.len < 2)
|
||||
return L
|
||||
var/middle = L.len / 2 + 1
|
||||
return mergeKey(sortKey(L.Copy(0,middle)), sortKey(L.Copy(middle)), order)
|
||||
|
||||
//Mergsort: does the actual sorting and returns the results back to sortAtom
|
||||
/proc/mergeKey(var/list/client/L, var/list/client/R, var/order = 1)
|
||||
var/Li=1
|
||||
var/Ri=1
|
||||
var/list/result = new()
|
||||
while(Li <= L.len && Ri <= R.len)
|
||||
var/client/rL = L[Li]
|
||||
var/client/rR = R[Ri]
|
||||
if(sorttext(rL.ckey, rR.ckey) == order)
|
||||
result += L[Li++]
|
||||
else
|
||||
result += R[Ri++]
|
||||
|
||||
if(Li <= L.len)
|
||||
return (result + L.Copy(Li, 0))
|
||||
return (result + R.Copy(Ri, 0))
|
||||
|
||||
//Mergesort: divides up the list into halves to begin the sort
|
||||
/proc/sortAtom(var/list/atom/L, var/order = 1)
|
||||
|
||||
@@ -403,30 +403,31 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
return creatures
|
||||
|
||||
//Orders mobs by type
|
||||
//Orders mobs by type then by name
|
||||
/proc/sortmobs()
|
||||
var/list/moblist = list()
|
||||
for(var/mob/living/silicon/ai/M in mob_list)
|
||||
var/list/sortmob = sortAtom(mob_list)
|
||||
for(var/mob/living/silicon/ai/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/silicon/pai/M in mob_list)
|
||||
for(var/mob/living/silicon/pai/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/silicon/robot/M in mob_list)
|
||||
for(var/mob/living/silicon/robot/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/carbon/human/M in mob_list)
|
||||
for(var/mob/living/carbon/human/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/carbon/brain/M in mob_list)
|
||||
for(var/mob/living/carbon/brain/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/carbon/alien/M in mob_list)
|
||||
for(var/mob/living/carbon/alien/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/dead/observer/M in mob_list)
|
||||
for(var/mob/dead/observer/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/new_player/M in mob_list)
|
||||
for(var/mob/new_player/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/carbon/monkey/M in mob_list)
|
||||
for(var/mob/living/carbon/monkey/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/carbon/metroid/M in mob_list)
|
||||
for(var/mob/living/carbon/metroid/M in sortmob)
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/simple_animal/M in mob_list)
|
||||
for(var/mob/living/simple_animal/M in sortmob)
|
||||
moblist.Add(M)
|
||||
// for(var/mob/living/silicon/hivebot/M in world)
|
||||
// mob_list.Add(M)
|
||||
@@ -766,6 +767,17 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
|
||||
if(A.vars.Find(lowertext(varname))) return 1
|
||||
else return 0
|
||||
|
||||
//Returns: all the areas in the world
|
||||
/proc/return_areas()
|
||||
var/list/area/areas = list()
|
||||
for(var/area/A in world)
|
||||
areas += A
|
||||
return areas
|
||||
|
||||
//Returns: all the areas in the world, sorted.
|
||||
/proc/return_sorted_areas()
|
||||
return sortAtom(return_areas())
|
||||
|
||||
//Takes: Area type as text string or as typepath OR an instance of the area.
|
||||
//Returns: A list of all areas of that type in the world.
|
||||
/proc/get_areas(var/areatype)
|
||||
|
||||
Reference in New Issue
Block a user