Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Fixes inside of UE4.h #105

Open
OperativeA115 opened this issue Dec 6, 2022 · 1 comment
Open

Fixes inside of UE4.h #105

OperativeA115 opened this issue Dec 6, 2022 · 1 comment

Comments

@OperativeA115
Copy link

Hey Kemo hope these little finds will help you and your code. Very nice job on it :)

  1. Follow the C++ style guidelines. This will make the code more consistent and easier to read for other developers. For example, you can use camelCase for variable and function names instead of using underscores.

  2. Use const where applicable. For example, you can declare functions that don't modify any state as const. This will prevent accidental modification of state and make the code more readable.

  3. Use std::unique_ptr or std::shared_ptr instead of raw pointers. This will help prevent memory leaks and make the code more readable.

  4. Use more descriptive names for variables and functions. For example, instead of using CreateCheatManager you can use CreateFortCheatManager to make it clear that the function is creating a Fort cheat manager.

  5. Use C++11 features, such as range-based for loops, to make the code more concise and readable. For example, instead of using a traditional for loop to iterate over a vector, you can use a range-based for loop like this:

for (const auto& Building : ExistingBuildings)
{
    // Do something with Building
}
  1. Use modern C++ features, such as type aliases, to make the code more concise and readable. For example, instead of using std::array<UFortWeaponRangedItemDefinition*, 6> you can define a type alias like this:
using PlayerLoadout = std::array<UFortWeaponRangedItemDefinition*, 6>;
  1. Use the C++ standard library instead of using C-style functions like strlen and strtoul. For example, instead of using strlen you can use std::string::size like this:
const auto end = const_cast<char*>(pattern) + std::strlen(pattern);
  1. Use more descriptive variable names. For example, instead of using tab

Again this is just a few of the issues you can fix in the code there are more but they are not important to stability
Thanks OperativeA115 - C++ / C Programmer

@Milxnor
Copy link
Collaborator

Milxnor commented Dec 20, 2022

nice ai

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants