Jump to content

Kibli

Member
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

About Kibli

Informations

  • Gender
    Male
  • Country
    Germany
  • Nationality
    German

Social Networks

  • Discord
    Kibli#44721

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Kibli's Achievements

Contributor

Contributor (5/16)

  • One Year In
  • One Month Later
  • Dedicated
  • Week One Done
  • Reacting Well

Recent Badges

1

Reputation

  1. Problem fixed. A coding problem from an external system resulted in a memory layout issue. Just remember: #pragma pack(0) - 0 is not a legal identifier Either pop it or call #pragma pack() without 0 Regards
  2. Hello guys, I updated the M2 Source on the serverside to C++17 for now and am using VS 2022 for compilation. Unfortunately, I have a very strange error which I was not able to solve until now and am asking for your opinions on the problem to get an idea about what's wrong. The code (I added the log for debugging purposes as I was not sure if the VS debugging tools are working correctly): void CHARACTER::SetPlayerProto(const TPlayerTable* t) { /* .... */ m_dwPlayerID = t->id; auto pmpid = &m_dwPlayerID; auto pid = GetPlayerID(); auto ppid = GetPlayerIDP(); LOG_INF("DEV !!! m_dwPlayerID = {}, t->id = {}, GetPlayerID() = {}", m_dwPlayerID, t->id, GetPlayerID()); LOG_INF("DEV !!! &m_dwPlayerID = {} ({} {}), GetPlayerIDP() = {} ({} {}), pid = {}", static_cast<const void*>(pmpid), *pmpid, m_dwPlayerID, static_cast<const void*>(ppid), *ppid, this->GetPlayerID(), pid); /* .... */ } The getters in char.h: public: uint32_t GetPlayerID() const { LOG_INF("DEV !!! RETURN {}", m_dwPlayerID); return m_dwPlayerID; } const uint32_t* GetPlayerIDP() const { return &m_dwPlayerID; } The log output: [2022-06-24 13:29:52.956] [info] [Log.cpp:12] DEV !!! m_dwPlayerID = 3, t->id = 3, GetPlayerID() = 0 [2022-06-24 13:29:52.956] [info] [Log.cpp:12] DEV !!! RETURN 0 [2022-06-24 13:29:52.956] [info] [Log.cpp:12] DEV !!! &m_dwPlayerID = 0x1401d9f8 (3 3), GetPlayerIDP() = 0x1401d9f8 (3 0), pid = 0 As you can see, the "GetPlayerID()" function returns 0 for unknown reasons. FYI: If I move the GetPlayerID function definition into the char.cpp, the return value is correct. Do you have any idea what could cause this problem? My guess is something in the compilation settings is not set correctly but they are very basic and look fine to me.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.