You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Earlier, SendSignal() sent effective_sensitivity as a pointer by marking it as &effective_sensitivity.
44
+
// That means that for this proc, we have the memory address for the original var/effective_sensitivity located in /atom/movable/proc/check_psi_sensitivity()
45
+
// By marking it with the asterisk (*), I'm telling the game "Actually, add directly to the original variable from /atom/movable/proc/check_psi_sensitivity()"
46
+
// The reason we're doing this via pointer is that this allows any number of psi_sensitivity components to touch that variable.
47
+
// If we did this by a Return statement, only the first component would have been allowed to touch it, and all others get ignored.
Copy file name to clipboardExpand all lines: code/modules/psionics/mob/mob_helpers.dm
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,15 @@
41
41
*/
42
42
/atom/movable/proc/check_psi_sensitivity()
43
43
var/effective_sensitivity=0
44
+
// effective_sensitivity is being sent as a Pointer by marking it with the Ampersand (&)
45
+
// This means that components which have a RegisterSignal() associated with this will receive the memory address of the var/effective_sensitivity in this proc.
46
+
// They are then allowed to add or subtract to this proc's var directly, without needing to return a number.
47
+
// We have to do this with a pointer because it allows us to obtain a Sum of all psi-sensitivity modifiers.
48
+
// If we instead relied on a Return, we would only be able to get the modifier of the first component to respond.
0 commit comments