Every symbol in Petari must match the original game binary exactly — including typos. That means code style is not just about readability; the wrong name, the wrong type, or a strayDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/SMGCommunity/Petari/llms.txt
Use this file to discover all available pages before exploring further.
this-> can all prevent a match. Read these conventions carefully before submitting code.
Naming conventions
Known symbols
Known symbols
If a symbol is present in the game’s symbol map, your identifier must match it exactly, even if the original contains a typo. Do not correct spelling in symbol names.
Member variables
Member variables
All member variables must be prefixed with
m.Function arguments
Function arguments
Function arguments must be prefixed based on how they are passed:
p— pointer argumentr— reference argument
Static and global variables
Static and global variables
- Static variables with no known symbol: prefix with
s - Global-scope variables: prefix with
g
Unknown symbols (inlined functions)
Unknown symbols (inlined functions)
Functions with no corresponding symbol — such as inlined functions — must use camelCase.
Null pointers
Usenullptr in C++ code when assigning or comparing a pointer. Use NULL in C code. Never use 0 for pointer comparisons.
Headers
pragma once
pragma once
Every header file must begin with
#pragma once as the very first line.Forward declarations
Forward declarations
Prefer forward declarations over full includes when you only need a pointer or reference to a type. This reduces compilation time and avoids circular dependencies.
Include paths
Include paths
Include paths must be relative to the
include/ directory.Class structure
Function order
Function order
Functions within a class must appear in this order:
- Constructor
- Destructor
- Operators
- Virtual functions
- Member functions
If virtual functions must appear in a different order to match the vtable layout, vtable order takes priority over this rule.
Avoid this->
Avoid this->
Do not use
this-> to reference class members unless the compiler requires it for disambiguation. Omit it in all other cases.Documentation syntax
All class members and functions must be documented using the following Doxygen-style comment format. If you encounter a header that is missing this documentation, please add it. Member variables — include the struct offset as a block comment, then an inline doc comment:@brief, @param, @return, and optionally @note:
LiveActor.hpp:
clang-format
Enableclang-format to run on save in your editor. It handles most whitespace and brace formatting automatically, so you can focus on correctness rather than style.