diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/gmod/context.hpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever.
i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'cheat/gmod/context.hpp')
| -rw-r--r-- | cheat/gmod/context.hpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/cheat/gmod/context.hpp b/cheat/gmod/context.hpp new file mode 100644 index 0000000..a478776 --- /dev/null +++ b/cheat/gmod/context.hpp @@ -0,0 +1,71 @@ +#pragma once
+#include <deque>
+
+#include "util.hpp"
+#include "sdk.hpp"
+
+NAMESPACE_REGION( context )
+
+struct shot_data_t {
+ vec3_t m_local_pos;
+ vec3_t m_angle;
+ vec3_t m_enemy_pos;
+ int m_enemy_index;
+ int m_resolver_shots;
+ bool m_resolver_state;
+ bool m_missed{ true };
+ float m_hitbox_radius;
+ int m_hitgroup;
+};
+
+//replacement to the old global:: namespace
+class c_context {
+public:
+ //run localplayer check, pointer, is valid etc
+ bool run_frame( );
+ float pred_time( );
+
+ void on_cmove_end( user_cmd_t* cmd );
+ bool create_snapshot( user_cmd_t* );
+ //calculate accurate tickbase
+ bool calculate_tickbase( );
+
+ user_cmd_t* get_last_cmd( ) {
+ return m_snapshot.empty( ) ? nullptr : &m_snapshot.front( );
+ }
+
+public:
+ c_base_player* m_local{ };
+ int m_stage{ };
+ //accurate tickbase
+ int m_tickbase{ };
+
+ bool m_drawing_postscreenspace{ };
+ bool m_has_incremented_shots{ };
+ bool m_drawing_screneend{ };
+
+ bool m_has_fired_this_frame{ };
+
+ vec3_t m_last_realangle{ };
+ vec3_t m_last_fakeangle{ };
+ vec3_t m_thirdperson_angle{ };
+ vec3_t m_last_origin{ };
+
+ float m_fov{ 90.f };
+
+ CLuaInterface* m_lua{ };
+
+public:
+ void reset_shot_queue( );
+
+ int m_last_shot_ack;
+ int m_last_shot;
+
+ std::array< shot_data_t, 128 > m_shot_data;
+private:
+ std::deque< user_cmd_t > m_snapshot;
+};
+
+END_REGION
+
+extern context::c_context g_ctx;
\ No newline at end of file |
