View Single Post
Author Message
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-14-2019 , 13:06   Datapack out of bounds
Reply With Quote #1

Can anyone shed some light on this error? I think I've provided all the code needed.

Code:
L 09/14/2019 - 10:58:26: [SM] Blaming: dstrikeperks1.smx
L 09/14/2019 - 10:58:26: [SM] Call stack trace:
L 09/14/2019 - 10:58:26: [SM]   [0] DataPack.ReadFloat
L 09/14/2019 - 10:58:26: [SM]   [1] Line 157, D:\Dev\Programming\Pawn\sourcemod\scripting\dstrikeperks1.sp::Timer_ArtyDetonate
L 09/14/2019 - 10:58:26: [SM] Exception reported: DataPack operation is out of bounds.
PHP Code:
    DataPack dp_ShotPack = new DataPack();
    
    for (
int iNUM_EXPLOSIONSi++)
    {
        
CreateDataTimer(f_ShotTime+5.0Timer_ArtyDetonatedp_ShotPack);

        
dp_ShotPack.WriteFloat(f_vCoords[0]);
        
dp_ShotPack.WriteFloat(f_vCoords[1]);
        
dp_ShotPack.WriteFloat(f_vCoords[2]);
    }

public 
Action Timer_ArtyDetonate(Handle timerDataPack dp_ShotPack)
{
    
float f_vCoords[3];
    
dp_ShotPack.Reset();
    
DispatchSpawn(iAmbientLight);
    
TeleportEntity(iAmbientLightf_vCoordsNULL_VECTORNULL_VECTOR);
    
CreateTimer(0.3Timer_TurnOffLightEntIndexToEntRef(iAmbientLight));
    
f_vCoords[0] = dp_ShotPack.ReadFloat() + GetRandomFloat(-100.0100.0); //Line 157
    
f_vCoords[1] = dp_ShotPack.ReadFloat() + GetRandomFloat(-100.0100.0);
    
f_vCoords[2] = dp_ShotPack.ReadFloat(); 
Halt is offline