From 4ed906248d8fe74a8bfd2b6655ebc3358409092a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 14 Sep 2004 23:39:22 +0000 Subject: [PATCH] Fixed traceresults (Freecode) --- dlls/fakemeta/fakemeta_amxx.cpp | 1 + dlls/fakemeta/fm_tr.h | 2 ++ dlls/fakemeta/forward.cpp | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/fakemeta/fakemeta_amxx.cpp b/dlls/fakemeta/fakemeta_amxx.cpp index 63cad68b..5da36ea1 100755 --- a/dlls/fakemeta/fakemeta_amxx.cpp +++ b/dlls/fakemeta/fakemeta_amxx.cpp @@ -9,6 +9,7 @@ void OnAmxxAttach() MF_AddNatives(pev_natives); MF_AddNatives(forward_natives); MF_AddNatives(pdata_natives); + MF_AddNatives(tr_Natives); } int GetHullBounds(int hullnumber, float *mins, float *maxs); // sawce: Do not null out the forward for ServerActivate. It's required for the INDEXENT() fix. (I don't think ServerActivate is planned on being forwarded anyway) diff --git a/dlls/fakemeta/fm_tr.h b/dlls/fakemeta/fm_tr.h index 811cb7b2..a0b32dd9 100755 --- a/dlls/fakemeta/fm_tr.h +++ b/dlls/fakemeta/fm_tr.h @@ -15,4 +15,6 @@ enum TR_iHitgroup, }; +extern AMX_NATIVE_INFO tr_Natives[]; + #endif //_INCLUDE_TR_H \ No newline at end of file diff --git a/dlls/fakemeta/forward.cpp b/dlls/fakemeta/forward.cpp index a8d50363..f00642f4 100755 --- a/dlls/fakemeta/forward.cpp +++ b/dlls/fakemeta/forward.cpp @@ -97,7 +97,7 @@ void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentT cell vec2[3] = {amx_ftoc(v2[0]), amx_ftoc(v2[1]), amx_ftoc(v2[2])}; cell retvec1 = MF_PrepareCellArray(vec1, 3); cell retvec2 = MF_PrepareCellArray(vec2, 3); - FM_ENG_HANDLE(FM_TraceLine, (Engine[FM_TraceLine].at(i), vec1, vec2, fNoMonsters, ENTINDEX(pentToSkip), (cell)ptr)); + FM_ENG_HANDLE(FM_TraceLine, (Engine[FM_TraceLine].at(i), retvec1, retvec2, fNoMonsters, ENTINDEX(pentToSkip), (cell)ptr)); RETURN_META(mswi(lastFmRes)); } @@ -107,7 +107,7 @@ void TraceLine_post(const float *v1, const float *v2, int fNoMonsters, edict_t * cell vec2[3] = {amx_ftoc(v2[0]), amx_ftoc(v2[1]), amx_ftoc(v2[2])}; cell retvec1 = MF_PrepareCellArray(vec1, 3); cell retvec2 = MF_PrepareCellArray(vec2, 3); - FM_ENG_HANDLE(FM_TraceLine, (Engine[FM_TraceLine].at(i), vec1, vec2, fNoMonsters, ENTINDEX(pentToSkip), (cell)ptr)); + FM_ENG_HANDLE(FM_TraceLine, (Engine[FM_TraceLine].at(i), retvec1, retvec2, fNoMonsters, ENTINDEX(pentToSkip), (cell)ptr)); RETURN_META(MRES_IGNORED); }