Raised This Month: $ Target: $400
 0% 

String somehow decides to change itself


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-08-2014 , 07:06   String somehow decides to change itself
Reply With Quote #1

Does this make sense to anyone of you?

PHP Code:
client_print0print_chat"Getting the zone..." )
    
new 
szCurrentZone32 ]
if( 
ARP_GetUserZoneidszCurrentZonecharsmaxszCurrentZone ) ) )
{
    
client_print0print_chat"CurrentZone: %s"szCurrentZone )
    
// outputs: CurrentZone: Wagnaria
        
    
new aDataFileStruct ]
        
    
ArrayGetArrayg_aAllSoundsiArrayIdaData )
        
    
client_print0print_chat"Setting trie string to %s. Zone: %s"aData__szFileName ], szCurrentZone )
    
// outputs: Setting trie string to wagnaria.mp3. Zone: agnaria.mp3
        
    
TrieSetStringg_tZonesszCurrentZoneaData__szFileName ] )
        
    new 
szMusic32 ]
    
TrieGetStringg_tZonesszCurrentZoneszMusiccharsmaxszMusic ) )
        
    
client_print0print_chat"The Trie string of %s is now %s."szCurrentZoneszMusic )
    
// outputs: The Trie string of agnaria.mp3 is now wagnaria.mp3.

As you can see, the first client_print outputs the correct string, but the second one is where things start getting strange. Without ABSOLUTELY ANY change to the szCurrentZone string, for some reason after the ArrayGetArray native call it changes itself to agnaria.mp3, which is aData[ __szFileName ] without the first letter.

What is going on? This is getting me a headache... And why is it always me with these weird ass problems?
Backstabnoob is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-08-2014 , 07:11   Re: String somehow decides to change itself
Reply With Quote #2

This gotta be a record. Solving it 4 minutes after posting, I feel ashamed.

It seems that doing this at 3 AM in the morning really has its disadventages, I used a wrong structure for the aData variable.

Still makes me wonder how can this even happen, shouldn't I get some sort of access violation error? o.O
Backstabnoob 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 09:35.


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