mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-23 19:52:25 +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:
parent
d4174ca236
commit
6960a1a682
@ -2828,7 +2828,7 @@ luabind::object Lua_Client::GetPEQZoneFlags(lua_State* L) {
|
||||
if (d_) {
|
||||
auto self = reinterpret_cast<NativeType*>(d_);
|
||||
auto l = self->GetPEQZoneFlags();
|
||||
auto i = 0;
|
||||
auto i = 1;
|
||||
for (const auto& f : l) {
|
||||
t[i] = f;
|
||||
i++;
|
||||
@ -2843,7 +2843,7 @@ luabind::object Lua_Client::GetZoneFlags(lua_State* L) {
|
||||
if (d_) {
|
||||
auto self = reinterpret_cast<NativeType*>(d_);
|
||||
auto l = self->GetZoneFlags();
|
||||
auto i = 0;
|
||||
auto i = 1;
|
||||
for (const auto& f : l) {
|
||||
t[i] = f;
|
||||
i++;
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -2709,7 +2709,7 @@ luabind::object Lua_Mob::GetEntityVariables(lua_State* L) {
|
||||
if (d_) {
|
||||
auto self = reinterpret_cast<NativeType*>(d_);
|
||||
auto l = self->GetEntityVariables();
|
||||
auto i = 0;
|
||||
auto i = 1;
|
||||
for (const auto& v : l) {
|
||||
t[i] = v;
|
||||
i++;
|
||||
|
||||
@ -173,7 +173,7 @@ luabind::object Lua_Object::GetEntityVariables(lua_State* L) {
|
||||
if (d_) {
|
||||
auto self = reinterpret_cast<NativeType*>(d_);
|
||||
auto l = self->GetEntityVariables();
|
||||
auto i = 0;
|
||||
auto i = 1;
|
||||
for (const auto& v : l) {
|
||||
t[i] = v;
|
||||
i++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user