Overhauls and 2/28 sync (#244)
* map tweaks/shuttle engines * helpers and defines * global/onclick * controllers and datums * mapping * game folder * some other stuff * some modules * modules that aren't mobs * some mob stuff * new player stuff * mob living * silicon stuff * simple animal things * carbon/ayylmao * update_icons * carbon/human * sounds and tools * icons and stuff * hippie grinder changes + tgui * kitchen.dmi * compile issues fixed * mapfix * Mapfixes 2.0 * mapedit2.0 * mapmerger pls * Revert "mapedit2.0" This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481. * clean up vore folder + 2 hotfixes * admin ticket refinement * Blob tweaks and LAZYADD * LAZYADD IS LAZY * Magic strings purged * DEFINES NEED HIGHER PRIORITIES * Only a sleepless idiot deals in absolute TRUE|FALSE * u h g * progress bar fix * reverts ticket logs * there's always that one guy * fixes and stuff * 2/27 fixes * game folder stuff * stats * some modules again * clothing stuff gets vg clothing out of the main files * everything not mobs again * mob stuff * maps, tgui, sql stuff * icons * additional fixes and compile errors * don't need this anymore * Oh right this isn't needed anymore * maint bar re-added * that doesn't need to be here * stupid events * wtfeven * probably makes Travis happy * don't care to fix the grinder atm * fixes vending sprites, changes turret * lethal, not lethals * overylays are finicky creatures * lazy fix for bleeding edgy (#252) * map tweaks/shuttle engines * helpers and defines * global/onclick * controllers and datums * mapping * game folder * some other stuff * some modules * modules that aren't mobs * some mob stuff * new player stuff * mob living * silicon stuff * simple animal things * carbon/ayylmao * update_icons * carbon/human * sounds and tools * icons and stuff * hippie grinder changes + tgui * kitchen.dmi * compile issues fixed * mapfix * Mapfixes 2.0 * mapedit2.0 * mapmerger pls * Revert "mapedit2.0" This reverts commit 74139a3cacea10df7aafca06c0a10bd3daf3a481. * clean up vore folder + 2 hotfixes * admin ticket refinement * Blob tweaks and LAZYADD * LAZYADD IS LAZY * Magic strings purged * DEFINES NEED HIGHER PRIORITIES * Only a sleepless idiot deals in absolute TRUE|FALSE * u h g * progress bar fix * reverts ticket logs * there's always that one guy * fixes and stuff * 2/27 fixes * game folder stuff * stats * some modules again * clothing stuff gets vg clothing out of the main files * everything not mobs again * mob stuff * maps, tgui, sql stuff * icons * additional fixes and compile errors * don't need this anymore * Oh right this isn't needed anymore * maint bar re-added * that doesn't need to be here * stupid events * wtfeven * probably makes Travis happy * don't care to fix the grinder atm * fixes vending sprites, changes turret * lethal, not lethals * overylays are finicky creatures
This commit is contained in:
@@ -465,4 +465,35 @@
|
||||
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
|
||||
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null)
|
||||
#define LAZYLEN(L) length(L)
|
||||
#define LAZYCLEARLIST(L) if(L) L.Cut()
|
||||
#define LAZYCLEARLIST(L) if(L) L.Cut()
|
||||
|
||||
/* Definining a counter as a series of key -> numeric value entries
|
||||
|
||||
* All these procs modify in place.
|
||||
*/
|
||||
|
||||
/proc/counterlist_scale(list/L, scalar)
|
||||
var/list/out = list()
|
||||
for(var/key in L)
|
||||
out[key] = L[key] * scalar
|
||||
. = out
|
||||
|
||||
/proc/counterlist_sum(list/L)
|
||||
. = 0
|
||||
for(var/key in L)
|
||||
. += L[key]
|
||||
|
||||
/proc/counterlist_normalise(list/L)
|
||||
var/avg = counterlist_sum(L)
|
||||
if(avg != 0)
|
||||
. = counterlist_scale(L, 1 / avg)
|
||||
else
|
||||
. = L
|
||||
|
||||
/proc/counterlist_combine(list/L1, list/L2)
|
||||
for(var/key in L2)
|
||||
var/other_value = L2[key]
|
||||
if(key in L1)
|
||||
L1[key] += other_value
|
||||
else
|
||||
L1[key] = other_value
|
||||
@@ -22,9 +22,15 @@
|
||||
if (config.log_admin)
|
||||
diary << "\[[time_stamp()]]ADMIN: [text]"
|
||||
|
||||
//Items using this proc are stripped from public logs - use with caution
|
||||
/proc/log_admin_private(text)
|
||||
admin_log.Add(text)
|
||||
if (config.log_admin)
|
||||
diary << "\[[time_stamp()]]ADMINPRIVATE: [text]"
|
||||
|
||||
/proc/log_adminsay(text)
|
||||
if (config.log_adminchat)
|
||||
log_admin("ASAY: [text]")
|
||||
log_admin_private("ASAY: [text]")
|
||||
|
||||
/proc/log_dsay(text)
|
||||
if (config.log_adminchat)
|
||||
@@ -108,4 +114,4 @@
|
||||
if(istype(T))
|
||||
return "[A.loc] [COORD(T)] ([A.loc.type])"
|
||||
else if(A.loc)
|
||||
return "[A.loc] (0, 0, 0) ([A.loc.type])"
|
||||
return "[A.loc] (0, 0, 0) ([A.loc.type])"
|
||||
|
||||
@@ -17,12 +17,6 @@
|
||||
var/area/Y = get_area(X)
|
||||
return Y.name
|
||||
|
||||
/proc/get_area_master(O)
|
||||
var/area/A = get_area(O)
|
||||
if(A && A.master)
|
||||
A = A.master
|
||||
return A
|
||||
|
||||
/proc/get_area_by_name(N) //get area by its name
|
||||
for(var/area/A in world)
|
||||
if(A.name == N)
|
||||
@@ -81,13 +75,13 @@
|
||||
return heard
|
||||
|
||||
/proc/alone_in_area(area/the_area, mob/must_be_alone, check_type = /mob/living/carbon)
|
||||
var/area/our_area = get_area_master(the_area)
|
||||
var/area/our_area = get_area(the_area)
|
||||
for(var/C in living_mob_list)
|
||||
if(!istype(C, check_type))
|
||||
continue
|
||||
if(C == must_be_alone)
|
||||
continue
|
||||
if(our_area == get_area_master(C))
|
||||
if(our_area == get_area(C))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
@@ -238,32 +238,31 @@
|
||||
else if(adjacencies & N_EAST)
|
||||
se = "4-e"
|
||||
|
||||
var/list/New = list()
|
||||
var/list/New
|
||||
|
||||
if(A.top_left_corner != nw)
|
||||
A.overlays -= A.top_left_corner
|
||||
A.cut_overlay(A.top_left_corner)
|
||||
A.top_left_corner = nw
|
||||
New += nw
|
||||
LAZYADD(New, nw)
|
||||
|
||||
if(A.top_right_corner != ne)
|
||||
A.overlays -= A.top_right_corner
|
||||
A.cut_overlay(A.top_right_corner)
|
||||
A.top_right_corner = ne
|
||||
New += ne
|
||||
LAZYADD(New, ne)
|
||||
|
||||
if(A.bottom_right_corner != sw)
|
||||
A.overlays -= A.bottom_right_corner
|
||||
A.cut_overlay(A.bottom_right_corner)
|
||||
A.bottom_right_corner = sw
|
||||
New += sw
|
||||
LAZYADD(New, sw)
|
||||
|
||||
if(A.bottom_left_corner != se)
|
||||
A.overlays -= A.bottom_left_corner
|
||||
A.cut_overlay(A.bottom_left_corner)
|
||||
A.bottom_left_corner = se
|
||||
New += se
|
||||
|
||||
if(New.len)
|
||||
LAZYADD(New, se)
|
||||
|
||||
if(New)
|
||||
A.add_overlay(New)
|
||||
|
||||
|
||||
/proc/find_type_in_direction(atom/source, direction)
|
||||
var/turf/target_turf = get_step(source, direction)
|
||||
if(!target_turf)
|
||||
@@ -312,13 +311,13 @@
|
||||
queue_smooth(A)
|
||||
|
||||
/atom/proc/clear_smooth_overlays()
|
||||
overlays -= top_left_corner
|
||||
cut_overlay(top_left_corner)
|
||||
top_left_corner = null
|
||||
overlays -= top_right_corner
|
||||
cut_overlay(top_right_corner)
|
||||
top_right_corner = null
|
||||
overlays -= bottom_right_corner
|
||||
cut_overlay(bottom_right_corner)
|
||||
bottom_right_corner = null
|
||||
overlays -= bottom_left_corner
|
||||
cut_overlay(bottom_left_corner)
|
||||
bottom_left_corner = null
|
||||
|
||||
/atom/proc/replace_smooth_overlays(nw, ne, sw, se)
|
||||
|
||||
@@ -943,27 +943,6 @@ var/global/list/friendly_animal_types = list()
|
||||
return J
|
||||
return 0
|
||||
|
||||
/atom/proc/cut_overlays()
|
||||
overlays.Cut()
|
||||
overlays += priority_overlays
|
||||
|
||||
/atom/proc/add_overlay(image, priority = 0)
|
||||
var/list/new_overlays = overlays.Copy()
|
||||
new_overlays -= image
|
||||
if(priority)
|
||||
if(!priority_overlays)
|
||||
priority_overlays = list()
|
||||
priority_overlays += image
|
||||
new_overlays += image
|
||||
else
|
||||
if(priority_overlays)
|
||||
new_overlays -= priority_overlays
|
||||
new_overlays += image
|
||||
new_overlays += priority_overlays
|
||||
else
|
||||
new_overlays += image
|
||||
overlays = new_overlays
|
||||
|
||||
var/global/list/humanoid_icon_cache = list()
|
||||
//For creating consistent icons for human looking simple animals
|
||||
/proc/get_flat_human_icon(var/icon_id,var/outfit,var/datum/preferences/prefs)
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
//return 1
|
||||
|
||||
//returns timestamp in a sql and ISO 8601 friendly format
|
||||
/proc/SQLtime()
|
||||
return time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
|
||||
/proc/SQLtime(timevar)
|
||||
if(!timevar)
|
||||
timevar = world.realtime
|
||||
return time2text(timevar, "YYYY-MM-DD hh:mm:ss")
|
||||
|
||||
|
||||
/var/midnight_rollovers = 0
|
||||
|
||||
@@ -1191,7 +1191,7 @@ B --><-- A
|
||||
return
|
||||
A.add_overlay(I)
|
||||
sleep(duration)
|
||||
A.overlays -= I
|
||||
A.cut_overlay(I)
|
||||
|
||||
/proc/get_areas_in_z(zlevel)
|
||||
. = list()
|
||||
@@ -1286,6 +1286,7 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
|
||||
#define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255)))
|
||||
|
||||
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE)
|
||||
#define QDEL_NULL(item) qdel(item); item = null
|
||||
|
||||
/proc/random_nukecode()
|
||||
var/val = rand(0, 99999)
|
||||
@@ -1336,3 +1337,59 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
|
||||
if(W.ini_dir == dir_to_check || W.ini_dir == FULLTILE_WINDOW_DIR || dir_to_check == FULLTILE_WINDOW_DIR)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//WHATEVER YOU USE THIS FOR MUST BE SANITIZED TO SHIT, IT USES SHELL
|
||||
//It also sleeps
|
||||
|
||||
//Set this to TRUE before calling
|
||||
//This prevents RCEs from badmins
|
||||
//kevinz000 if you touch this I will hunt you down
|
||||
var/valid_HTTPSGet = FALSE
|
||||
/proc/HTTPSGet(url)
|
||||
if(findtext(url, "\""))
|
||||
valid_HTTPSGet = FALSE
|
||||
|
||||
if(!valid_HTTPSGet)
|
||||
if(usr)
|
||||
CRASH("[usr.ckey]([usr]) just attempted an invalid HTTPSGet on: [url]!")
|
||||
else
|
||||
CRASH("Invalid HTTPSGet call on: [url]")
|
||||
valid_HTTPSGet = FALSE
|
||||
|
||||
//"This has got to be the ugliest hack I have ever done"
|
||||
//warning, here be dragons
|
||||
/*
|
||||
| @___oo
|
||||
/\ /\ / (__,,,,|
|
||||
) /^\) ^\/ _)
|
||||
) /^\/ _)
|
||||
) _ / / _)
|
||||
/\ )/\/ || | )_)
|
||||
< > |(,,) )__)
|
||||
|| / \)___)\
|
||||
| \____( )___) )___
|
||||
\______(_______;;; __;;;
|
||||
*/
|
||||
var/temp_file = "HTTPSGetOutput.txt"
|
||||
var/command
|
||||
if(world.system_type == MS_WINDOWS)
|
||||
command = "powershell -Command \"wget [url] -OutFile [temp_file]\""
|
||||
else if(world.system_type == UNIX)
|
||||
command = "wget -O [temp_file] [url]"
|
||||
else
|
||||
CRASH("Invalid world.system_type ([world.system_type])? Yell at Lummox.")
|
||||
|
||||
world.log << "HTTPSGet: [url]"
|
||||
var/result = shell(command)
|
||||
if(result != 0)
|
||||
world.log << "Download failed: shell exited with code: [result]"
|
||||
return
|
||||
|
||||
var/f = file(temp_file)
|
||||
if(!f)
|
||||
world.log << "Download failed: Temp file not found"
|
||||
return
|
||||
|
||||
. = file2text(f)
|
||||
f = null
|
||||
fdel(temp_file)
|
||||
|
||||
Reference in New Issue
Block a user