View Single Post
Author Message
laper32
AlliedModders Donor
Join Date: Nov 2019
Location: m_iName
Old 01-04-2020 , 12:07   [HELP] Particle precache with invalid handle
Reply With Quote #1

I'm using zombie plague's framework: https://forums.alliedmods.net/showthread.php?t=290657
When I import ZP's code about particle to my own, I found that here is an error occurs but several months ago it could work.

PHP Code:
L 01/05/2020 00:53:11: [SMException reportedInvalid Handle 0 (error 4)
L 01/05/2020 00:53:11: [SMCall stack trace:
L 01/05/2020 00:53:11: [SM]   [0SDKCall
L 01
/05/2020 00:53:11: [SM]   [1Line 170modules/manager/visualeffects/part
icles
.cpp::ParticlesFindTable
L 01
/05/2020 00:53:11: [SM]   [2Line 51modules/manager/visualeffects/parti
cles
.cpp::ParticlesOnCacheData 
The code is shown below:

PHP Code:
Handle hSDKCallContainerFindTable;

Address pNetworkStringTable;


void ParticlesOnCacheData()
{
    
// Validate that table is exist and it empty
    
Address pTable ParticlesFindTable("ParticleEffectNames");
    if(
pTable != Address_Null && !ParticlesCount())
    {
        
// Opens the file
        
File hFile OpenFile("particles/particles_manifest.txt""rt"true);
        
        
// If doesn't exist -> stop
        
if(hFile == null)
        {
            
SetFailState("Error opening file: \"particles/particles_manifest.txt\"");
            return;
        }

        
// Read lines in the file
        
static char sPath[256];
        while(
hFile.ReadLine(sPathsizeof(sPath)))
        {
            
// Checks if string has correct quotes
            
int iQuotes CountCharInString(sPath'"');
            if(
iQuotes == 4)
            {
                
// Trim string
                
TrimString(sPath);

                
// Copy value string
                
strcopy(sPathsizeof(sPath), sPath[strlen("\"file\"")]);
                
                
// Trim string
                
TrimString(sPath);
                
                
// Strips a quote pair off a string 
                
StripQuotes(sPath);

                
// Precache model
                
int i; if(sPath[i] == '!'i++;
                
PrecacheGeneric(sPath[i], true);
                
ParticlesClearTable(pTable); /// HACK~HACK
                /// Clear tables after each file because some of them contains
                /// huge amount of particles and we work around the limit
            
}
        }
    }
}

Address ParticlesFindTable(char[] sTable)
{
    return 
SDKCall(hSDKCallContainerFindTablepNetworkStringTablesTable);

I don't know why this error occurs....

UPDATE: This problem points to find signature eventually.
It seems that Valve has changed "CParticleSystemDictionary::~CParticleSystemD ictionary" address.
But overall, it solved, for me, at least.

Last edited by laper32; 01-05-2020 at 02:08.
laper32 is offline