Raised This Month: $ Target: $400
 0% 

index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
outsiderlv
Senior Member
Join Date: Mar 2010
Old 12-01-2010 , 11:50   index out of bounds
Reply With Quote #1

PHP Code:
public fm_FEFindEntityInSphere(startFloat:origin[3], Float:radius)
{
    if( 
radius!=1500.0 || old_gametime!=get_gametime() )
        return 
FMRES_IGNORED;
    
    static 
hittraceFloat:user_origin[3], Float:absmax[3], Float:fraction;
    
hit start;
    
    
// run the same check to see what its result will be
    
while( (hit=engfunc(EngFunc_FindEntityInSpherehitoriginradius))>)
    {
        if(
no_flash[hit]) {
            
// hit a non- or dead-player
            
if( !is_user_alive(hit) )
            {
                
forward_return(FMV_CELLhit);
                return 
FMRES_SUPERCEDE;
            }
            
            
// aim for the body eyes
            
pev(hitpev_originuser_origin);
            
pev(hitpev_absmaxabsmax);
            
user_origin[2] = (absmax[2]-20.0);
            
engfunc(EngFunc_TraceLineoriginuser_originDONT_IGNORE_MONSTERS0trace);
            
            
// hit player eyes, grenade ok
            
if( get_tr2(traceTR_pHit)==hit )
            {
                
// start backup check (de_dust2 B bug - outmap bug)
                
engfunc(EngFunc_TraceLineuser_originoriginDONT_IGNORE_MONSTERShittrace);
                
                
// hit player eyes with backup check
                
get_tr2(traceTR_flFractionfraction);
                if( 
fraction==1.0 )
                {
                    if(
owner) {
                        
forward_return(FMV_CELL, -1);
                        return 
FMRES_SUPERCEDE;
                    }
                }
            }
        }
    }
    
    
// grenade could not hit anyones eyes, cancel the check
    
forward_return(FMV_CELL, -1);
    return 
FMRES_SUPERCEDE;

Where is the problem? Debug says that the problem is on line witch contains only "{".
outsiderlv is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-01-2010 , 12:07   Re: index out of bounds
Reply With Quote #2

Which line?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
outsiderlv
Senior Member
Join Date: Mar 2010
Old 12-01-2010 , 12:08   Re: index out of bounds
Reply With Quote #3

2nd in the code
outsiderlv is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-01-2010 , 16:41   Re: index out of bounds
Reply With Quote #4

It's probably this:
PHP Code:
        if(no_flash[hit]) { 
Move that to here:
PHP Code:
public fm_FEFindEntityInSphere(startFloat:origin[3], Float:radius)
{
    if( 
radius!=1500.0 || old_gametime!=get_gametime() )
        return 
FMRES_IGNORED;
    
    static 
hittraceFloat:user_origin[3], Float:absmax[3], Float:fraction;
    
hit start;
    
    
// run the same check to see what its result will be
    
while( (hit=engfunc(EngFunc_FindEntityInSpherehitoriginradius))>)
    {
        
// hit a non- or dead-player
        
if( !is_user_alive(hit) || !no_flash[hit] )
        {
            
forward_return(FMV_CELLhit);
            return 
FMRES_SUPERCEDE;
        }
        
        
// aim for the body eyes
        
pev(hitpev_originuser_origin);
        
pev(hitpev_absmaxabsmax);
        
user_origin[2] = (absmax[2]-20.0);
        
engfunc(EngFunc_TraceLineoriginuser_originDONT_IGNORE_MONSTERS0trace);
        
        
// hit player eyes, grenade ok
        
if( get_tr2(traceTR_pHit)==hit )
        {
            
// start backup check (de_dust2 B bug - outmap bug)
            
engfunc(EngFunc_TraceLineuser_originoriginDONT_IGNORE_MONSTERShittrace);
            
            
// hit player eyes with backup check
            
get_tr2(traceTR_flFractionfraction);
            if( 
fraction==1.0 )
            {
                if(
owner) {
                    
forward_return(FMV_CELL, -1);
                    return 
FMRES_SUPERCEDE;
                }
            }
        }
    }
    
    
// grenade could not hit anyones eyes, cancel the check
    
forward_return(FMV_CELL, -1);
    return 
FMRES_SUPERCEDE;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 11:17.


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