This commit is contained in:
quaK 2024-07-13 04:08:56 +03:00
parent 5c66f8b5de
commit 777f3aaa8d
6 changed files with 24 additions and 13 deletions

View File

@ -123,7 +123,7 @@ namespace network
return a->port == b->port;
case game::netadrtype_t::NA_IP:
return !memcmp(a->ip, b->ip, 4);
return memcmp(a->ip, b->ip, 4) == 0;
case game::netadrtype_t::NA_BROADCAST:
return true;
default:
@ -136,7 +136,7 @@ namespace network
int net_compare_address(const game::netadr_s* a, const game::netadr_s* b)
{
return net_compare_base_address(a, b) && a->port == b->port;
return net_compare_base_address(a, b) != 0 && (a->port == b->port);
}
void string_to_sockaddr(const char* str, sockaddr_in* address)

View File

@ -262,7 +262,10 @@ namespace party
auto* current_mapname = game::Dvar_FindVar("mapname");
command::execute((dev ? "seta sv_cheats 1" : "seta sv_cheats 0"), true);
if (dev)
{
command::execute("seta sv_cheats 1", true);
}
if (current_mapname && utils::string::to_lower(current_mapname->current.string) ==
utils::string::to_lower(mapname) && (game::SV_Loaded() && !game::Com_FrontEndScene_IsActive()))

View File

@ -233,6 +233,7 @@ namespace updater
if (!list.has_value())
{
console::error("[Updater] Failed to download file list\n");
return {};
}
rapidjson::Document j;
@ -313,7 +314,7 @@ namespace updater
}
}
if (!found)
if (!found && !std::filesystem::is_directory(file))
{
console::info("[Updater] Deleting extra file %s\n", file.data());
utils::io::remove_file(file);
@ -324,6 +325,12 @@ namespace updater
void run_update()
{
const auto file_list = get_file_list();
if (file_list.empty())
{
console::info("[Updater] Update aborted\n");
return;
}
std::vector<std::thread> download_threads;
delete_garbage_files(file_list);
@ -425,4 +432,6 @@ namespace updater
};
}
#ifndef GIT_DIRTY
REGISTER_COMPONENT(updater::component)
#endif

View File

@ -119,8 +119,8 @@ namespace weapon
}
utils::hook::detour BG_MapWeaponAnimStateToAnimIndex_hook;
game::weapAnimFiles_t BG_MapWeaponAnimStateToAnimIndex_stub(__int64 a1, game::playerState_s* ps, int animState, __int64* weapon, unsigned __int8 isAlternate,
int handIndex, unsigned __int8 pmoveHandler)
game::weapAnimFiles_t BG_MapWeaponAnimStateToAnimIndex_stub(__int64 a1, game::playerState_s* ps, int animState, unsigned __int64* weapon, unsigned __int8 isAlternate,
int handIndex, unsigned __int64 pmoveHandler)
{
if (HasAnimState(game::WEAP_INSPECT, animState) && ps->weapState[handIndex].weaponState == WEAP_STATE_INSPECT)
{
@ -200,7 +200,7 @@ namespace weapon
}
utils::hook::detour PM_Weapon_IsInInterruptibleState_hook;
bool PM_Weapon_IsInInterruptibleState_stub(__int64 weaponMap, game::playerState_s* ps, unsigned int hand, unsigned __int8 pmoveHandler)
bool PM_Weapon_IsInInterruptibleState_stub(__int64 weaponMap, game::playerState_s* ps, unsigned int hand, unsigned __int64 pmoveHandler)
{
auto result = PM_Weapon_IsInInterruptibleState_hook.invoke<bool>(weaponMap, ps, hand, pmoveHandler);

View File

@ -742,14 +742,12 @@ namespace game
struct playerState_s
{
int commandTime;
int serverTime;
int inputTime;
int pm_type;
int pm_time;
GameModeFlagContainer<PMoveFlagsCommon, PMoveFlagsSP, PMoveFlagsMP, 64> pm_flags;
GameModeFlagContainer<POtherFlagsCommon, POtherFlagsSP, POtherFlagsMP, 64> otherFlags;
GameModeFlagContainer<PLinkFlagsCommon, PLinkFlagsSP, PLinkFlagsMP, 32> linkFlags;
char __pad0[304];
char __pad0[312];
GameModeFlagContainer<EntityStateFlagsCommon, EntityStateFlagsSP, EntityStateFlagsMP, 32> eFlags;
char __pad1[1272];
PlayerActiveWeaponState weapState[2];
@ -758,7 +756,7 @@ namespace game
float fWeaponPosFrac;
char __pad3[0x4000];
}; // unk size
assert_offsetof(playerState_s, pm_type, 12);
assert_offsetof(playerState_s, pm_type, 4);
assert_offsetof(playerState_s, eFlags, 344);
assert_offsetof(playerState_s, weapState, 1620);
assert_offsetof(playerState_s, weapFlags, 2188);
@ -912,8 +910,9 @@ namespace game
struct cg_s
{
void* dummy;
playerState_s predictedPlayerState;
char __pad0[19160 - sizeof(playerState_s)];
char __pad0[19160 - sizeof(playerState_s) - 8];
CubemapShot cubemapShot;
int cubemapSize;
char __pad1[305200];

View File

@ -167,7 +167,7 @@ int main()
return static_cast<int>(entry_point());
}
int __stdcall WinMain(HINSTANCE, HINSTANCE, PSTR, int)
int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ PSTR, _In_ int)
{
return main();
}