user messages tested and working
fixed some floating point casts --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40603
This commit is contained in:
parent
d8c02c294f
commit
95dcffc972
@ -244,6 +244,7 @@ bf_write *CUserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_ty
|
|||||||
m_CurId = msg_type;
|
m_CurId = msg_type;
|
||||||
m_CurRecFilter = filter;
|
m_CurRecFilter = filter;
|
||||||
m_InHook = true;
|
m_InHook = true;
|
||||||
|
m_BlockEndPost = false;
|
||||||
|
|
||||||
if (!is_intercept_empty)
|
if (!is_intercept_empty)
|
||||||
{
|
{
|
||||||
@ -268,7 +269,7 @@ bf_write *CUserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_t
|
|||||||
|
|
||||||
void CUserMessages::OnMessageEnd_Post()
|
void CUserMessages::OnMessageEnd_Post()
|
||||||
{
|
{
|
||||||
if (!m_InHook || (META_RESULT_STATUS == MRES_SUPERCEDE))
|
if (!m_InHook || m_BlockEndPost)
|
||||||
{
|
{
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
@ -340,6 +341,8 @@ void CUserMessages::OnMessageEnd_Pre()
|
|||||||
pInfo->IsHooked = true;
|
pInfo->IsHooked = true;
|
||||||
res = pInfo->Callback->InterceptUserMessage(m_CurId, &m_InterceptBuffer, m_CurRecFilter);
|
res = pInfo->Callback->InterceptUserMessage(m_CurId, &m_InterceptBuffer, m_CurRecFilter);
|
||||||
|
|
||||||
|
intercepted = true;
|
||||||
|
|
||||||
switch (res)
|
switch (res)
|
||||||
{
|
{
|
||||||
case Pl_Stop:
|
case Pl_Stop:
|
||||||
@ -375,10 +378,10 @@ void CUserMessages::OnMessageEnd_Pre()
|
|||||||
_DecRefCounter();
|
_DecRefCounter();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pInfo->IsHooked = false;
|
pInfo->IsHooked = false;
|
||||||
intercepted = true;
|
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,8 +398,6 @@ void CUserMessages::OnMessageEnd_Pre()
|
|||||||
m_ReadBuffer.StartReading(m_InterceptBuffer.GetBasePointer(), m_InterceptBuffer.GetNumBytesWritten());
|
m_ReadBuffer.StartReading(m_InterceptBuffer.GetBasePointer(), m_InterceptBuffer.GetNumBytesWritten());
|
||||||
engine_bfw->WriteBitsFromBuffer(&m_ReadBuffer, m_InterceptBuffer.GetNumBitsWritten());
|
engine_bfw->WriteBitsFromBuffer(&m_ReadBuffer, m_InterceptBuffer.GetNumBitsWritten());
|
||||||
ENGINE_CALL(MessageEnd)();
|
ENGINE_CALL(MessageEnd)();
|
||||||
|
|
||||||
goto supercede;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pList = &m_msgHooks[m_CurId];
|
pList = &m_msgHooks[m_CurId];
|
||||||
@ -418,8 +419,9 @@ void CUserMessages::OnMessageEnd_Pre()
|
|||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META((intercepted) ? MRES_SUPERCEDE : MRES_IGNORED);
|
||||||
supercede:
|
supercede:
|
||||||
m_InHook = false;
|
m_InHook = false;
|
||||||
|
m_BlockEndPost = true;
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ private:
|
|||||||
bf_read m_ReadBuffer;
|
bf_read m_ReadBuffer;
|
||||||
size_t m_HookCount;
|
size_t m_HookCount;
|
||||||
bool m_InHook;
|
bool m_InHook;
|
||||||
|
bool m_BlockEndPost;
|
||||||
|
|
||||||
Trie *m_Names;
|
Trie *m_Names;
|
||||||
CellRecipientFilter m_CellRecFilter;
|
CellRecipientFilter m_CellRecFilter;
|
||||||
|
@ -351,9 +351,9 @@ static cell_t GetEntDataVector(IPluginContext *pContext, const cell_t *params)
|
|||||||
cell_t *vec;
|
cell_t *vec;
|
||||||
pContext->LocalToPhysAddr(params[3], &vec);
|
pContext->LocalToPhysAddr(params[3], &vec);
|
||||||
|
|
||||||
vec[0] = v->x;
|
vec[0] = sp_ftoc(v->x);
|
||||||
vec[1] = v->y;
|
vec[1] = sp_ftoc(v->y);
|
||||||
vec[2] = v->z;
|
vec[2] = sp_ftoc(v->z);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -379,9 +379,9 @@ static cell_t SetEntDataVector(IPluginContext *pContext, const cell_t *params)
|
|||||||
cell_t *vec;
|
cell_t *vec;
|
||||||
pContext->LocalToPhysAddr(params[3], &vec);
|
pContext->LocalToPhysAddr(params[3], &vec);
|
||||||
|
|
||||||
v->x = vec[0];
|
v->x = sp_ctof(vec[0]);
|
||||||
v->y = vec[1];
|
v->y = sp_ctof(vec[1]);
|
||||||
v->z = vec[2];
|
v->z = sp_ctof(vec[2]);
|
||||||
|
|
||||||
if (params[4])
|
if (params[4])
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user