From 24d9e3266efc9b15cc2f4c63413ddc5d445b2e3a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 21 Aug 2005 16:38:45 +0000 Subject: [PATCH] wrong include, added pdata --- plugins/include/engine.inc | 8 -------- plugins/include/fakemeta.inc | 14 +++++++++++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/include/engine.inc b/plugins/include/engine.inc index f58539be..15430a52 100755 --- a/plugins/include/engine.inc +++ b/plugins/include/engine.inc @@ -279,12 +279,4 @@ native is_visible(entity, target); //Added at twistedeuphoria's request, see funcwiki for details native trace_forward(Float:start[3], Float:angle, Float:give, ignoreEnt, &Float:hitX, &Float:hitY, &Float:shortestDistance, &Float:shortestDistLow, &Float:shortestDistHigh); -//NOTE that for the string offsets below, on AMD64, a byref (char **) offset is NOT the same as an int offset -//In fact it's QWORD aligned rather than DWORD aligned, so the offset will be exactly half. -//Gets a string from a private offset. If byref is false, the string is treated as static rather than dynamic. -native get_pdata_string(entity, offset, dest[], maxlength, byref=1, linux=-5); - -//Sets a string in a private offset. -native set_pdata_string(entity, offset, const source[], realloc=2, linux=-5); - #include diff --git a/plugins/include/fakemeta.inc b/plugins/include/fakemeta.inc index 29509962..71191011 100755 --- a/plugins/include/fakemeta.inc +++ b/plugins/include/fakemeta.inc @@ -43,4 +43,16 @@ native dllfunc(type,{Float,Sql,Result,_}:...); // get: zero extra params - return int, one extra param = byref float or vector // set: use anything native get_tr(TraceResult:tr_member, {Float,_}:...); -native set_tr(TraceResult:tr_member, {Float,_}:...); \ No newline at end of file +native set_tr(TraceResult:tr_member, {Float,_}:...); + +//NOTE that for the string offsets below, on AMD64, a byref (char **) offset is NOT the same as an int offset +//In fact it's QWORD aligned rather than DWORD aligned, so the offset will be exactly half. +//Gets a string from a private offset. If byref is false, the string is treated as static rather than dynamic. +native get_pdata_string(entity, offset, dest[], maxlength, byref=1, linux=-5); + +//Sets a string in a private offset. +//realloc = -1 - nonbyref copy (static +//realloc = 0 - copy byref, no realloc *(char **) +//realloc = 1 - reallocate new string with free+malloc +//realloc = 2 - reallocate new string with delete[]+new[] +native set_pdata_string(entity, offset, const source[], realloc=2, linux=-5);