Skip to content

Commit 36e2640

Browse files
Merge branch 'dev' of github.com:NebulaSS13/Nebula into devupdate
2 parents ddf2688 + ead9e47 commit 36e2640

File tree

162 files changed

+727
-735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+727
-735
lines changed

code/__defines/ZAS.dm

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,29 +57,25 @@
5757
}
5858

5959
#ifdef MULTIZAS
60-
61-
var/global/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTHUP, EASTUP, WESTUP, SOUTHUP, NORTHDOWN, EASTDOWN, WESTDOWN, SOUTHDOWN)
62-
var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)
60+
#define ZAS_CSRFZ_CHECK global.cornerdirsz
61+
#define ZAS_GZN_CHECK global.cardinalz
6362

6463
#define ATMOS_CANPASS_TURF(ret, A, B) \
6564
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
6665
ret = BLOCKED; \
6766
} \
68-
else if (B.z != A.z) { \
69-
if (B.z < A.z) { \
70-
ret = (A.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
71-
} \
72-
else { \
73-
ret = (B.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
74-
} \
67+
else if (B.z < A.z) { \
68+
ret = (A.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
7569
} \
76-
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
77-
ret = (A.z == B.z) ? ZONE_BLOCKED : AIR_BLOCKED; \
70+
else if(B.z > A.z) { \
71+
ret = (B.z_flags & ZM_ALLOW_ATMOS) ? ZONE_BLOCKED : BLOCKED; \
7872
} \
79-
else if (A.contents.len) { \
73+
else if ((A.blocks_air & ZONE_BLOCKED) || (B.blocks_air & ZONE_BLOCKED)) { \
74+
ret = ZONE_BLOCKED; \
75+
} \
76+
else if (length(A.contents)) { \
8077
ret = 0;\
81-
for (var/thing in A) { \
82-
var/atom/movable/AM = thing; \
78+
for (var/atom/movable/AM as anything in A) { \
8379
ATMOS_CANPASS_MOVABLE(ret, AM, B); \
8480
if (ret == BLOCKED) { \
8581
break;\
@@ -88,8 +84,8 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN)
8884
}
8985
#else
9086

91-
var/global/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
92-
var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST)
87+
#define ZAS_CSRFZ_CHECK global.cornerdirs
88+
#define ZAS_GZN_CHECK global.cardinal
9389

9490
#define ATMOS_CANPASS_TURF(ret, A, B) \
9591
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
@@ -98,7 +94,7 @@ var/global/list/gzn_check = list(NORTH, SOUTH, EAST, WEST)
9894
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
9995
ret = ZONE_BLOCKED; \
10096
} \
101-
else if (A.contents.len) { \
97+
else if (length(A.contents)) { \
10298
ret = 0;\
10399
for (var/thing in A) { \
104100
var/atom/movable/AM = thing; \

code/_helpers/files.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//Sends resource files to client cache
22
/client/proc/getFiles()
33
for(var/file in args)
4-
direct_output(src, browse_rsc(file))
4+
send_rsc(src, file, null)
55

66
/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list(".txt",".log",".htm"))
77
var/path = root

code/_helpers/icons.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ mob
163163
// Send the icon to src's local cache
164164
send_rsc(src, getFlatIcon(src), iconName)
165165
// Display the icon in their browser
166-
direct_output(src, browse("<body bgcolor='#000000'><p><img src='[iconName]'></p></body>"))
166+
show_browser(src, "<body bgcolor='#000000'><p><img src='[iconName]'></p></body>")
167167
168168
Output_Icon()
169169
set name = "2. Output Icon"

code/_helpers/logging.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
2626
to_world_log("## TESTING: [msg][log_end]")
2727

2828
/proc/game_log(category, text)
29-
direct_output(diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]")
29+
to_file(diary, "\[[time_stamp()]] [game_id] [category]: [text][log_end]")
3030

3131
/proc/log_admin(text)
3232
global.admin_log.Add(text)

code/_helpers/profiling.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
lines += "[entry] => [num2text(data[STAT_ENTRY_TIME], 10)]ms ([data[STAT_ENTRY_COUNT]]) (avg:[num2text(data[STAT_ENTRY_TIME]/(data[STAT_ENTRY_COUNT] || 1), 99)])"
7272

7373
if (user)
74-
direct_output(user, browse("<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode("stats:[ref(stats)]")]"))
74+
show_browser(user, "<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode("stats:[ref(stats)]")]")
7575

7676
. = lines.Join("\n")
7777

code/_helpers/sorts/__main.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ reverse a descending sequence without violating stability.
169169
var/r = 0 //becomes 1 if any bits are shifted off
170170
while(n >= MIN_MERGE)
171171
r |= (n & 1)
172-
n >>= 1
172+
n = BITSHIFT_RIGHT(n, 1)
173173
return n + r
174174

175175
//Examines the stack of runs waiting to be merged and merges adjacent runs until the stack invariants are reestablished:

code/_macros.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@
106106
#define show_image(target, image) target << (image)
107107
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name)
108108
#define open_link(target, url) target << link(url)
109+
#define ftp_to(target, file_entry, suggested_name) target << ftp(file_entry, suggested_name)
110+
#define open_file_for(target, file) target << run(file)
109111
#define to_savefile(target, key, value) target[(key)] << (value)
110112
#define from_savefile(target, key, value) target[(key)] >> (value)
111113
#define to_output(target, output_content, output_args) target << output((output_content), (output_args))
114+
// Avoid using this where possible, prefer the other helpers instead.
112115
#define direct_output(target, value) target << (value)
113116

114117
/proc/html_icon(var/thing) // Proc instead of macro to avoid precompiler problems.

code/_onclick/hud/screen/screen_credits.dm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
1919
target = M
2020
animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
21-
spawn(CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
22-
if(!QDELETED(src))
23-
animate(src, alpha = 0, transform = target, time = CREDIT_EASE_DURATION)
24-
sleep(CREDIT_EASE_DURATION)
25-
qdel(src)
21+
addtimer(CALLBACK(src, PROC_REF(ease_out)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
2622
var/mob/owner = owner_ref?.resolve()
2723
if(istype(owner) && owner.client)
2824
owner.client.screen += src
2925

26+
/obj/screen/credit/proc/ease_out()
27+
if(QDELETED(src))
28+
return
29+
animate(src, alpha = 0, transform = target, time = CREDIT_EASE_DURATION)
30+
QDEL_IN_CLIENT_TIME(src, CREDIT_EASE_DURATION)
31+
3032
/obj/screen/credit/Destroy()
3133
var/client/P = parent
3234
if(istype(P))

code/controllers/subsystems/air.dm

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ SUBSYSTEM_DEF(air)
138138
if(!SHOULD_PARTICIPATE_IN_ZONES(T))
139139
continue
140140
simulated_turf_count++
141+
// We also skip anything already queued, since it'll be settled when fire() runs anyway.
142+
if(T.needs_air_update)
143+
continue
141144
T.update_air_properties()
145+
// air state is necessarily globally incomplete during this
146+
// so we can't do T.post_update_air_properties(), which needs
147+
// connections to have been settled already.
142148
CHECK_TICK
143149

144150
report_progress({"Total Simulated Turfs: [simulated_turf_count]
@@ -198,7 +204,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
198204

199205
T.update_air_properties()
200206
T.post_update_air_properties()
201-
T.needs_air_update = 0
207+
T.needs_air_update = FALSE
202208
#ifdef ZASDBG
203209
T.remove_vis_contents(zasdbgovl_mark)
204210
#endif
@@ -214,7 +220,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
214220

215221
T.update_air_properties()
216222
T.post_update_air_properties()
217-
T.needs_air_update = 0
223+
T.needs_air_update = FALSE
218224
#ifdef ZASDBG
219225
T.remove_vis_contents(zasdbgovl_mark)
220226
#endif
@@ -368,13 +374,15 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
368374
#ifdef ZASDBG
369375
ASSERT(isturf(T))
370376
#endif
371-
if(T.needs_air_update)
377+
// don't queue us if we've already been queued
378+
// and if SSair hasn't run, every turf in the world will get updated soon anyway
379+
if(T.needs_air_update || !SSair.initialized)
372380
return
373381
tiles_to_update += T
374382
#ifdef ZASDBG
375383
T.add_vis_contents(zasdbgovl_mark)
376384
#endif
377-
T.needs_air_update = 1
385+
T.needs_air_update = TRUE
378386

379387
/datum/controller/subsystem/air/proc/mark_zone_update(zone/Z)
380388
#ifdef ZASDBG

code/controllers/subsystems/garbage.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ SUBSYSTEM_DEF(garbage)
279279
qdel(D, force)
280280
#endif
281281

282-
// Should be treated as a replacement for the 'del' keyword.
283-
// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
282+
/// Should be treated as a replacement for the 'del' keyword.
283+
/// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
284+
/// Non-datums passed to this will be hard-deleted.
284285
/proc/qdel(datum/D, force=FALSE)
285286
if(isnull(D))
286287
return
287288
if(!istype(D))
288-
PRINT_STACK_TRACE("qdel() can only handle /datum (sub)types, was passed: [log_info_line(D)]")
289289
del(D)
290290
return
291291
var/datum/qdel_item/I = SSgarbage.items[D.type]

0 commit comments

Comments
 (0)