From 00b8a76a6d37acaec60b33a7b1436b81ce4d205e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 16 Oct 2023 01:54:51 +0200 Subject: [PATCH] [MIRROR] Makes the active sonar stop destroying the game [MDB IGNORE] (#24353) * Makes the active sonar stop destroying the game (#79006) ## About The Pull Request Hey did you know the active sonar would just repeatedly add mobs to its internal list no matter if they were there already or not? Yea. Anyways that's fixed now, overtime is saved ## Why It's Good For The Game ![image](https://github.com/tgstation/tgstation/assets/66052067/dea57189-034a-46a4-bee3-5d2a1f9eec61) ![kylo-kylo-ren](https://github.com/tgstation/tgstation/assets/66052067/8cbeca30-fd8b-451e-ab61-a91c7192f873) ## Changelog :cl: Wallem fix: The active sonar module won't attempt to create 6000000 new pings per process cycle anymore /:cl: * Makes the active sonar stop destroying the game --------- Co-authored-by: Wallem <66052067+Wallemations@users.noreply.github.com> --- code/modules/mod/modules/modules_security.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mod/modules/modules_security.dm b/code/modules/mod/modules/modules_security.dm index 7e331433b4f..3ac431034b5 100644 --- a/code/modules/mod/modules/modules_security.dm +++ b/code/modules/mod/modules/modules_security.dm @@ -422,8 +422,10 @@ UnregisterSignal(creature, COMSIG_MOVABLE_MOVED) return - if(oldgroup != newgroup) - sorted_creatures[oldgroup] -= creature + if(oldgroup == newgroup) + return + + sorted_creatures[oldgroup] -= creature sorted_creatures[newgroup] += creature keyed_creatures[creature] = newgroup