Results 1 to 9 of 9

Thread: Unmatched functions between CoD

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    There is not much code, you can describe it as your own function (translate pseudocode in C/C++)

    You can analyze the function in which this section is located, it is possible to call the upper function with certain parameters, which guarantees that this piece of code is called and only it is called

    Here is a translation example, simple and straightforward:
    https://github.com/damage99/libcod/b...layer.cpp#L830


    If you need to replace only a piece of code, but leave the main function unchanged, then the simplest options are to analyze the conditions and, if they match (this subroutine is called in the original) - replace it with a function call that you translated from pseudocode; if the conditions are different, just call the original function
    *like this:
    https://github.com/damage99/libcod/b...ibcod.cpp#L139
    : only you need to analyze the input arguments of this function, when you understand that the required subroutine should be called, then call reworked_func(), if not, then call original_func()
    Last edited by maxdamage99; 1st September 2020 at 06:09.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  2. The Following User Says Thank You to maxdamage99 For This Useful Post:

    kung foo man (2nd September 2020)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •