Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,706
    Reputation
    907
    Thanks
    7,297
    My Mood
    Mellow
    Quick question, why are you calling delete[] on stack allocated memory?

    Code:
    char ptc[256];
    sprintf(ptc,"%s %.3f",this->base.c_str(),this->fOn);
    this->finalCommandOn = std::string(ptc);
    sprintf(ptc,"%s %.3f",this->base.c_str(),this->fOff);
    this->finalCommandOff = std::string(ptc);
    delete[] ptc;
    You run the risk of segfaults and all that sort of deliciousness.
    C++ calling delete on variable allocated on the stack - Stack Overflow

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  2. #17
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    lol he doesnt need to manually delete it at all.
    Theres a garbage collector...

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  3. #18
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,706
    Reputation
    907
    Thanks
    7,297
    My Mood
    Mellow
    Quote Originally Posted by Ch40zz-C0d3r View Post
    lol he doesnt need to manually delete it at all.
    Theres a garbage collector...
    No there isn't, not in C++. It's called stack allocation. The required memory quantity is known at compile time and allocated on the stack. Once the function returns the stack pointer is adjusted (usually this is found in the epilogue code) and the memory is free to be used by other functions for local variables.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  4. The Following User Says Thank You to Jason For This Useful Post:

    Shadow` (01-29-2013)

  5. #19
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    Quote Originally Posted by Jason View Post


    No there isn't, not in C++. It's called stack allocation. The required memory quantity is known at compile time and allocated on the stack. Once the function returns the stack pointer is adjusted (usually this is found in the epilogue code) and the memory is free to be used by other functions for local variables.
    Woah youre right :O
    Sorry, just had a different language in my mind...
    Thanks for clarify

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  6. #20
    Saltine's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    494
    Reputation
    104
    Thanks
    625
    Quote Originally Posted by Jason View Post
    Quick question, why are you calling delete[] on stack allocated memory?

    Code:
    char ptc[256];
    sprintf(ptc,"%s %.3f",this->base.c_str(),this->fOn);
    this->finalCommandOn = std::string(ptc);
    sprintf(ptc,"%s %.3f",this->base.c_str(),this->fOff);
    this->finalCommandOff = std::string(ptc);
    delete[] ptc;
    You run the risk of segfaults and all that sort of deliciousness.
    C++ calling delete on variable allocated on the stack - Stack Overflow
    Thanks for pointing that out, I didn't realize this!

    Oh no! Vortex is gay!

  7. #21
    RobinC's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    Mpgh.exe
    Posts
    1,771
    Reputation
    69
    Thanks
    3,657
    My Mood
    Aggressive
    Well, I bet some peeps are actualy going to compile only this sh!t and saying "this won't work"....

  8. #22
    Code_over_Pussy's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    67
    Reputation
    10
    Thanks
    9
    My Mood
    Amused
    hey i copy pasted your base in c++ and it has errors PLEASE FIX so i can leech it

  9. The Following User Says Thank You to Code_over_Pussy For This Useful Post:

    Acea (01-30-2013)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Release] Flameswor10's Hotkey Base
    By flameswor10 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 88
    Last Post: 10-11-2010, 04:44 AM
  2. [Request] hotkeys base running CA
    By filecroc in forum Combat Arms Coding Help & Discussion
    Replies: 8
    Last Post: 10-09-2010, 12:06 AM
  3. [Release]wassup40 hotkey base
    By wassup40 in forum Combat Arms EU Hack Coding/Source Code
    Replies: 40
    Last Post: 08-15-2010, 11:57 PM
  4. [RELEASE]Mwb1234 Cumbat Arabs Hotkey Base
    By mwb1234 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 14
    Last Post: 06-17-2010, 03:27 AM
  5. New HotKey Base
    By powerfear in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 14
    Last Post: 04-26-2010, 12:55 AM