From 4caef329bc765b5090b175165ae9983991e1bcf0 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 27 Feb 2022 02:16:38 +0100 Subject: [PATCH] Remove incorrect pointers --- src/client/component/command.cpp | 65 ++-------------------- src/client/game/symbols.hpp | 92 ++++++++------------------------ 2 files changed, 26 insertions(+), 131 deletions(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index 0dab242c..01f7b241 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -273,15 +273,6 @@ namespace command } } - void enum_assets(const game::XAssetType type, const std::function& callback, const bool includeOverride) - { - game::DB_EnumXAssets_Internal(type, static_cast([](game::XAssetHeader header, void* data) - { - const auto& cb = *static_cast*>(data); - cb(header); - }), &callback, includeOverride); - } - class component final : public component_interface { public: @@ -496,63 +487,17 @@ namespace command }); add("ufo", []() - { - if (!game::SV_Loaded()) - { - return; - } - - game::sp::g_entities[0].client->flags ^= 2; - game::CG_GameMessage(0, utils::string::va("ufo %s", - game::sp::g_entities[0].client->flags & 2 - ? "^2on" - : "^1off")); - }); - - add("give", [](const params& params) { if (!game::SV_Loaded()) { return; } - if (params.size() < 2) - { - game::CG_GameMessage(0, "You did not specify a weapon name"); - return; - } - - auto ps = game::SV_GetPlayerstateForClientNum(0); - const auto wp = game::G_GetWeaponForName(params.get(1)); - if (wp) - { - if (game::G_GivePlayerWeapon(ps, wp, 0, 0, 0, 0, 0, 0)) - { - game::G_InitializeAmmo(ps, wp, 0); - game::G_SelectWeapon(0, wp); - } - } - }); - - add("take", [](const params& params) - { - if (!game::SV_Loaded()) - { - return; - } - - if (params.size() < 2) - { - game::CG_GameMessage(0, "You did not specify a weapon name"); - return; - } - - auto ps = game::SV_GetPlayerstateForClientNum(0); - const auto wp = game::G_GetWeaponForName(params.get(1)); - if (wp) - { - game::G_TakePlayerWeapon(ps, wp); - } + game::sp::g_entities[0].client->flags ^= 2; + game::CG_GameMessage(0, utils::string::va("ufo %s", + game::sp::g_entities[0].client->flags & 2 + ? "^2on" + : "^1off")); }); } diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index c47353aa..c1aa1384 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -8,18 +8,9 @@ namespace game * Functions **************************************************************/ - WEAK symbol AddRefToValue{0, 0x1405C0EB0}; - WEAK symbol AddRefToObject{0, 0x1405C0EA0}; - WEAK symbol AllocThread{0, 0x1405C1200}; - WEAK symbol RemoveRefToValue{0, 0x1405C29B0}; - WEAK symbol RemoveRefToObject{0, 0x1405C28A0}; - - WEAK symbol BG_GetWeaponNameComplete{0, 0x140165580}; - WEAK symbol Cbuf_AddText{0x140342EB0, 0x1404033B0}; WEAK symbol Conbuf_AppendText{0x1403E3300, 0x140513FF0}; - WEAK symbol Cmd_ExecuteSingleCommand{0x140343980, 0x140343980}; + WEAK symbol Cmd_ExecuteSingleCommand{0x140343980, 0x140403F60}; WEAK symbol Cmd_AddCommandInternal{0x1403433E0, 0x140403950}; WEAK symbol Cmd_TokenizeString{0x140344110, 0x1404046F0}; WEAK symbol Cmd_EndTokenizeString{0x140343630, 0x140403C20}; @@ -41,12 +32,16 @@ namespace game WEAK symbol Dvar_ClearModified{0x0, 0x1404FB930}; WEAK symbol Dvar_GetCombinedString{0x140354DF0, 0x14041D830}; WEAK symbol Dvar_ValueToString{0x1403C8560, 0x1404FE660}; - WEAK symbol Dvar_RegisterBool{0x1403C47E0, 0x1404FA540}; - WEAK symbol Dvar_RegisterInt{0x1403C4CC0, 0x1404FAA20}; - WEAK symbol Dvar_RegisterFloat{0x1403C4BB0, 0x1404FA910}; - WEAK symbol Dvar_RegisterString{0x1403C4DA0, 0x1404FAB00}; - WEAK symbol Dvar_RegisterVec4{0x1403C5220, 0x1404FAF40}; - WEAK symbol Dvar_RegisterEnum{0x1403C4AC0, 0x1404C0EC0}; + WEAK symbol Dvar_RegisterBool{0x1403C47E0, 0x1404FA540}; + WEAK symbol Dvar_RegisterInt{0x1403C4CC0, 0x1404FAA20}; + WEAK symbol Dvar_RegisterFloat{0x1403C4BB0, 0x1404FA910}; + WEAK symbol Dvar_RegisterString{0x1403C4DA0, 0x1404FAB00}; + WEAK symbol Dvar_RegisterVec4{0x1403C5220, 0x1404FAF40}; WEAK symbol FS_ReadFile{0x1403B9020, 0x1404EE720}; WEAK symbol FS_FreeFile{0x1403B9010, 0x1404EE710}; @@ -57,17 +52,8 @@ namespace game WEAK symbol G_Glass_Update{0, 0x14033A640}; WEAK symbol G_GetClientScore{0, 0x140342F90}; - WEAK symbol G_GetWeaponForName{0x1402C2A90, 0}; - WEAK symbol G_GivePlayerWeapon{0x1402C2DF0, 0x14051B660}; - WEAK symbol G_InitializeAmmo{0, 0x1404C4110}; - WEAK symbol G_SelectWeapon{0, 0x14051C0D0}; - WEAK symbol G_TakePlayerWeapon{0x1402C3900, 0}; - WEAK symbol I_CleanStr{0x1403CD230, 0}; - - WEAK symbol Image_Setup{0, 0x14074B2A0}; + WEAK symbol I_CleanStr{0x1403CD230, 0x140503D00}; WEAK symbol Key_KeynumToString{0x140187CC0, 0x14024FE10}; @@ -86,11 +72,11 @@ namespace game WEAK symbol R_TextWidth{0x1404D43B0, 0x1405D94A0}; WEAK symbol R_GetFontHeight{0x1405EA360, 0x1405D92C0}; WEAK symbol R_DrawSomething{0x1404D37B0, 0x1405D8890}; - WEAK symbol R_SyncRenderThread{0,0x1405FF3A0}; - WEAK symbol R_AddDObjToScene{0, 0x140775C40}; - WEAK symbol H1_AddBaseDrawTextCmd{0x1404F3DC0, 0x1405FB1F0}; + WEAK symbol R_SyncRenderThread{0, 0x1405FF3A0}; + WEAK symbol H1_AddBaseDrawTextCmd{0x1404F3DC0, 0x1405FB1F0}; #define R_AddCmdDrawText(TXT, MC, F, X, Y, XS, YS, R, C, S) \ H1_AddBaseDrawTextCmd(TXT, MC, F, game::R_GetFontHeight(F), X, Y, XS, YS, R, C, S,-1, 0, game::R_DrawSomething(S)) @@ -102,32 +88,11 @@ namespace game WEAK symbol ScrPlace_GetViewPlacement{0x1401981F0, 0x140288550}; - WEAK symbol - DB_EnumXAssets_Internal{0, 0x1404129F0}; - WEAK symbol DB_GetXAssetName{0, 0x1403E4090}; - WEAK symbol DB_LoadXAssets{0, 0x140414FF0}; - WEAK symbol DB_FindXAssetHeader{0, 0x140412F60}; - WEAK symbol DB_GetRawFileLen{0, 0x140413D80}; - WEAK symbol DB_GetRawBuffer{0, 0x140413C40}; WEAK symbol DB_GetXAssetTypeSize{0x14019A3B0, 0x14028BE70}; - WEAK symbol FindVariable{0, 0x1405C1D50}; - WEAK symbol FindEntityId{0, 0x1405C1C50}; - WEAK symbol GetEntityFieldValue{0, 0x1405C6100}; - WEAK symbol LUI_OpenMenu{0, 0x1404CD210}; - WEAK symbol Menu_IsMenuOpenAndVisible{0, 0x1405EE1A0}; - WEAK symbol Scr_AllocVector{0, 0x1405C3220}; - WEAK symbol Scr_ClearOutParams{0, 0x1405C6E50}; - WEAK symbol Scr_GetEntityIdRef{0, 0x1405C56C0}; - WEAK symbol Scr_SetObjectField{0, 0x140512190}; - WEAK symbol Scr_NotifyId{0, 0x1405C8240}; - - WEAK symbol SL_ConvertToString{0x14036D420, 0x1405BFBB0}; - WEAK symbol SL_FindString{ 0x140314AF0, 0x14043B470 }; // H1(1.4) - - WEAK symbol SL_GetString{0x14036D9A0, 0x1405C0170}; + WEAK symbol SL_FindString{0x140314AF0, 0x14043B470}; WEAK symbol SV_DirectConnect{0, 0x140480860}; WEAK symbol SV_Cmd_TokenizeString{0x1402EF050, 0x140404D20}; @@ -135,12 +100,11 @@ namespace game WEAK symbol SV_BotIsBot{0, 0x14046E6C0}; WEAK symbol SV_GetGuid{0, 0x140484B90}; WEAK symbol SV_GetClientPing{0, 0x140484B70}; - WEAK symbol SV_GetPlayerstateForClientNum{0x1404426D0, 0}; + WEAK symbol SV_GetPlayerstateForClientNum{0x1404426D0, 0x140484C10}; WEAK symbol SV_SetConfigstring{0, 0x140486720}; WEAK symbol SV_Loaded{0x140442F60, 0x1404864A0}; WEAK symbol SV_KickClientNum{0, 0x14047ED00}; WEAK symbol SV_MapExists{0, 0x14047ED60}; - WEAK symbol SV_Cmd_ArgvBuffer{0x1402EEFD0, 0x1403B05C0}; WEAK symbol SV_FastRestart{0, 0x14047E990}; WEAK symbol SV_GameSendServerCommand{ 0x1403F3A70, 0x140484AD0 @@ -157,15 +121,9 @@ namespace game WEAK symbol UI_GetMapDisplayName{0, 0x140408CC0}; WEAK symbol UI_GetGameTypeDisplayName{0, 0x1404086A0}; - WEAK symbol UI_SafeTranslateString{0x140350430, 0x1405A2930}; WEAK symbol UI_RunMenuScript{0, 0x1404CFE60}; WEAK symbol UI_TextWidth{0, 0x1404D21A0}; - WEAK symbol VM_Execute{0, 0x1405C8DB0}; - - WEAK symbol longjmp{0x140648FD4, 0x14089EED0}; - WEAK symbol _setjmp{0x1406BFDD0, 0x1408EC2E0}; - /*************************************************************** * Variables **************************************************************/ @@ -176,7 +134,6 @@ namespace game WEAK symbol cmd_functions{0x14AD99AB8, 0x14946BAC8}; WEAK symbol cmd_args{0x14AD99960, 0x14946B970}; - WEAK symbol g_assetNames{0, 0x140BEF280}; WEAK symbol g_poolSize{0, 0x140FEADF0}; WEAK symbol gfxDrawMethod{0, 0x14FD21180}; @@ -184,14 +141,6 @@ namespace game WEAK symbol dvarCount{0, 0x14D064CF4}; WEAK symbol sortedDvars{0, 0x14D064D00}; - WEAK symbol levelEntityId{0, 0x14B5E0B30}; - WEAK symbol g_script_error_level{0, 0x14BA9CC24}; - WEAK symbol g_script_error{0, 0x14BA9CD40}; - WEAK symbol g_classMap{0, 0x140BF95C0}; - - WEAK symbol scr_VarGlob{0, 0x14B617C00}; - WEAK symbol scr_VmPub{0, 0x14BA9EE40}; - WEAK symbol scr_function_stack{0, 0x14BAA93C0}; WEAK symbol DB_XAssetPool{0x140DE8C80, 0x140FEB5D0}; WEAK symbol keyCatchers{0x14243DAF0, 0x142D0BA9C}; @@ -205,9 +154,10 @@ namespace game { WEAK symbol g_entities{0, 0x14621E530}; WEAK symbol svs_clients{0, 0x14B204A10}; + WEAK symbol svs_numclients{0, 0x14B204A0C}; WEAK symbol gameTime{0, 0x14621BDBC}; - WEAK symbol virtualLobby_loaded{ 0, 0x142D077FD }; + WEAK symbol virtualLobby_loaded{0, 0x142D077FD}; } namespace sp