Skip to content

Commit

Permalink
xrServerEntities/xrServer_Objects_ALife_Monsters_script.cpp: prevent …
Browse files Browse the repository at this point in the history
…of forwarding incorrect types to Lua
  • Loading branch information
ChugunovRoman committed Nov 28, 2023
1 parent 60a5508 commit 9eaeaf3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/xrGame/map_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ SCRIPT_EXPORT(CMapLocation, (),
//.def(constructor<>())
.def("HintEnabled", &CMapLocation::HintEnabled)
.def("GetHint", &CMapLocation::GetHint)
.def("SetHint", &CMapLocation::SetHint)
.def("SetHint", +[](CMapLocation* self, LPCSTR hint) {
self->SetHint(hint);
})
.def("PointerEnabled", &CMapLocation::PointerEnabled)
.def("EnablePointer", &CMapLocation::EnablePointer)
.def("DisablePointer", &CMapLocation::DisablePointer)
Expand All @@ -39,7 +41,9 @@ SCRIPT_EXPORT(CMapLocation, (),
.def("SpotEnabled", &CMapLocation::SpotEnabled)
.def("EnableSpot", &CMapLocation::EnableSpot)
.def("DisableSpot", &CMapLocation::DisableSpot)
.def("GetLevelName", &CMapLocation::GetLevelName)
.def("GetLevelName", +[](CMapLocation* self) {
return self->GetLevelName().c_str();
})
.def("GetPosition", &CMapLocation::GetPosition)
.def("ObjectID", &CMapLocation::ObjectID)
.def("GetLastPosition", &CMapLocation::GetLastPosition)
Expand Down
4 changes: 3 additions & 1 deletion src/xrGame/script_movement_action_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ SCRIPT_EXPORT(CScriptMovementAction, (),
.def("move", &CScriptMovementAction::SetMovementType)
.def("path", &CScriptMovementAction::SetPathType)
.def("object", &CScriptMovementAction::SetObjectToGo)
.def("patrol", &CScriptMovementAction::SetPatrolPath)
.def("patrol", +[](CScriptMovementAction* self, const CPatrolPath* path, LPCSTR path_name) {
self->SetPatrolPath(path, path_name);
})
.def("position", &CScriptMovementAction::SetPosition)
.def("input", &CScriptMovementAction::SetInputKeys)
.def("completed", &CScriptAbstractAction::completed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SCRIPT_EXPORT(CSE_ALifeTraderAbstract, (),
.def("profile_name", +[](CSE_ALifeTraderAbstract* ta) { return ta->character_profile().c_str(); })
.def("set_profile_name", +[](CSE_ALifeTraderAbstract* ta, const pcstr str) { ta->set_character_profile(str); })
.def("character_name", +[](CSE_ALifeTraderAbstract* ta) { return ta->m_character_name.c_str(); })
.def("set_character_name", +[](CSE_ALifeTraderAbstract* ta, const pcstr str) { return ta->m_character_name = str; })
.def("set_character_name", +[](CSE_ALifeTraderAbstract* ta, const pcstr str) { ta->m_character_name = str; })
.def("rank", &CSE_ALifeTraderAbstract::Rank)
.def("set_rank", &CSE_ALifeTraderAbstract::SetRank)
.def("reputation", &CSE_ALifeTraderAbstract::Reputation)
Expand Down

0 comments on commit 9eaeaf3

Please sign in to comment.