• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ how to debug?

darkmu

Well-Known Member
Joined
Aug 26, 2007
Messages
274
Solutions
1
Reaction score
50
Location
Paraná,Brazil
How can I insert debug codes into the source to check what value is being passed?

could i see through the tfs console?

Example:
C++:
int LuaScriptInterface::luaPlayerGetPreyUnlocked(lua_State* L)
{

    Player* player = getUserdata<Player>(L, 1);
    uint16_t slot = getNumber<uint8_t>(L, 2);
    if (player) {
        debugPrint(slot); // Example debug
        lua_pushnumber(L, player->getPreyUnlocked(slot));
    }
    else {
        lua_pushnil(L);
    }
    return 1;
}
 
Back
Top