From f55a37391834e649bb84399f6e896677dc8ccdd8 Mon Sep 17 00:00:00 2001 From: blahpy <68830177+blahpy@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:46:54 +1300 Subject: [PATCH] Add process-by-aid function similar to process-by-ename (#75) --- goal_src/jak1/engine/mods/mod-common-functions.gc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/goal_src/jak1/engine/mods/mod-common-functions.gc b/goal_src/jak1/engine/mods/mod-common-functions.gc index 715d63e68d..78a01c0064 100644 --- a/goal_src/jak1/engine/mods/mod-common-functions.gc +++ b/goal_src/jak1/engine/mods/mod-common-functions.gc @@ -172,6 +172,15 @@ if the result of rand-vu-int-range is 1, then DANCE! if it is not 1, then Don't (none) ) +(defun process-by-aid ((arg0 uint)) + "Get the process for the entity with the given aid. If there is no entity or process, #f." + (let ((v1-0 (entity-by-aid arg0))) + (if v1-0 + (-> v1-0 extra process) + ) + ) +) + (defun spawn-actor-by-name ((name string)) ;; Takes in the string of name of a actor, and spawns a new process based on the entity. (let* ((entity-actor (the entity-actor (entity-by-name name)))