mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[Bug Fix] Fix issues with Lua tables not starting at index 1 (#3160)
* [Bug Fix] Fix issues with Lua tables not starting at index 1 # Notes - This would cause the first item in the table to be inaccessible since Lua tables start at index `1` instead of index `0`. - All other spots using Lua tables have their indexes starting at `1`. * Update lua_general.cpp
This commit is contained in:
@@ -1017,7 +1017,7 @@ luabind::adl::object lua_get_instance_ids(lua_State* L, std::string zone_name) {
|
||||
|
||||
auto instance_ids = quest_manager.GetInstanceIDs(zone_name);
|
||||
for (int i = 0; i < instance_ids.size(); i++) {
|
||||
ret[i] = instance_ids[i];
|
||||
ret[i + 1] = instance_ids[i];
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1028,7 +1028,7 @@ luabind::adl::object lua_get_instance_ids_by_char_id(lua_State* L, std::string z
|
||||
|
||||
auto instance_ids = quest_manager.GetInstanceIDs(zone_name, character_id);
|
||||
for (int i = 0; i < instance_ids.size(); i++) {
|
||||
ret[i] = instance_ids[i];
|
||||
ret[i + 1] = instance_ids[i];
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -4182,7 +4182,7 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("get_instance_id", &lua_get_instance_id),
|
||||
luabind::def("get_instance_id_by_char_id", &lua_get_instance_id_by_char_id),
|
||||
luabind::def("get_instance_ids", &lua_get_instance_ids),
|
||||
luabind::def("get_instance_ids_by_char_id", &lua_get_instance_id_by_char_id),
|
||||
luabind::def("get_instance_ids_by_char_id", &lua_get_instance_ids_by_char_id),
|
||||
luabind::def("get_instance_timer", &lua_get_instance_timer),
|
||||
luabind::def("get_instance_timer_by_id", &lua_get_instance_timer_by_id),
|
||||
luabind::def("get_instance_version_by_id", &lua_get_instance_version_by_id),
|
||||
|
||||
Reference in New Issue
Block a user