From: <ma...@us...> - 2002-09-16 21:39:26
|
Update of /cvsroot/decaldev/source/Decal In directory usw-pr-cvs1:/tmp/cvs-serv15945 Modified Files: ACHooks.h ACHooks.cpp Log Message: Add SetAutorun implementation Index: ACHooks.h =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ACHooks.h 16 Sep 2002 21:27:17 -0000 1.18 --- ACHooks.h 16 Sep 2002 21:39:23 -0000 1.19 *************** *** 125,128 **** --- 125,131 ---- long m_lFaceHeading; + bool m_bSetAutorun; + long m_lSetAutorun; + bool m_bInternalStringConstructor; bool m_bInternalStringDestructor; *************** *** 169,172 **** --- 172,176 ---- STDMETHOD(ItemIsKnown)(long lGUID, VARIANT_BOOL* pRetval) ; STDMETHOD(SendTell)(long lPlayerID, BSTR Message); + STDMETHOD(SetAutorun)(VARIANT_BOOL bOnOff) ; static cACHooks* s_pACHooks; Index: ACHooks.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ACHooks.cpp 16 Sep 2002 21:27:17 -0000 1.19 --- ACHooks.cpp 16 Sep 2002 21:39:23 -0000 1.20 *************** *** 42,45 **** --- 42,46 ---- m_bMoveItemEx = false; m_bFaceHeading = false; + m_bSetAutorun = false; m_Hooks = 0 ; *************** *** 255,258 **** --- 256,264 ---- } + if( QueryMemLoc( _bstr_t( "SetAutorun" ), &Val ) == S_OK) + { + m_lSetAutorun = Val; + } + if (m_lMovementThingyParent && m_lMovementThingyOffset && m_lFaceHeading) { *************** *** 262,265 **** --- 268,278 ---- } + if (m_lMovementThingyParent && m_lMovementThingyOffset && m_lSetAutorun) + { + m_bSetAutorun = true; + + m_Hooks |= eSetAutorun; + } + /* // While the address of ObjectDestroyed is interesting, it isn't actually needed. *************** *** 1119,1122 **** --- 1132,1163 ---- *pRetval = lResult ? VARIANT_TRUE : VARIANT_FALSE; + + return S_OK; + } + + // Set auto-run, discovered by Madar on 9/16/2002 + STDMETHODIMP cACHooks::SetAutorun (VARIANT_BOOL bOnOff) + { + if (!m_bSetAutorun) + { + return S_FALSE; + } + + DWORD dwTemp = m_lSetAutorun; + + DWORD ** pTemp = (DWORD **) m_lMovementThingyParent; + + DWORD dwMovementThingy = pTemp[0][m_lMovementThingyOffset]; + + long lFirstArg = (bOnOff == VARIANT_TRUE) ? 1 : 0; + long lUnknown = 1; + + __asm + { + mov ecx,dwMovementThingy + push lUnknown + push lFirstArg + call dwTemp + } return S_OK; |