From 8d09f4e043ead59298068a061f139b5c4a3263e3 Mon Sep 17 00:00:00 2001 From: Emagi Date: Sat, 17 Aug 2024 04:27:45 -0400 Subject: [PATCH] Update LuaFunctions.cpp --- source/WorldServer/LuaFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/WorldServer/LuaFunctions.cpp b/source/WorldServer/LuaFunctions.cpp index 6182785..82fe63d 100644 --- a/source/WorldServer/LuaFunctions.cpp +++ b/source/WorldServer/LuaFunctions.cpp @@ -5834,7 +5834,7 @@ int EQ2Emu_lua_SpawnByLocationID(lua_State* state) { return 0; } - int32 rand_number = MakeRandomInt(0, location->entities.size()); + int32 rand_number = MakeRandomInt(0, location->entities.size() - 1); Spawn* spawn = 0; if (location->entities[rand_number]) { @@ -10835,7 +10835,7 @@ int EQ2Emu_lua_SpawnGroupByID(lua_State* state) { return 0; } - int32 rand_number = MakeRandomInt(0, location->entities.size()); + int32 rand_number = MakeRandomInt(0, location->entities.size() - 1); Spawn* spawn = 0; if (location->entities[rand_number]) {