Jump to content

Stack overflow


Axel

Recommended Posts

marker = createMarker ( 2726.98633, -2015.18066, 12.55469, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
markere = {  
            { 2701.85010, -2007.65076, 13.39157 }, 
            { 2696.19385, -1999.32336, 13.30278 }, 
           }    
  
function create ()    
local x,y,z = unpack ( markere [ math.random ( #markere ) ] ) 
createMarker ( x, y, z+2, "arrow", 1.5, 255, 255, 0, 170 ) 
createVehicle ( 411, x, y, z) 
end 
addEventHandler("onMarkerHit",getRootElement(),create) 

The problem is that where i hit the marker, it creates alot of vehicles and outputs a error about stack overflow, then it times out..

Link to comment
marker = createMarker ( 2726.98633, -2015.18066, 12.55469, "cylinder", 1.5, 255, 255, 0, 170 ) 
  
markere = { 
            { 2701.85010, -2007.65076, 13.39157 }, 
            { 2696.19385, -1999.32336, 13.30278 }, 
           }   
  
function create ()   
local x,y,z = unpack ( markere [ math.random ( #markere ) ] ) 
createMarker ( x, y, z+2, "arrow", 1.5, 255, 255, 0, 170 ) 
createVehicle ( 411, x, y, z) 
end 
addEventHandler("onMarkerHit", marker, create) 

Link to comment
No... i used getRootElement() instead of marker so when i was hitting it it was returning and creating the vehicle and marker over and over again....

It should not anyway.

Someone needs some lessons on what, how, and why a program uses a stack. Most importantly, how an over flow occurs.

Link to comment
No... i used getRootElement() instead of marker so when i was hitting it it was returning and creating the vehicle and marker over and over again....

It should not anyway.

Someone needs some lessons on what, how, and why a program uses a stack. Most importantly, how an over flow occurs.

I don't need any lessons about that, I know perfectly that. I just did not know that it would re-call every time using "root" ( never had that issue ).

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...