Removed unused boost header, fixed compiling with new luabind

Fixed TryFinishingBlow attempting to return by parameter reference.
The new luabind fails with a by_reference to by_value check. Using
a pointer accomplishes the same goal, but bypasses this issue.
This commit is contained in:
Adam Martin 2019-02-02 00:08:39 -06:00
parent 26eb4fb6e0
commit 5f23a72a16
5 changed files with 12 additions and 13 deletions

View File

@ -39,7 +39,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <boost/concept_check.hpp>
#ifdef BOTS
#include "bot.h"

View File

@ -508,37 +508,37 @@ luabind::scope lua_register_entity_list() {
luabind::scope lua_register_mob_list() {
return luabind::class_<Lua_Mob_List>("MobList")
.def_readwrite("entries", &Lua_Mob_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_Mob_List::entries, luabind::return_stl_iterator());
}
luabind::scope lua_register_client_list() {
return luabind::class_<Lua_Client_List>("ClientList")
.def_readwrite("entries", &Lua_Client_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_Client_List::entries, luabind::return_stl_iterator());
}
luabind::scope lua_register_npc_list() {
return luabind::class_<Lua_NPC_List>("NPCList")
.def_readwrite("entries", &Lua_NPC_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_NPC_List::entries, luabind::return_stl_iterator());
}
luabind::scope lua_register_corpse_list() {
return luabind::class_<Lua_Corpse_List>("CorpseList")
.def_readwrite("entries", &Lua_Corpse_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_Corpse_List::entries, luabind::return_stl_iterator());
}
luabind::scope lua_register_object_list() {
return luabind::class_<Lua_Object_List>("ObjectList")
.def_readwrite("entries", &Lua_Object_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_Object_List::entries, luabind::return_stl_iterator());
}
luabind::scope lua_register_door_list() {
return luabind::class_<Lua_Doors_List>("DoorList")
.def_readwrite("entries", &Lua_Doors_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_Doors_List::entries, luabind::return_stl_iterator());
}
luabind::scope lua_register_spawn_list() {
return luabind::class_<Lua_Spawn_List>("SpawnList")
.def_readwrite("entries", &Lua_Spawn_List::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_Spawn_List::entries, luabind::return_stl_iterator());
}
#endif

View File

@ -63,7 +63,7 @@ luabind::scope lua_register_hate_entry() {
luabind::scope lua_register_hate_list() {
return luabind::class_<Lua_HateList>("HateList")
.def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator);
.def_readwrite("entries", &Lua_HateList::entries, luabind::return_stl_iterator());
}
#endif

View File

@ -2141,9 +2141,9 @@ bool Lua_Mob::IsBerserk() {
return self->IsBerserk();
}
bool Lua_Mob::TryFinishingBlow(Lua_Mob defender, int &damage) {
bool Lua_Mob::TryFinishingBlow(Lua_Mob defender, int *damage) {
Lua_Safe_Call_Bool();
return self->TryFinishingBlow(defender, damage);
return self->TryFinishingBlow(defender, *damage);
}
int Lua_Mob::GetBodyType()
@ -2540,7 +2540,7 @@ luabind::scope lua_register_mob() {
.def("AttackAnimation", &Lua_Mob::AttackAnimation)
.def("GetWeaponDamage", &Lua_Mob::GetWeaponDamage)
.def("IsBerserk", &Lua_Mob::IsBerserk)
.def("TryFinishingBlow", &Lua_Mob::TryFinishingBlow)
.def("TryFinishingBlow", (bool(Lua_Mob::*)(int*))&Lua_Mob::TryFinishingBlow)
.def("GetBodyType", &Lua_Mob::GetBodyType)
.def("GetOrigBodyType", &Lua_Mob::GetOrigBodyType)
.def("CheckNumHitsRemaining", &Lua_Mob::CheckNumHitsRemaining);

View File

@ -411,7 +411,7 @@ public:
int AttackAnimation(int Hand, Lua_ItemInst weapon);
int GetWeaponDamage(Lua_Mob against, Lua_ItemInst weapon);
bool IsBerserk();
bool TryFinishingBlow(Lua_Mob defender, int &damage);
bool TryFinishingBlow(Lua_Mob defender, int *damage);
int GetBodyType();
int GetOrigBodyType();
void CheckNumHitsRemaining(int type, int32 buff_slot, uint16 spell_id);