Some potential fixes for clang, not complete

This commit is contained in:
KimLS 2014-06-23 16:56:37 -07:00 committed by Arthur Ice
parent 11918fccbf
commit 9680f39203
8 changed files with 114 additions and 107 deletions

View File

@ -13,12 +13,17 @@
# include <boost/mpl/next.hpp>
# include <boost/mpl/size.hpp>
namespace luabind {
namespace luabind { namespace adl {
class object;
class argument;
template <class Base>
struct table;
class object;
class argument;
template <class Base>
struct table;
} // namespace adl
using adl::object;
using adl::argument;
using adl::table;
} // namespace luabind

View File

@ -447,7 +447,7 @@ bool Group::UpdatePlayer(Mob* update){
//update their player profile
PlayerProfile_Struct &pp = update->CastToClient()->GetPP();
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
if(membername[0] == '\0')
if(membername[i][0] == '\0')
memset(pp.groupMembers[i], 0, 64);
else
strn0cpy(pp.groupMembers[i], membername[i], 64);

View File

@ -27,7 +27,7 @@ struct Appearances { };
struct lua_registered_event {
std::string encounter_name;
luabind::object lua_reference;
luabind::adl::object lua_reference;
QuestEventID event_id;
};
@ -43,7 +43,7 @@ void unload_encounter(std::string name) {
parse->EventEncounter(EVENT_ENCOUNTER_UNLOAD, name, 0);
}
void register_event(std::string package_name, std::string name, int evt, luabind::object func) {
void register_event(std::string package_name, std::string name, int evt, luabind::adl::object func) {
lua_registered_event e;
e.encounter_name = name;
e.lua_reference = func;
@ -84,7 +84,7 @@ void unregister_event(std::string package_name, std::string name, int evt) {
}
}
void register_npc_event(std::string name, int evt, int npc_id, luabind::object func) {
void register_npc_event(std::string name, int evt, int npc_id, luabind::adl::object func) {
if(luabind::type(func) == LUA_TFUNCTION) {
std::stringstream package_name;
package_name << "npc_" << npc_id;
@ -100,7 +100,7 @@ void unregister_npc_event(std::string name, int evt, int npc_id) {
unregister_event(package_name.str(), name, evt);
}
void register_player_event(std::string name, int evt, luabind::object func) {
void register_player_event(std::string name, int evt, luabind::adl::object func) {
if(luabind::type(func) == LUA_TFUNCTION) {
register_event("player", name, evt, func);
}
@ -110,7 +110,7 @@ void unregister_player_event(std::string name, int evt) {
unregister_event("player", name, evt);
}
void register_item_event(std::string name, int evt, int item_id, luabind::object func) {
void register_item_event(std::string name, int evt, int item_id, luabind::adl::object func) {
std::string package_name = "item_";
package_name += std::to_string(static_cast<long long>(item_id));
@ -126,7 +126,7 @@ void unregister_item_event(std::string name, int evt, int item_id) {
unregister_event(package_name, name, evt);
}
void register_spell_event(std::string name, int evt, int spell_id, luabind::object func) {
void register_spell_event(std::string name, int evt, int spell_id, luabind::adl::object func) {
if(luabind::type(func) == LUA_TFUNCTION) {
std::stringstream package_name;
package_name << "spell_" << spell_id;
@ -392,7 +392,7 @@ bool lua_bury_player_corpse(uint32 char_id) {
return quest_manager.buryplayercorpse(char_id);
}
void lua_task_selector(luabind::object table) {
void lua_task_selector(luabind::adl::object table) {
if(luabind::type(table) != LUA_TTABLE) {
return;
}
@ -422,7 +422,7 @@ void lua_task_set_selector(int task_set) {
quest_manager.tasksetselector(task_set);
}
void lua_enable_task(luabind::object table) {
void lua_enable_task(luabind::adl::object table) {
if(luabind::type(table) != LUA_TTABLE) {
return;
}
@ -449,7 +449,7 @@ void lua_enable_task(luabind::object table) {
quest_manager.enabletask(count, tasks);
}
void lua_disable_task(luabind::object table) {
void lua_disable_task(luabind::adl::object table) {
if(luabind::type(table) != LUA_TTABLE) {
return;
}
@ -743,8 +743,8 @@ void lua_cross_zone_message_player_by_name(uint32 type, const char *player, cons
quest_manager.CrossZoneMessagePlayerByName(type, player, message);
}
luabind::object lua_get_qglobals(lua_State *L, Lua_NPC npc, Lua_Client client) {
luabind::object ret = luabind::newtable(L);
luabind::adl::object lua_get_qglobals(lua_State *L, Lua_NPC npc, Lua_Client client) {
luabind::adl::object ret = luabind::newtable(L);
NPC *n = npc;
Client *c = client;
@ -759,8 +759,8 @@ luabind::object lua_get_qglobals(lua_State *L, Lua_NPC npc, Lua_Client client) {
return ret;
}
luabind::object lua_get_qglobals(lua_State *L, Lua_Client client) {
luabind::object ret = luabind::newtable(L);
luabind::adl::object lua_get_qglobals(lua_State *L, Lua_Client client) {
luabind::adl::object ret = luabind::newtable(L);
NPC *n = nullptr;
Client *c = client;
@ -775,8 +775,8 @@ luabind::object lua_get_qglobals(lua_State *L, Lua_Client client) {
return ret;
}
luabind::object lua_get_qglobals(lua_State *L, Lua_NPC npc) {
luabind::object ret = luabind::newtable(L);
luabind::adl::object lua_get_qglobals(lua_State *L, Lua_NPC npc) {
luabind::adl::object ret = luabind::newtable(L);
NPC *n = npc;
Client *c = nullptr;
@ -791,8 +791,8 @@ luabind::object lua_get_qglobals(lua_State *L, Lua_NPC npc) {
return ret;
}
luabind::object lua_get_qglobals(lua_State *L) {
luabind::object ret = luabind::newtable(L);
luabind::adl::object lua_get_qglobals(lua_State *L) {
luabind::adl::object ret = luabind::newtable(L);
NPC *n = nullptr;
Client *c = nullptr;
@ -846,8 +846,8 @@ int lua_get_zone_instance_version() {
return zone->GetInstanceVersion();
}
luabind::object lua_get_characters_in_instance(lua_State *L, uint16 instance_id) {
luabind::object ret = luabind::newtable(L);
luabind::adl::object lua_get_characters_in_instance(lua_State *L, uint16 instance_id) {
luabind::adl::object ret = luabind::newtable(L);
std::list<uint32> charid_list;
uint16 i = 1;
@ -868,11 +868,11 @@ int lua_get_zone_weather() {
return zone->zone_weather;
}
luabind::object lua_get_zone_time(lua_State *L) {
luabind::adl::object lua_get_zone_time(lua_State *L) {
TimeOfDay_Struct eqTime;
zone->zone_time.getEQTimeOfDay(time(0), &eqTime);
luabind::object ret = luabind::newtable(L);
luabind::adl::object ret = luabind::newtable(L);
ret["zone_hour"] = eqTime.hour - 1;
ret["zone_minute"] = eqTime.minute;
ret["zone_time"] = (eqTime.hour - 1) * 100 + eqTime.minute;
@ -909,7 +909,7 @@ void lua_remove_spawn_point(uint32 spawn2_id) {
}
}
void lua_add_spawn_point(luabind::object table) {
void lua_add_spawn_point(luabind::adl::object table) {
if(!zone)
return;
@ -1280,10 +1280,10 @@ luabind::scope lua_register_general() {
luabind::def("cross_zone_signal_client_by_char_id", &lua_cross_zone_signal_client_by_char_id),
luabind::def("cross_zone_signal_client_by_name", &lua_cross_zone_signal_client_by_name),
luabind::def("cross_zone_message_player_by_name", &lua_cross_zone_message_player_by_name),
luabind::def("get_qglobals", (luabind::object(*)(lua_State*,Lua_NPC,Lua_Client))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::object(*)(lua_State*,Lua_Client))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::object(*)(lua_State*,Lua_NPC))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::object(*)(lua_State*))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*,Lua_NPC,Lua_Client))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*,Lua_Client))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*,Lua_NPC))&lua_get_qglobals),
luabind::def("get_qglobals", (luabind::adl::object(*)(lua_State*))&lua_get_qglobals),
luabind::def("get_entity_list", &lua_get_entity_list),
luabind::def("get_zone_id", &lua_get_zone_id),
luabind::def("get_zone_long_name", &lua_get_zone_long_name),

View File

@ -103,7 +103,7 @@ bool Lua_Mob::Attack(Lua_Mob other, int hand, bool from_riposte, bool is_striket
return self->Attack(other, hand, from_riposte, is_strikethrough, is_from_spell);
}
bool Lua_Mob::Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, luabind::object opts) {
bool Lua_Mob::Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, luabind::adl::object opts) {
Lua_Safe_Call_Bool();
ExtraAttackOptions options;
@ -1429,7 +1429,7 @@ void Lua_Mob::SetGender(int in) {
self->SendIllusionPacket(self->GetRace(), in);
}
void Lua_Mob::SendIllusionPacket(luabind::object illusion) {
void Lua_Mob::SendIllusionPacket(luabind::adl::object illusion) {
Lua_Safe_Call_Void();
if(luabind::type(illusion) != LUA_TTABLE) {
@ -1881,7 +1881,7 @@ luabind::scope lua_register_mob() {
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool))&Lua_Mob::Attack)
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool))&Lua_Mob::Attack)
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool,bool))&Lua_Mob::Attack)
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool,bool,luabind::object))&Lua_Mob::Attack)
.def("Attack", (bool(Lua_Mob::*)(Lua_Mob,int,bool,bool,bool,luabind::adl::object))&Lua_Mob::Attack)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool))&Lua_Mob::Damage)
.def("Damage", (void(Lua_Mob::*)(Lua_Mob,int,int,int,bool,int))&Lua_Mob::Damage)
@ -2125,7 +2125,7 @@ luabind::scope lua_register_mob() {
.def("SetTexture", (void(Lua_Mob::*)(int))&Lua_Mob::SetTexture)
.def("SetRace", (void(Lua_Mob::*)(int))&Lua_Mob::SetRace)
.def("SetGender", (void(Lua_Mob::*)(int))&Lua_Mob::SetGender)
.def("SendIllusionPacket", (void(Lua_Mob::*)(luabind::object))&Lua_Mob::SendIllusionPacket)
.def("SendIllusionPacket", (void(Lua_Mob::*)(luabind::adl::object))&Lua_Mob::SendIllusionPacket)
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client))&Lua_Mob::QuestReward)
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32))&Lua_Mob::QuestReward)
.def("QuestReward", (void(Lua_Mob::*)(Lua_Client,uint32,uint32))&Lua_Mob::QuestReward)

View File

@ -47,7 +47,7 @@ public:
bool Attack(Lua_Mob other, int hand, bool from_riposte);
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough);
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell);
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, luabind::object opts);
bool Attack(Lua_Mob other, int hand, bool from_riposte, bool is_strikethrough, bool is_from_spell, luabind::adl::object opts);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable);
void Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot);
@ -294,7 +294,7 @@ public:
void SetTexture(int in);
void SetRace(int in);
void SetGender(int in);
void SendIllusionPacket(luabind::object illusion);
void SendIllusionPacket(luabind::adl::object illusion);
void QuestReward(Lua_Client c);
void QuestReward(Lua_Client c, uint32 silver);
void QuestReward(Lua_Client c, uint32 silver, uint32 gold);

View File

@ -121,7 +121,7 @@ extern Zone *zone;
struct lua_registered_event {
std::string encounter_name;
luabind::object lua_reference;
luabind::adl::object lua_reference;
QuestEventID event_id;
};
@ -257,7 +257,7 @@ int LuaParser::EventGlobalNPC(QuestEventID evt, NPC* npc, Mob *init, std::string
}
int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers, luabind::object *l_func) {
std::vector<void*> *extra_pointers, luabind::adl::object *l_func) {
const char *sub_name = LuaEvents[evt];
int start = lua_gettop(L);
@ -275,7 +275,7 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
lua_createtable(L, 0, 0);
//always push self
Lua_NPC l_npc(npc);
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "self");
@ -352,7 +352,7 @@ int LuaParser::EventGlobalPlayer(QuestEventID evt, Client *client, std::string d
}
int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers, luabind::object *l_func) {
std::vector<void*> *extra_pointers, luabind::adl::object *l_func) {
const char *sub_name = LuaEvents[evt];
int start = lua_gettop(L);
@ -369,7 +369,7 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
lua_createtable(L, 0, 0);
//push self
Lua_Client l_client(client);
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "self");
@ -429,7 +429,7 @@ int LuaParser::EventItem(QuestEventID evt, Client *client, ItemInst *item, Mob *
}
int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *client, ItemInst *item, Mob *mob,
std::string data, uint32 extra_data, std::vector<void*> *extra_pointers, luabind::object *l_func) {
std::string data, uint32 extra_data, std::vector<void*> *extra_pointers, luabind::adl::object *l_func) {
const char *sub_name = LuaEvents[evt];
int start = lua_gettop(L);
@ -446,12 +446,12 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl
lua_createtable(L, 0, 0);
//always push self
Lua_ItemInst l_item(item);
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "self");
Lua_Client l_client(client);
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "owner");
@ -508,7 +508,7 @@ int LuaParser::EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spe
}
int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
std::vector<void*> *extra_pointers, luabind::object *l_func) {
std::vector<void*> *extra_pointers, luabind::adl::object *l_func) {
const char *sub_name = LuaEvents[evt];
int start = lua_gettop(L);
@ -528,11 +528,11 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, NPC* npc,
//always push self even if invalid
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
} else {
Lua_Spell l_spell(nullptr);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
}
lua_setfield(L, -2, "self");

View File

@ -17,7 +17,9 @@ class NPC;
struct lua_registered_event;
namespace luabind {
class object;
namespace adl {
class object;
}
}
class LuaParser : public QuestInterface {
@ -73,13 +75,13 @@ public:
private:
int _EventNPC(std::string package_name, QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers, luabind::object *l_func = nullptr);
std::vector<void*> *extra_pointers, luabind::adl::object *l_func = nullptr);
int _EventPlayer(std::string package_name, QuestEventID evt, Client *client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers, luabind::object *l_func = nullptr);
std::vector<void*> *extra_pointers, luabind::adl::object *l_func = nullptr);
int _EventItem(std::string package_name, QuestEventID evt, Client *client, ItemInst *item, Mob *mob, std::string data,
uint32 extra_data, std::vector<void*> *extra_pointers, luabind::object *l_func = nullptr);
uint32 extra_data, std::vector<void*> *extra_pointers, luabind::adl::object *l_func = nullptr);
int _EventSpell(std::string package_name, QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
std::vector<void*> *extra_pointers, luabind::object *l_func = nullptr);
std::vector<void*> *extra_pointers, luabind::adl::object *l_func = nullptr);
int _EventEncounter(std::string package_name, QuestEventID evt, std::string encounter_name, uint32 extra_data,
std::vector<void*> *extra_pointers);

View File

@ -31,7 +31,7 @@ void handle_npc_event_say(QuestInterface *parse, lua_State* L, NPC* npc, Mob *in
npc->DoQuestPause(init);
Lua_Client l_client(reinterpret_cast<Client*>(init));
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
@ -45,7 +45,7 @@ void handle_npc_event_say(QuestInterface *parse, lua_State* L, NPC* npc, Mob *in
void handle_npc_event_trade(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Client l_client(reinterpret_cast<Client*>(init));
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
@ -57,7 +57,7 @@ void handle_npc_event_trade(QuestInterface *parse, lua_State* L, NPC* npc, Mob *
for(size_t i = 0; i < extra_pointers->size(); ++i) {
std::string prefix = "item" + std::to_string(static_cast<long long>(i + 1));
Lua_ItemInst l_inst = reinterpret_cast<ItemInst*>(extra_pointers->at(i));
luabind::object l_inst_o = luabind::object(L, l_inst);
luabind::adl::object l_inst_o = luabind::adl::object(L, l_inst);
l_inst_o.push(L);
lua_setfield(L, -2, prefix.c_str());
@ -98,7 +98,7 @@ void handle_npc_event_hp(QuestInterface *parse, lua_State* L, NPC* npc, Mob *ini
void handle_npc_single_mob(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(init);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
}
@ -106,7 +106,7 @@ void handle_npc_single_mob(QuestInterface *parse, lua_State* L, NPC* npc, Mob *i
void handle_npc_single_client(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Client l_client(reinterpret_cast<Client*>(init));
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
}
@ -114,7 +114,7 @@ void handle_npc_single_client(QuestInterface *parse, lua_State* L, NPC* npc, Mob
void handle_npc_single_npc(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_NPC l_npc(reinterpret_cast<NPC*>(init));
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "other");
}
@ -122,7 +122,7 @@ void handle_npc_single_npc(QuestInterface *parse, lua_State* L, NPC* npc, Mob *i
void handle_npc_task_accepted(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Client l_client(reinterpret_cast<Client*>(init));
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
@ -133,7 +133,7 @@ void handle_npc_task_accepted(QuestInterface *parse, lua_State* L, NPC* npc, Mob
void handle_npc_popup(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(init);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
@ -144,7 +144,7 @@ void handle_npc_popup(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init,
void handle_npc_waypoint(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(init);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
@ -155,7 +155,7 @@ void handle_npc_waypoint(QuestInterface *parse, lua_State* L, NPC* npc, Mob *ini
void handle_npc_hate(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(init);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
@ -179,7 +179,7 @@ void handle_npc_timer(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init,
void handle_npc_death(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(init);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
@ -190,12 +190,12 @@ void handle_npc_death(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init,
int spell_id = std::stoi(sep.arg[1]);
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
@ -209,12 +209,12 @@ void handle_npc_cast(QuestInterface *parse, lua_State* L, NPC* npc, Mob *init, s
int spell_id = std::stoi(data);
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
@ -249,7 +249,7 @@ void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, st
Mob *o = entity_list.GetMobID(std::stoi(sep.arg[0]));
Lua_Mob l_mob(o);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "other");
@ -259,12 +259,12 @@ void handle_player_death(QuestInterface *parse, lua_State* L, Client* client, st
int spell_id = std::stoi(sep.arg[2]);
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
@ -284,12 +284,12 @@ void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* cl
const Item_Struct *item = database.GetItem(extra_data);
if(item) {
Lua_Item l_item(item);
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
} else {
Lua_Item l_item(nullptr);
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
}
@ -298,7 +298,7 @@ void handle_player_discover_item(QuestInterface *parse, lua_State* L, Client* cl
void handle_player_fish_forage_success(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_ItemInst l_item(reinterpret_cast<ItemInst*>(extra_pointers->at(0)));
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
}
@ -306,7 +306,7 @@ void handle_player_fish_forage_success(QuestInterface *parse, lua_State* L, Clie
void handle_player_click_object(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Object l_object(reinterpret_cast<Object*>(extra_pointers->at(0)));
luabind::object l_object_o = luabind::object(L, l_object);
luabind::adl::object l_object_o = luabind::adl::object(L, l_object);
l_object_o.push(L);
lua_setfield(L, -2, "object");
}
@ -314,7 +314,7 @@ void handle_player_click_object(QuestInterface *parse, lua_State* L, Client* cli
void handle_player_click_door(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Door l_door(reinterpret_cast<Doors*>(extra_pointers->at(0)));
luabind::object l_door_o = luabind::object(L, l_door);
luabind::adl::object l_door_o = luabind::adl::object(L, l_door);
l_door_o.push(L);
lua_setfield(L, -2, "door");
}
@ -334,7 +334,7 @@ void handle_player_popup_response(QuestInterface *parse, lua_State* L, Client* c
void handle_player_pick_up(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_ItemInst l_item(reinterpret_cast<ItemInst*>(extra_pointers->at(0)));
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
}
@ -344,11 +344,11 @@ void handle_player_cast(QuestInterface *parse, lua_State* L, Client* client, std
int spell_id = std::stoi(data);
if(IsValidSpell(spell_id)) {
Lua_Spell l_spell(&spells[spell_id]);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
} else {
Lua_Spell l_spell(nullptr);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
}
@ -370,7 +370,7 @@ void handle_player_zone(QuestInterface *parse, lua_State* L, Client* client, std
void handle_player_duel_win(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Client l_client(reinterpret_cast<Client*>(extra_pointers->at(1)));
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
}
@ -378,7 +378,7 @@ void handle_player_duel_win(QuestInterface *parse, lua_State* L, Client* client,
void handle_player_duel_loss(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Client l_client(reinterpret_cast<Client*>(extra_pointers->at(0)));
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
lua_setfield(L, -2, "other");
}
@ -386,12 +386,12 @@ void handle_player_duel_loss(QuestInterface *parse, lua_State* L, Client* client
void handle_player_loot(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_ItemInst l_item(reinterpret_cast<ItemInst*>(extra_pointers->at(0)));
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
Lua_Corpse l_corpse(reinterpret_cast<Corpse*>(extra_pointers->at(1)));
luabind::object l_corpse_o = luabind::object(L, l_corpse);
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
l_corpse_o.push(L);
lua_setfield(L, -2, "corpse");
}
@ -426,7 +426,7 @@ void handle_player_command(QuestInterface *parse, lua_State* L, Client* client,
lua_pushstring(L, command.c_str());
lua_setfield(L, -2, "command");
luabind::object args = luabind::newtable(L);
luabind::adl::object args = luabind::newtable(L);
int max_args = sep.GetMaxArgNum();
for(int i = 1; i < max_args; ++i) {
if(strlen(sep.arg[i]) > 0) {
@ -450,7 +450,7 @@ void handle_player_combine(QuestInterface *parse, lua_State* L, Client* client,
void handle_player_feign(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_NPC l_npc(reinterpret_cast<NPC*>(extra_pointers->at(0)));
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
lua_setfield(L, -2, "other");
}
@ -476,7 +476,7 @@ void handle_player_respawn(QuestInterface *parse, lua_State* L, Client* client,
void handle_player_packet(QuestInterface *parse, lua_State* L, Client* client, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_Packet l_packet(reinterpret_cast<EQApplicationPacket*>(extra_pointers->at(0)));
luabind::object l_packet_o = luabind::object(L, l_packet);
luabind::adl::object l_packet_o = luabind::adl::object(L, l_packet);
l_packet_o.push(L);
lua_setfield(L, -2, "packet");
@ -505,18 +505,18 @@ void handle_item_proc(QuestInterface *parse, lua_State* L, Client* client, ItemI
std::vector<void*> *extra_pointers) {
Lua_Mob l_mob(mob);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
lua_setfield(L, -2, "target");
if(IsValidSpell(extra_data)) {
Lua_Spell l_spell(&spells[extra_data]);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
} else {
Lua_Spell l_spell(nullptr);
luabind::object l_spell_o = luabind::object(L, l_spell);
luabind::adl::object l_spell_o = luabind::adl::object(L, l_spell);
l_spell_o.push(L);
lua_setfield(L, -2, "spell");
}
@ -526,12 +526,12 @@ void handle_item_loot(QuestInterface *parse, lua_State* L, Client* client, ItemI
std::vector<void*> *extra_pointers) {
if(mob && mob->IsCorpse()) {
Lua_Corpse l_corpse(mob->CastToCorpse());
luabind::object l_corpse_o = luabind::object(L, l_corpse);
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
l_corpse_o.push(L);
lua_setfield(L, -2, "corpse");
} else {
Lua_Corpse l_corpse(nullptr);
luabind::object l_corpse_o = luabind::object(L, l_corpse);
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
l_corpse_o.push(L);
lua_setfield(L, -2, "corpse");
}
@ -546,7 +546,7 @@ void handle_item_equip(QuestInterface *parse, lua_State* L, Client* client, Item
void handle_item_augment(QuestInterface *parse, lua_State* L, Client* client, ItemInst* item, Mob *mob, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_ItemInst l_item(reinterpret_cast<ItemInst*>(extra_pointers->at(0)));
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "aug");
@ -557,7 +557,7 @@ void handle_item_augment(QuestInterface *parse, lua_State* L, Client* client, It
void handle_item_augment_insert(QuestInterface *parse, lua_State* L, Client* client, ItemInst* item, Mob *mob, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_ItemInst l_item(reinterpret_cast<ItemInst*>(extra_pointers->at(0)));
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
@ -568,7 +568,7 @@ void handle_item_augment_insert(QuestInterface *parse, lua_State* L, Client* cli
void handle_item_augment_remove(QuestInterface *parse, lua_State* L, Client* client, ItemInst* item, Mob *mob, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
Lua_ItemInst l_item(reinterpret_cast<ItemInst*>(extra_pointers->at(0)));
luabind::object l_item_o = luabind::object(L, l_item);
luabind::adl::object l_item_o = luabind::adl::object(L, l_item);
l_item_o.push(L);
lua_setfield(L, -2, "item");
@ -588,15 +588,15 @@ void handle_spell_effect(QuestInterface *parse, lua_State* L, NPC* npc, Client*
std::vector<void*> *extra_pointers) {
if(npc) {
Lua_Mob l_npc(npc);
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
} else if(client) {
Lua_Mob l_client(client);
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
} else {
Lua_Mob l_mob(nullptr);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
}
@ -613,15 +613,15 @@ void handle_spell_tic(QuestInterface *parse, lua_State* L, NPC* npc, Client* cli
std::vector<void*> *extra_pointers) {
if(npc) {
Lua_Mob l_npc(npc);
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
} else if(client) {
Lua_Mob l_client(client);
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
} else {
Lua_Mob l_mob(nullptr);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
}
@ -644,15 +644,15 @@ void handle_spell_fade(QuestInterface *parse, lua_State* L, NPC* npc, Client* cl
std::vector<void*> *extra_pointers) {
if(npc) {
Lua_Mob l_npc(npc);
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
} else if(client) {
Lua_Mob l_client(client);
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
} else {
Lua_Mob l_mob(nullptr);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
}
@ -669,15 +669,15 @@ void handle_translocate_finish(QuestInterface *parse, lua_State* L, NPC* npc, Cl
std::vector<void*> *extra_pointers) {
if(npc) {
Lua_Mob l_npc(npc);
luabind::object l_npc_o = luabind::object(L, l_npc);
luabind::adl::object l_npc_o = luabind::adl::object(L, l_npc);
l_npc_o.push(L);
} else if(client) {
Lua_Mob l_client(client);
luabind::object l_client_o = luabind::object(L, l_client);
luabind::adl::object l_client_o = luabind::adl::object(L, l_client);
l_client_o.push(L);
} else {
Lua_Mob l_mob(nullptr);
luabind::object l_mob_o = luabind::object(L, l_mob);
luabind::adl::object l_mob_o = luabind::adl::object(L, l_mob);
l_mob_o.push(L);
}