Raised This Month: $12 Target: $400
 3% 

[SOLVED] About TrieSetArray Bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
powwoww
BANNED
Join Date: Oct 2008
Old 11-18-2009 , 23:25   [SOLVED] About TrieSetArray Bug
Reply With Quote #1

The function "TrieSetArray" doesnt work,the code below:
/////trie_natives.cpp
Function:
static cell AMX_NATIVE_CALL TrieSetArray(AMX *amx, cell *params){
celltrie *t = g_TrieHandles.lookup(params[2]);
SHOULD BE:
celltrie *t = g_TrieHandles.lookup(params[1]);
....
}

but I can't rebuild the source code of amxx, could anyone please fix it and rebuild and post it? Thank you very much.

Appreciate for your dll, joaquimandrade
Also thank Styles and Arkshine

Last edited by powwoww; 11-19-2009 at 04:45. Reason: Solved
powwoww is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 11-19-2009 , 00:38   Re: [REQ] About TrieSetArray Bug
Reply With Quote #2

Untested. If it doesn't work or if you want it for linux tell me.
Attached Files
File Type: zip amxmodx_mm.zip (299.3 KB, 200 views)
__________________

Last edited by joaquimandrade; 11-19-2009 at 00:40.
joaquimandrade is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-19-2009 , 02:59   Re: [REQ] About TrieSetArray Bug
Reply With Quote #3

Submit a bug fix to the ticket system. That way maybe somebody will patch it since Trie is very important now.
Styles is offline
Send a message via AIM to Styles
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-19-2009 , 04:05   Re: [REQ] About TrieSetArray Bug
Reply With Quote #4

Already done : https://bugs.alliedmods.net/show_bug.cgi?id=3816 ; though someone should give a diff.
__________________
Arkshine is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-19-2009 , 12:23   Re: [SOLVED] About TrieSetArray Bug
Reply With Quote #5

Quote:
TrieSetArray and TrieGetArray are broken and, as such, the stocks added basically mirror the functionality of TrieSetString/TrieGetString.
isn't that the same thing?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 11-19-2009 , 13:05   Re: [SOLVED] About TrieSetArray Bug
Reply With Quote #6

Quote:
Originally Posted by Owyn View Post
isn't that the same thing?
The problem is the same but, the purpose of that include is not solving it.
__________________
joaquimandrade is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-19-2009 , 13:09   Re: [SOLVED] About TrieSetArray Bug
Reply With Quote #7

There was a temporary fix that I've seen joaquim do as well as myself.
Create the array that you want to insert with a size +1 greater than you actually want.
Then, use Trie[Set|Get]String.

Example:
Code:
enum _:Data {     DATA_KILLS,     DATA_DEATHS,     DATA_ZEROTERMINATOR // ^0 for string end }; new Trie:g_tData; InsertData( iPlayer ) {     new szSteamID[ 35 ];     get_user_authid( iPlayer, szSteamID, 34 );         new iData[ Data ];     iData[ DATA_KILLS ] = get_user_frags( iPlayer );     iData[ DATA_DEATHS ] = cs_get_user_deaths( iPlayer );         TrieSetString( g_tData, szSteamID, iData ); } GetData( iPlayer, iData[ Data ] ) {     new szSteamID[ 35 ];     get_user_authid( iPlayer, szSteamID, 34 );     TrieGetString( g_tData, szSteamID, iData ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-19-2009 , 23:19   Re: [SOLVED] About TrieSetArray Bug
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
There was a temporary fix that I've seen joaquim do as well as myself.
Create the array that you want to insert with a size +1 greater than you actually want.
Then, use Trie[Set|Get]String.

Example:
Code:
enum _:Data {     DATA_KILLS,     DATA_DEATHS,     DATA_ZEROTERMINATOR // ^0 for string end }; new Trie:g_tData; InsertData( iPlayer ) {     new szSteamID[ 35 ];     get_user_authid( iPlayer, szSteamID, 34 );         new iData[ Data ];     iData[ DATA_KILLS ] = get_user_frags( iPlayer );     iData[ DATA_DEATHS ] = cs_get_user_deaths( iPlayer );         TrieSetString( g_tData, szSteamID, iData ); } GetData( iPlayer, iData[ Data ] ) {     new szSteamID[ 35 ];     get_user_authid( iPlayer, szSteamID, 34 );     TrieGetString( g_tData, szSteamID, iData ); }
This is exactly how I've been using Trie for data. Does anyone know if using GetArray is faster or better than using arrays of variables?
Styles is offline
Send a message via AIM to Styles
powwoww
BANNED
Join Date: Oct 2008
Old 11-21-2009 , 22:28   Re: [SOLVED] About TrieSetArray Bug
Reply With Quote #9

I'm not sure about the act of TrieS/GetString, in <newmenus>, the info string of item cannot support the number above 256.etc , and string is ZERO-BASED, though I can set an offset('0'.etc) to prevent the string from being truncated, its not simple....

Last edited by powwoww; 11-21-2009 at 22:31.
powwoww is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 11-22-2009 , 01:19   Re: [SOLVED] About TrieSetArray Bug
Reply With Quote #10

Explain that better in a new thread in scripting help. I'm not getting the relation between "<newmenus>" and tries.
joaquimandrade is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode