diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index e90c3c15a2b..a448ca3d711 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -11,6 +11,7 @@ #define LAZYINITLIST(L) if (!L) L = list() #define UNSETEMPTY(L) if (L && !length(L)) L = null +#define LAZYCOPY(L) (L ? L.Copy() : list() ) #define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } } #define LAZYADD(L, I) if(!L) { L = list(); } L += I; #define LAZYOR(L, I) if(!L) { L = list(); } L |= I; diff --git a/code/modules/movespeed/_movespeed_modifier.dm b/code/modules/movespeed/_movespeed_modifier.dm index 75fa6a706a6..0976f4d0671 100644 --- a/code/modules/movespeed/_movespeed_modifier.dm +++ b/code/modules/movespeed/_movespeed_modifier.dm @@ -199,7 +199,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) /// Get the move speed modifiers list of the mob /mob/proc/get_movespeed_modifiers() - . = movespeed_modification + . = LAZYCOPY(movespeed_modification) for(var/id in movespeed_mod_immunities) . -= id