From 51c1689c89342dbd6cd75631c38c6bccf1f3b1ea Mon Sep 17 00:00:00 2001 From: MowFord <131182600+MowFord@users.noreply.github.com> Date: Fri, 3 May 2024 09:34:49 -0500 Subject: [PATCH] Ensure sequential order for getfirstID etc --- src/map/lua/luautils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/lua/luautils.cpp b/src/map/lua/luautils.cpp index d8827dd6b58..052791ccc9a 100644 --- a/src/map/lua/luautils.cpp +++ b/src/map/lua/luautils.cpp @@ -872,7 +872,7 @@ namespace luautils // Mobs { auto query = fmt::sprintf("SELECT mobname, mobid FROM mob_spawn_points " - "WHERE ((mobid >> 12) & 0xFFF) = %i", + "WHERE ((mobid >> 12) & 0xFFF) = %i ORDER BY mobid ASC", zoneId); auto ret = _sql->Query(query.c_str()); while (ret != SQL_ERROR && _sql->NumRows() != 0 && _sql->NextRow() == SQL_SUCCESS) @@ -887,7 +887,7 @@ namespace luautils // NPCs { auto query = fmt::sprintf("SELECT name, npcid FROM npc_list " - "WHERE ((npcid >> 12) & 0xFFF) = %i", + "WHERE ((npcid >> 12) & 0xFFF) = %i ORDER BY npcid ASC", zoneId); auto ret = _sql->Query(query.c_str()); while (ret != SQL_ERROR && _sql->NumRows() != 0 && _sql->NextRow() == SQL_SUCCESS)