Skip to content

Commit ab593a0

Browse files
committed
Area/Appearance: Use address of member function for function hooks.
1 parent 5b2c68d commit ab593a0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

NWNXLib/API/API/CNWSArea.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class CNWSArea : public CNWArea, public CResHelper<CResARE, 2012>, public CGameO
108108
~CNWSArea();
109109
virtual CNWSArea * AsNWSArea();
110110
virtual CNWSArea * NWAreaAsNWSArea();
111-
BOOL AddObjectToArea(OBJECT_ID id, BOOL bRunScripts = true);
111+
NWNX_IMPORT BOOL AddObjectToArea(OBJECT_ID id, BOOL bRunScripts = true);
112112
BOOL AIUpdate();
113113
Vector ComputeAwayVector(Vector vCurrentPosition, Vector vPositionToMoveAwayFrom, float fMoveAwayRange, CPathfindInformation * pPathInfo);
114114
int32_t ComputeBestCorner(float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, float fPersonalSpace, float fCreatureHeight, float * fNewX1, float * fNewY1, float * fNewX2, float * fNewY2);

NWNXLib/API/API/CNWSMessage.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class CNWSMessage : public CNWMessage
183183
void ComputeGameObjectUpdateForYourselfToo(CNWSPlayer * pPlayer, CNWSObject * pPlayerGameObject, CGameObjectArray * pGameObjectArray, OBJECT_ID oidObjectToUpdate);
184184
void ComputeGameObjectUpdateForYourself(CNWSPlayer * pPlayer, CNWSObject * pPlayerGameObject, CGameObjectArray * pGameObjectArray, OBJECT_ID oidObjectToUpdate);
185185
CNWSPlayerLUOSortedObjectList * SortObjectsForGameObjectUpdate(CNWSPlayer * pPlayer, CNWSObject * pPlayerGameObject, CGameObjectArray * pGameObjectArray, int32_t * nMembersInSortedList);
186-
void ComputeGameObjectUpdateForObject(CNWSPlayer * pPlayer, CNWSObject * pPlayerGameObject, CGameObjectArray * pGameObjectArray, OBJECT_ID oidObjectToUpdate);
186+
NWNX_IMPORT void ComputeGameObjectUpdateForObject(CNWSPlayer * pPlayer, CNWSObject * pPlayerGameObject, CGameObjectArray * pGameObjectArray, OBJECT_ID oidObjectToUpdate);
187187
BOOL ComputeGameObjectUpdateForCategory(uint32_t nCategory, uint32_t nMessageLimit, CNWSPlayer * pPlayer, CNWSObject * pPlayerGameObject, CGameObjectArray * pGameObjectArray, CNWSPlayerLUOSortedObjectList * pSortedList, int32_t nSortedListSize);
188188
void TestPartyObjectUpdateDifferences(CNWSPlayer * pPlayer, CNWSCreature * pPartyCreature, CLastUpdatePartyObject * * pLastUpdatePartyObject, uint32_t * nObjectUpdatesRequired);
189189
void StoreValuesInLastUpdatePartyObject(CNWSCreature * pPlayerCreature, CLastUpdatePartyObject * pLastUpdatePartyObject, CNWSCreature * pPartyCreature, uint32_t nObjectUpdatesRequired);

Plugins/Appearance/Appearance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static void SetIntValue(int32_t type, int32_t value, std::bitset<OverrideType_MA
7070
}
7171

7272
static Hooks::Hook s_ComputeGameObjectUpdateForObjectHook =
73-
Hooks::HookFunction(Functions::_ZN11CNWSMessage32ComputeGameObjectUpdateForObjectEP10CNWSPlayerP10CNWSObjectP16CGameObjectArrayj,
73+
Hooks::HookFunction(&CNWSMessage::ComputeGameObjectUpdateForObject,
7474
+[](CNWSMessage *pMessage, CNWSPlayer *pPlayer, CNWSObject *pPlayerGameObject,
7575
CGameObjectArray *pGameObjectArray, ObjectID oidObjectToUpdate)
7676
{

Plugins/Area/Area.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ NWNX_EXPORT ArgumentStack SetDefaultObjectUiDiscoveryMask(ArgumentStack&& args)
13851385
}
13861386
};
13871387

1388-
static Hooks::Hook pAddObjectToAreaHook = Hooks::HookFunction(Functions::_ZN8CNWSArea15AddObjectToAreaEji,
1388+
static Hooks::Hook pAddObjectToAreaHook = Hooks::HookFunction(&CNWSArea::AddObjectToArea,
13891389
+[](CNWSArea *pThis, ObjectID id, BOOL bRunScripts) -> BOOL
13901390
{
13911391
auto retVal = pAddObjectToAreaHook->CallOriginal<BOOL>(pThis, id, bRunScripts);

0 commit comments

Comments
 (0)