CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Light Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
little infinite scrolling system, g_hudelem parent/child bleed fix *UPDATED*
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Xeirh" data-source="post: 82418" data-attributes="member: 201981"><p>nothing complicated about that, arrays use twice as much memory, you have to undefine parent also to restore the memory. destroy automatically undefines the element, array = 1 parent, contents = 1 child, destroy = +1 child, but now you have to manually undefine the parent to restore the memory. not using arrays is a lot cleaner and faster and they have to get indexed every time.</p><p></p><p>[CODE=cpp]</p><p>destroy_all( array )</p><p>{</p><p> // no reason for the array to be undefined so skip the statement</p><p></p><p> foreach( x, key in getarraykeys( array ) )</p><p> {</p><p> if( !isdefined( array[ key ] ) )</p><p> continue;</p><p></p><p> self destroy_element( array[ key ] );</p><p> }</p><p></p><p> array = undefined; // memory restored, this might runtime array ref depending on the compiler</p><p>}[/CODE]</p><p></p><p>and if you're worried about a handful of destroy_elements, just use a non-localized array and combine or add to and for loop destroy.</p></blockquote><p></p>
[QUOTE="Xeirh, post: 82418, member: 201981"] nothing complicated about that, arrays use twice as much memory, you have to undefine parent also to restore the memory. destroy automatically undefines the element, array = 1 parent, contents = 1 child, destroy = +1 child, but now you have to manually undefine the parent to restore the memory. not using arrays is a lot cleaner and faster and they have to get indexed every time. [CODE=cpp] destroy_all( array ) { // no reason for the array to be undefined so skip the statement foreach( x, key in getarraykeys( array ) ) { if( !isdefined( array[ key ] ) ) continue; self destroy_element( array[ key ] ); } array = undefined; // memory restored, this might runtime array ref depending on the compiler }[/CODE] and if you're worried about a handful of destroy_elements, just use a non-localized array and combine or add to and for loop destroy. [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
little infinite scrolling system, g_hudelem parent/child bleed fix *UPDATED*
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top