From cc82569a08f36430e38428f6cf59cfe455819d4a Mon Sep 17 00:00:00 2001 From: omicronrex <65692652+omicronrex@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:38:41 -0300 Subject: [PATCH] fixed room_find --- source/indexing.gml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/indexing.gml b/source/indexing.gml index eae3fc5..3d5fa5e 100644 --- a/source/indexing.gml +++ b/source/indexing.gml @@ -131,11 +131,13 @@ //returns: room id, or noone //Finds a room by its name. if the room doesn't exist, noone is returned. //The first time this function is called, extra time is spent building an index, and subsequent calls are much faster. + var __l,__i; - var l,i; if (__gm82core_index_rooms==noone) { __gm82core_index_rooms=ds_map_create() - i=room_first while (i!=room_last) {ds_map_add(__gm82core_index_objects,object_get_name(i),i) i=room_next(i)} + __i=room_first while (__i!=room_last) {ds_map_add(__gm82core_index_rooms,room_get_name(__i),__i) __i=room_next(__i)} + //add last room + ds_map_add(__gm82core_index_rooms,room_get_name(__i),__i) } if (ds_map_exists(__gm82core_index_rooms,argument0)) return ds_map_find_value(__gm82core_index_rooms,argument0) return noone \ No newline at end of file