diff --git a/src/client/component/logger.cpp b/src/client/component/logger.cpp index 924d11d0..4db069f5 100644 --- a/src/client/component/logger.cpp +++ b/src/client/component/logger.cpp @@ -114,11 +114,14 @@ namespace logger // lua stuff utils::hook::jump(SELECT_VALUE(0x106010_b, 0x27CBB0_b), print_dev); // debug utils::hook::jump(SELECT_VALUE(0x107680_b, 0x27E210_b), print_error); // error - utils::hook::jump(SELECT_VALUE(0x0E6E30_b, 0x1F6140_b), printf); // print + utils::hook::jump(SELECT_VALUE(0x0E6E30_b, 0x1F6140_b), print); // print if (game::environment::is_mp()) { utils::hook::call(0x6BBB81_b, r_warn_once_per_frame_vsnprintf_stub); + + utils::hook::jump(0x498BD0_b, print_warning); // dmWarn + utils::hook::jump(0x498AD0_b, print); // dmLog } } diff --git a/src/client/component/mapents.cpp b/src/client/component/mapents.cpp index bb834fb9..7f867121 100644 --- a/src/client/component/mapents.cpp +++ b/src/client/component/mapents.cpp @@ -92,7 +92,7 @@ namespace mapents std::regex expr(R"~((.+) "(.*)")~"); std::smatch match{}; - if (!std::regex_search(line, match, expr)) + if (!std::regex_search(line, match, expr) && !line.empty()) { console::warn("[map_ents parser] Failed to parse line %i (%s)\n", i, line.data()); continue; diff --git a/src/client/component/movement.cpp b/src/client/component/movement.cpp index e1b52750..85177539 100644 --- a/src/client/component/movement.cpp +++ b/src/client/component/movement.cpp @@ -112,7 +112,7 @@ namespace movement const auto ps = pm->ps; - ps->sprintButtonUpRequired = 1; + ps->sprintState.sprintButtonUpRequired = 1; float fmove{}, smove{}, wishspeed{}; game::vec3_t wishvel{}, wishdir{}; diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index c58c3311..d00315b0 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1976,6 +1976,15 @@ namespace game static_assert(sizeof(gentity_s) == 736); + struct SprintState + { + int sprintButtonUpRequired; + int sprintDelay; + int lastSprintStart; + int lastSprintEnd; + int sprintStartMaxLength; + }; + struct playerState_s { char clientNum; @@ -1992,7 +2001,11 @@ namespace game vec3_t origin; vec3_t velocity; char __pad4[312]; - int sprintButtonUpRequired; + SprintState sprintState; + char __pad5[88]; + int weaponState0; + char __pad6[7040]; + int perks[2]; }; static_assert(offsetof(playerState_s, pm_type) == 2); @@ -2004,7 +2017,9 @@ namespace game static_assert(offsetof(playerState_s, linkFlags) == 92); static_assert(offsetof(playerState_s, origin) == 120); static_assert(offsetof(playerState_s, velocity) == 132); - static_assert(offsetof(playerState_s, sprintButtonUpRequired) == 456); + static_assert(offsetof(playerState_s, sprintState) == 456); + static_assert(offsetof(playerState_s, weaponState0) == 564); + static_assert(offsetof(playerState_s, perks) == 7608); struct snapshot_s {