From 1e8507e154a64ef43acd4367aa39b241b1c81afd Mon Sep 17 00:00:00 2001 From: Profakos Date: Sat, 4 Nov 2023 23:03:09 +0100 Subject: [PATCH] Initializes on_finish_callbacks in the JPS move loop (#79505) ## About The Pull Request The on_finish_callbacks list in `/datum/move_loop/has_target/jps` was not initialized. Usually, when you add something to an uninitialized list, it gets initialized and the item gets added to it. However, the `CALLBACK` wrapper is around `new /datum/callback`, this fails. This meant on_finish_callback was not a list, therefore at the end of pathfinding, its contents could not be iterated and invoked. This PR fixes this problem by initializing the list. ## Why It's Good For The Game Closes #79383 Blob minions rally and punch again. ## Changelog :cl: fix: Basic mobs using JPS can move again /:cl: --- code/controllers/subsystem/movement/movement_types.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/movement/movement_types.dm b/code/controllers/subsystem/movement/movement_types.dm index 0b464a9a196..6e18d35dd8f 100644 --- a/code/controllers/subsystem/movement/movement_types.dm +++ b/code/controllers/subsystem/movement/movement_types.dm @@ -367,7 +367,7 @@ ///Bool used to determine if we're already making a path in JPS. this prevents us from re-pathing while we're already busy. var/is_pathing = FALSE ///Callbacks to invoke once we make a path - var/list/datum/callback/on_finish_callbacks + var/list/datum/callback/on_finish_callbacks = list() /datum/move_loop/has_target/jps/New(datum/movement_packet/owner, datum/controller/subsystem/movement/controller, atom/moving, priority, flags, datum/extra_info) . = ..()