From 1e4f3f15b5a03c4732a808f067173b543670e1ce Mon Sep 17 00:00:00 2001 From: rafradek Date: Sat, 8 Jun 2024 10:22:59 +0200 Subject: [PATCH] simplify DETOUR_MEMBER_CALL / DETOUR_STATIC_CALL / VHOOK_CALL --- .vscode/c_cpp_properties.json | 2 +- AMBuildScript | 2 +- src/mem/detour.h | 28 +- src/mem/virtual_hook.h | 6 +- src/mod/ai/engiebot_dispensers.cpp | 18 +- src/mod/ai/engiebot_nopush.cpp | 10 +- src/mod/ai/engiebot_wrangler.cpp | 8 +- src/mod/ai/focus_one_player.cpp | 2 +- src/mod/ai/improved_targeting.cpp | 14 +- src/mod/ai/improved_useitem.cpp | 6 +- src/mod/ai/medigun_shield_pathfinding.cpp | 4 +- src/mod/ai/mvm_defender_bots.cpp | 12 +- .../ai/mvm_defender_bots/OLD/collectmoney.cpp | 8 +- .../quirks/getlastknownarea.cpp | 2 +- src/mod/ai/mvm_defender_bots/quirks/isbot.cpp | 2 +- .../mvm_defender_bots/quirks/isbotoftype.cpp | 2 +- .../mvm_defender_bots/quirks/isfakeclient.cpp | 2 +- .../quirks/mannvsmachinemode.cpp | 48 +- .../ai/mvm_defender_bots/quirks/steamid.cpp | 2 +- src/mod/ai/npc_nextbot/npc_nextbot.cpp | 34 +- src/mod/ai/npc_nextbot/npc_nextbot_body.cpp | 4 +- .../ai/npc_nextbot/npc_nextbot_locomotion.cpp | 6 +- src/mod/ai/npc_nextbot/npc_nextbot_unlag.cpp | 6 +- src/mod/ai/npc_nextbot/npc_nextbot_vision.cpp | 6 +- src/mod/ai/prevent_postmortem_updates.cpp | 2 +- src/mod/ai/rocketjump.cpp | 6 +- src/mod/ai/wrapassassin_altfire.cpp | 4 +- .../estimateabsvelocity_moveparent_fix.cpp | 2 +- .../anim/player_updatemodel_animstate_fix.cpp | 2 +- src/mod/attr/blockbackstab_oldstyle.cpp | 8 +- src/mod/attr/custom_attributes.cpp | 677 +++++++++--------- .../attr/customprojectilemodel_precache.cpp | 14 +- src/mod/attr/healonkill_overheal_melee.cpp | 4 +- src/mod/attr/undocumented.cpp | 2 +- src/mod/bot/bot_player_slot_reorder.cpp | 6 +- src/mod/bot/interrupt_action.cpp | 2 +- src/mod/bot/isspacetospawnhere_scale.cpp | 20 +- src/mod/bot/kart_locomotion.cpp | 6 +- src/mod/bot/kill_before_forcespec.cpp | 6 +- src/mod/bot/medieval_nonmelee.cpp | 2 +- src/mod/bot/runfast.cpp | 4 +- .../bot/spy_selectrandomreachableenemy.cpp | 8 +- src/mod/canteen/share_recall_canteen.cpp | 6 +- src/mod/common/commands.cpp | 8 +- src/mod/common/common.cpp | 6 +- src/mod/common/extraentitydata.cpp | 4 +- src/mod/common/weapon_shoot.cpp | 48 +- src/mod/cond/enhanced_cmds.cpp | 2 +- src/mod/cond/reprogrammed.cpp | 96 +-- src/mod/credits/better_radius_collection.cpp | 2 +- src/mod/credits/spawn_autocollect.cpp | 2 +- src/mod/debug/airblastvuln.cpp | 4 +- src/mod/debug/better_ent_text.cpp | 2 +- src/mod/debug/bottle_break.cpp | 2 +- src/mod/debug/building_status.cpp | 4 +- src/mod/debug/changelevel.cpp | 8 +- src/mod/debug/client_desync.cpp | 4 +- src/mod/debug/client_player_track.cpp | 2 +- src/mod/debug/conds.cpp | 4 +- src/mod/debug/console_scramble_v2.cpp | 4 +- src/mod/debug/ctfbotproxy.cpp | 16 +- src/mod/debug/damage_overlay.cpp | 4 +- src/mod/debug/deflect_angle.cpp | 8 +- src/mod/debug/deflect_angle_v2.cpp | 6 +- src/mod/debug/draw_cphyscollide.cpp | 6 +- src/mod/debug/energyring_knockback.cpp | 2 +- src/mod/debug/feigndeath_ragdoll.cpp | 4 +- src/mod/debug/flamethrower_impulse_101.cpp | 2 +- src/mod/debug/flamethrower_mojo.cpp | 34 +- src/mod/debug/func_nav_cost_tags.cpp | 2 +- src/mod/debug/grenade_vphysics.cpp | 10 +- src/mod/debug/heal_debuff.cpp | 2 +- .../debug/ispotentiallytraversable_trace.cpp | 4 +- src/mod/debug/known_entities.cpp | 34 +- src/mod/debug/medigunshield_obstruction.cpp | 6 +- src/mod/debug/melee_trace.cpp | 2 +- src/mod/debug/multidetour.cpp | 12 +- src/mod/debug/mvm_shield_fps.cpp | 2 +- src/mod/debug/noknockback.cpp | 2 +- .../onkilled_before_mainaction_start.cpp | 10 +- src/mod/debug/override_step_sound_v1.cpp | 4 +- src/mod/debug/override_step_sound_v2.cpp | 4 +- src/mod/debug/parachute_warp.cpp | 24 +- src/mod/debug/penetration.cpp | 8 +- src/mod/debug/popmgr_exploit.cpp | 8 +- src/mod/debug/proj_energy_ball.cpp | 8 +- src/mod/debug/rage.cpp | 2 +- src/mod/debug/revive_exploit.cpp | 2 +- src/mod/debug/revive_fast.cpp | 6 +- src/mod/debug/sentrybuster_mannhattan.cpp | 4 +- src/mod/debug/shortcircuit_rubberband.cpp | 6 +- src/mod/debug/sound_leak.cpp | 16 +- src/mod/debug/sticky_detonation_delay.cpp | 16 +- src/mod/debug/sticky_detonation_order.cpp | 6 +- src/mod/debug/suicide_bomber.cpp | 16 +- src/mod/debug/tank_destroy_animation.cpp | 6 +- src/mod/debug/tele_autodetonate.cpp | 4 +- src/mod/debug/tele_sapper.cpp | 6 +- src/mod/debug/upgrade_tiers.cpp | 2 +- src/mod/debug/useitem_broken.cpp | 12 +- src/mod/debug/usermsg_overflow.cpp | 12 +- src/mod/debug/usermsg_overflow_v2.cpp | 6 +- src/mod/debug/vaccinator.cpp | 2 +- src/mod/debug/vprof_record.cpp | 8 +- src/mod/demo/stringtable_limit.cpp | 18 +- src/mod/etc/allow_civilian_class.cpp | 6 +- src/mod/etc/crash_fixes.cpp | 6 +- src/mod/etc/debug_mission_change_crash.cpp | 4 +- src/mod/etc/deflect_rocket_spew.cpp | 2 +- src/mod/etc/entity_limit_manager.cpp | 30 +- src/mod/etc/extra_player_slots.cpp | 155 ++-- src/mod/etc/heat_seeking_rockets.cpp | 12 +- src/mod/etc/hltv_client_interact.cpp | 10 +- src/mod/etc/holiday_items_allow.cpp | 6 +- src/mod/etc/huntsman_damage_fix.cpp | 8 +- src/mod/etc/instant_scaling.cpp | 2 +- src/mod/etc/laserdot_fix.cpp | 2 +- src/mod/etc/limp_projectiles.cpp | 2 +- src/mod/etc/loose_cannon_damage_fix.cpp | 6 +- src/mod/etc/mapentity_additions.cpp | 152 ++-- src/mod/etc/medicgun_beam_machinery.cpp | 2 +- src/mod/etc/melee_ignore_teammates.cpp | 24 +- src/mod/etc/misc.cpp | 40 +- src/mod/etc/override_move_speed.cpp | 4 +- src/mod/etc/player_bullet_boundingbox_fix.cpp | 2 +- src/mod/etc/ratelimit_exclude.cpp | 2 +- src/mod/etc/sendprop_override.cpp | 12 +- src/mod/etc/sendprop_override_extension.cpp | 2 +- src/mod/etc/server_allow_wait_command.cpp | 2 +- src/mod/etc/spectator_vote_fix.cpp | 2 +- src/mod/etc/suppress_nb_event_messages.cpp | 2 +- src/mod/etc/trigger_filter_fix.cpp | 8 +- .../unintended_class_weapon_improvements.cpp | 66 +- src/mod/etc/vehicle_fix.cpp | 48 +- src/mod/etc/weapon_mimic_teamnum.cpp | 22 +- src/mod/item/item_common.cpp | 4 +- src/mod/mvm/allow_vote_mid_wave.cpp | 2 +- src/mod/mvm/changebotattributes_crash_fix.cpp | 6 +- src/mod/mvm/changeclass_anytime.cpp | 4 +- src/mod/mvm/chat_unrestrict.cpp | 2 +- .../mvm/disposable_sentry_health_upgrades.cpp | 6 +- src/mod/mvm/drop_weapons.cpp | 10 +- src/mod/mvm/extended_upgrades.cpp | 30 +- src/mod/mvm/friendlyfire.cpp | 4 +- src/mod/mvm/gamemode_converter.cpp | 8 +- src/mod/mvm/gib_improvements.cpp | 8 +- src/mod/mvm/go_back_in_time.cpp | 8 +- src/mod/mvm/human_death_yells.cpp | 4 +- src/mod/mvm/jointeam_blue_allow.cpp | 68 +- src/mod/mvm/medigunshield_damage.cpp | 2 +- src/mod/mvm/no_halloween_souls.cpp | 2 +- src/mod/mvm/player_attribute_override.cpp | 2 +- src/mod/mvm/player_limit.cpp | 6 +- src/mod/mvm/red_robot_eye_glow.cpp | 8 +- src/mod/mvm/refund_exploit_fix.cpp | 4 +- src/mod/mvm/refund_usermsg_overflow_fix.cpp | 6 +- src/mod/mvm/robosapper_override.cpp | 6 +- src/mod/mvm/robot_limit.cpp | 18 +- src/mod/mvm/robot_multiplier.cpp | 8 +- src/mod/mvm/sapper_allow_multiple_active.cpp | 4 +- src/mod/mvm/teleporter_aggro.cpp | 4 +- src/mod/mvm/upgrade_disallow.cpp | 4 +- src/mod/mvm/upgradestation_regen_improved.cpp | 4 +- src/mod/mvm/wave_spawn_at_once.cpp | 20 +- src/mod/mvm/weapon_antigrief.cpp | 24 +- src/mod/mvm/weapon_balancing.cpp | 24 +- src/mod/mvm/yer_unnerf.cpp | 2 +- src/mod/perf/attributes_optimize.cpp | 12 +- src/mod/perf/clientside_wearable_optimize.cpp | 2 +- src/mod/perf/css_bot_vision_optimize.cpp | 12 +- src/mod/perf/filesystem_optimize.cpp | 2 +- src/mod/perf/flame_breakable_collision.cpp | 4 +- src/mod/perf/func_optimize.cpp | 56 +- src/mod/perf/hltv_optimize.cpp | 28 +- src/mod/perf/input_optimize.cpp | 8 +- src/mod/perf/medigun_shield_damage_events.cpp | 2 +- .../perf/medigun_shield_damage_interval.cpp | 4 +- src/mod/perf/mvm_load_popfile.cpp | 12 +- src/mod/perf/sendprop_optimize.cpp | 56 +- src/mod/perf/smokestack_fs_thrash.cpp | 2 +- src/mod/perf/squad_escort_optimize.cpp | 6 +- src/mod/perf/virtual_call_optimize.cpp | 26 +- src/mod/pop/ecattr_extensions.cpp | 140 ++-- src/mod/pop/eventpopfile_improvements.cpp | 8 +- src/mod/pop/extattr/alwaysfireweaponalt.cpp | 2 +- src/mod/pop/extattr/ignoretargets.cpp | 2 +- src/mod/pop/extattr/parse.cpp | 4 +- src/mod/pop/extattr/targetstickies.cpp | 12 +- src/mod/pop/kv_conditional.cpp | 2 +- src/mod/pop/mission_extensions.cpp | 10 +- src/mod/pop/nested_complex_spawners.cpp | 16 +- src/mod/pop/pointtemplate.cpp | 30 +- src/mod/pop/popmgr_extensions.cpp | 304 ++++---- src/mod/pop/tank_extensions.cpp | 78 +- src/mod/pop/tfbot_extensions.cpp | 158 ++-- src/mod/pop/wave_extensions.cpp | 38 +- src/mod/pop/wavespawn_extensions.cpp | 62 +- src/mod/prof/attr_munge.cpp | 24 +- src/mod/prof/debug_overlay.cpp | 34 +- src/mod/prof/flame_breakable_collision.cpp | 4 +- src/mod/prof/frame_prof.cpp | 12 +- src/mod/prof/mvm_shield_events.cpp | 10 +- src/mod/prof/popfile_load.cpp | 8 +- src/mod/prof/tier2_renderutils.cpp | 30 +- src/mod/robot/building_stomp.cpp | 6 +- src/mod/robot/no_canteens.cpp | 2 +- src/mod/robot/spawn_protection_fix.cpp | 4 +- src/mod/robot/spawn_setname.cpp | 4 +- src/mod/robot/standable_heads.cpp | 4 +- src/mod/robot/underground_check_override.cpp | 2 +- .../responses_suppress_giant_sentrybuster.cpp | 4 +- .../responses_suppress_medicbot_shield.cpp | 2 +- src/mod/sound/responses_unused_credits.cpp | 4 +- src/mod/sound/responses_unused_sapper.cpp | 4 +- src/mod/sound/tele_activate.cpp | 2 +- src/mod/tank/gunslinger_combo.cpp | 4 +- src/mod/util/client_cmds.cpp | 6 +- src/mod/util/confilter.cpp | 4 +- src/mod/util/debugoverlay_font.cpp | 4 +- src/mod/util/debugoverlay_font_v2.cpp | 12 +- src/mod/util/debugoverlay_font_v3.cpp | 16 +- src/mod/util/download_manager.cpp | 4 +- src/mod/util/dtwarning_use_cvar.cpp | 2 +- src/mod/util/entity_overlays.cpp | 4 +- src/mod/util/jumboframes.cpp | 8 +- src/mod/util/notify_recv.cpp | 2 +- src/mod/util/notify_send.cpp | 6 +- src/mod/util/overlay_enhancements.cpp | 6 +- src/mod/util/overlay_recv.cpp | 2 +- src/mod/util/overlay_send.cpp | 14 +- src/mod/util/serialize_spew.cpp | 2 +- src/mod/util/vprof_remote.cpp | 4 +- src/mod/vgui/test.cpp | 2 +- src/mod/visualize/airblast_box.cpp | 4 +- src/mod/visualize/airblast_cone.cpp | 4 +- src/mod/visualize/airblast_vectors.cpp | 6 +- src/mod/visualize/blast_radius.cpp | 8 +- src/mod/visualize/damage_force.cpp | 2 +- src/mod/visualize/dispenser_radius.cpp | 2 +- src/mod/visualize/engie_nests.cpp | 8 +- src/mod/visualize/explosive_headshot.cpp | 4 +- src/mod/visualize/flamethrower.cpp | 8 +- src/mod/visualize/jar_radius.cpp | 6 +- src/mod/visualize/melee_range.cpp | 4 +- src/mod/visualize/minigun_deflect.cpp | 8 +- src/mod/visualize/taunt_attacks.cpp | 8 +- src/stub/econ.cpp | 6 + src/stub/econ.h | 4 + src/util/lua.cpp | 64 +- src/util/pooled_string.cpp | 2 +- 250 files changed, 2044 insertions(+), 2008 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 46dc7066..2fd29bee 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -51,7 +51,7 @@ ], "compilerPath": "/usr/bin/gcc", "cStandard": "c17", - "cppStandard": "c++20", + "cppStandard": "gnu++20", "intelliSenseMode": "linux-gcc-x86", "compilerArgs": [ "-m64" diff --git a/AMBuildScript b/AMBuildScript index 38ee4603..fad09385 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -291,7 +291,7 @@ class ExtensionConfig(object): ############################################################################ # C++ COMPILER ############################################################# ############################################################################ - cxx.cxxflags += ['-std=c++2a'] + cxx.cxxflags += ['-std=gnu++2a'] # cxx.cxxflags += ['-fno-exceptions'] cxx.cxxflags += ['-fexceptions'] # !!! # cxx.cxxflags += ['-fno-threadsafe-statics'] diff --git a/src/mem/detour.h b/src/mem/detour.h index f69f84a1..b343aac8 100644 --- a/src/mem/detour.h +++ b/src/mem/detour.h @@ -299,15 +299,17 @@ class CDetouredFunc static inline std::map s_FuncMap; }; - - -#define DETOUR_MEMBER_CALL(name) (this->*Actual) -#define DETOUR_STATIC_CALL(name) (Actual_##name) +#define DETOUR_MEMBER_CALL(...) (Actual)(this, ## __VA_ARGS__) +#define DETOUR_STATIC_CALL(...) (Actual)(__VA_ARGS__) #define __DETOUR_DECL_STATIC(prefix, name, ...) \ - CDetour *detour_##name = nullptr; \ - prefix (*Actual_##name)(__VA_ARGS__) = nullptr; \ - prefix Detour_##name(__VA_ARGS__) +namespace detour_ns_##name {\ + prefix Detour(__VA_ARGS__); \ + prefix (*Actual)(__VA_ARGS__) = nullptr; \ +}\ + CDetour *detour_##name= nullptr; \ + prefix detour_ns_##name::Detour(__VA_ARGS__) + #define DETOUR_DECL_STATIC(ret, name, ...) \ __DETOUR_DECL_STATIC(static ret, name, ##__VA_ARGS__) #define DETOUR_DECL_STATIC_CALL_CONVENTION(cc, ret, name, ...) \ @@ -318,10 +320,10 @@ class CDetouredFunc { \ public: \ ret callback(__VA_ARGS__); \ - static ret (Detour_##name::* Actual)(__VA_ARGS__); \ + static ret (*Actual)(Detour_##name *, ## __VA_ARGS__); \ }; \ static CDetour *detour_##name = nullptr; \ - ret (Detour_##name::* Detour_##name::Actual)(__VA_ARGS__) = nullptr; \ + ret (* Detour_##name::Actual)(Detour_##name *, ## __VA_ARGS__) = nullptr; \ ret Detour_##name::callback(__VA_ARGS__) @@ -330,17 +332,17 @@ class CDetouredFunc { \ public: \ cc ret callback(__VA_ARGS__); \ - cc static ret (Detour_##name::* Actual)(__VA_ARGS__); \ + cc static ret (*Actual)(Detour_##name *, ## __VA_ARGS__); \ }; \ static CDetour *detour_##name = nullptr; \ - cc ret (Detour_##name::* Detour_##name::Actual)(__VA_ARGS__) = nullptr; \ + cc ret (* Detour_##name::Actual)(Detour_##name *, ## __VA_ARGS__) = nullptr; \ cc ret Detour_##name::callback(__VA_ARGS__) #define GET_MEMBER_CALLBACK(name) GetAddrOfMemberFunc(&Detour_##name::callback) #define GET_MEMBER_INNERPTR(name) reinterpret_cast(&Detour_##name::Actual) -#define GET_STATIC_CALLBACK(name) reinterpret_cast(&Detour_##name) -#define GET_STATIC_INNERPTR(name) reinterpret_cast(&Actual_##name) +#define GET_STATIC_CALLBACK(name) reinterpret_cast(&detour_ns_##name::Detour) +#define GET_STATIC_INNERPTR(name) reinterpret_cast(&detour_ns_##name::Actual) // TODO: have an "exclusive" version of CDetour, which is identical, but when it's enabled/disabled, diff --git a/src/mem/virtual_hook.h b/src/mem/virtual_hook.h index 47c78d3e..f4445792 100644 --- a/src/mem/virtual_hook.h +++ b/src/mem/virtual_hook.h @@ -179,7 +179,7 @@ class CVirtualHookFunc std::string m_szName; }; -#define VHOOK_CALL(name) (this->*Actual) +#define VHOOK_CALL(...) (Actual)(this, ## __VA_ARGS__) // For per object virtual hooks #define VHOOK_CALL_OBJSPEC(name, ...) (this->*MakePtrToMemberFunc((*((void ***)this)-5)[vhook_##name->GetOffset()])) @@ -189,10 +189,10 @@ class CVirtualHookFunc { \ public: \ ret callback(__VA_ARGS__); \ - static ret (Vhook_##name::* Actual)(__VA_ARGS__); \ + static ret (*Actual)(Vhook_##name *, ##__VA_ARGS__); \ }; \ static CVirtualHook *vhook_##name = nullptr; \ - ret (Vhook_##name::* Vhook_##name::Actual)(__VA_ARGS__) = nullptr; \ + ret (* Vhook_##name::Actual)(Vhook_##name *, ##__VA_ARGS__) = nullptr; \ ret Vhook_##name::callback(__VA_ARGS__) #define GET_VHOOK_CALLBACK(name) GetAddrOfMemberFunc(&Vhook_##name::callback) diff --git a/src/mod/ai/engiebot_dispensers.cpp b/src/mod/ai/engiebot_dispensers.cpp index 28ad49b1..b88e29ad 100644 --- a/src/mod/ai/engiebot_dispensers.cpp +++ b/src/mod/ai/engiebot_dispensers.cpp @@ -243,7 +243,7 @@ namespace Mod::AI::EngieBot_Dispensers TRACE(); hint_sg = hint; - DETOUR_MEMBER_CALL(CTFBotMvMEngineerBuildSentryGun_ctor)(hint); + DETOUR_MEMBER_CALL(hint); } CTFBotHintTeleporterExit *hint_te = nullptr; @@ -252,7 +252,7 @@ namespace Mod::AI::EngieBot_Dispensers TRACE(); hint_te = hint; - DETOUR_MEMBER_CALL(CTFBotMvMEngineerBuildTeleportExit_ctor)(hint); + DETOUR_MEMBER_CALL(hint); } std::unordered_map *, IHotplugAction *> build_actions; @@ -264,7 +264,7 @@ namespace Mod::AI::EngieBot_Dispensers delete build_actions[action]; build_actions.erase(action); } - DETOUR_MEMBER_CALL(CTFBotMvMEngineerIdle_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBotMvMEngineerIdle_dtor1) @@ -274,7 +274,7 @@ namespace Mod::AI::EngieBot_Dispensers delete build_actions[action]; build_actions.erase(action); } - DETOUR_MEMBER_CALL(CTFBotMvMEngineerIdle_dtor1)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBotMvMEngineerIdle_dtor2) @@ -284,7 +284,7 @@ namespace Mod::AI::EngieBot_Dispensers delete build_actions[action]; build_actions.erase(action); } - DETOUR_MEMBER_CALL(CTFBotMvMEngineerIdle_dtor2)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFBotMvMEngineerIdle_Update; @@ -325,7 +325,7 @@ namespace Mod::AI::EngieBot_Dispensers } } - auto result = DETOUR_MEMBER_CALL(CTFBotMvMEngineerIdle_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (result.transition == ActionTransition::SUSPEND_FOR && result.action != nullptr) { if (strcmp(result.action->GetName(), "MvMEngineerBuildSentryGun") == 0 && hint_sg != nullptr) { @@ -374,7 +374,7 @@ namespace Mod::AI::EngieBot_Dispensers return obj->EyeAngles(); } - return VHOOK_CALL(CObjectDispenser_GetAvailableMetal)(); + return VHOOK_CALL(); } @@ -384,13 +384,13 @@ namespace Mod::AI::EngieBot_Dispensers return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_SpeakConceptIfAllowed)(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); + return DETOUR_MEMBER_CALL(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); } DETOUR_DECL_MEMBER(void, CTFBotHintEngineerNest_HintTeleporterThink) { - DETOUR_MEMBER_CALL(CTFBotHintEngineerNest_HintTeleporterThink)(); + DETOUR_MEMBER_CALL(); auto nest = reinterpret_cast(this); nest->m_bHasActiveTeleporter = true; diff --git a/src/mod/ai/engiebot_nopush.cpp b/src/mod/ai/engiebot_nopush.cpp index f8a5831e..dc0bf1f4 100644 --- a/src/mod/ai/engiebot_nopush.cpp +++ b/src/mod/ai/engiebot_nopush.cpp @@ -12,7 +12,7 @@ namespace Mod::AI::EngieBot_NoPush { SCOPED_INCREMENT(rc_TeleSpawn_Update); pusher_engineer = actor; - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerTeleportSpawn_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } RefCount rc_BuildSentry_Update; @@ -20,7 +20,7 @@ namespace Mod::AI::EngieBot_NoPush { SCOPED_INCREMENT(rc_BuildSentry_Update); pusher_engineer = actor; - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerBuildSentryGun_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } RefCount rc_BuildTele_Update; @@ -28,7 +28,7 @@ namespace Mod::AI::EngieBot_NoPush { SCOPED_INCREMENT(rc_BuildTele_Update); pusher_engineer = actor; - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerBuildTeleportExit_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } ConVar cvar_reducerange("sig_ai_engiebot_pushrange", "0", FCVAR_NOTIFY | FCVAR_GAMEDLL, @@ -41,7 +41,7 @@ namespace Mod::AI::EngieBot_NoPush return; } - DETOUR_MEMBER_CALL(CTFPlayer_ApplyAbsVelocityImpulse)(v1); + DETOUR_MEMBER_CALL(v1); } DETOUR_DECL_MEMBER(void, CTFGameRules_PushAllPlayersAway, const Vector& vFromThisPoint, float flRange, float flForce, int nTeam, CUtlVector< CTFPlayer* > *pPushedPlayers) @@ -55,7 +55,7 @@ namespace Mod::AI::EngieBot_NoPush } - DETOUR_MEMBER_CALL(CTFGameRules_PushAllPlayersAway)(vFromThisPoint, flRange, flForce, nTeam, pPushedPlayers); + DETOUR_MEMBER_CALL(vFromThisPoint, flRange, flForce, nTeam, pPushedPlayers); } class CMod : public IMod diff --git a/src/mod/ai/engiebot_wrangler.cpp b/src/mod/ai/engiebot_wrangler.cpp index 1f5177f3..284c9cf7 100644 --- a/src/mod/ai/engiebot_wrangler.cpp +++ b/src/mod/ai/engiebot_wrangler.cpp @@ -170,7 +170,7 @@ namespace Mod::AI::EngieBot_Wrangler DETOUR_DECL_MEMBER(void, CTFLaserPointer_CreateLaserDot) { laser_dot = nullptr; - DETOUR_MEMBER_CALL(CTFLaserPointer_CreateLaserDot)(); + DETOUR_MEMBER_CALL(); if (laser_dot != nullptr && laser_dot->GetTeamNumber() == TF_TEAM_BLUE && TFGameRules()->IsMannVsMachineMode()) { laser_dot->SetTeamNumber(TF_TEAM_RED); } @@ -178,7 +178,7 @@ namespace Mod::AI::EngieBot_Wrangler DETOUR_DECL_STATIC(CBaseEntity *, CLaserDot_Create, Vector &origin, CBaseEntity *owner, bool visibleDot) { - return laser_dot = DETOUR_STATIC_CALL(CLaserDot_Create)(origin, owner, visibleDot); + return laser_dot = DETOUR_STATIC_CALL(origin, owner, visibleDot); } DETOUR_DECL_MEMBER(EventDesiredResult, Action_CTFBot_OnCommandString, CTFBot *actor, const char *cmd) @@ -194,7 +194,7 @@ namespace Mod::AI::EngieBot_Wrangler } } - return DETOUR_MEMBER_CALL(Action_CTFBot_OnCommandString)(actor, cmd); + return DETOUR_MEMBER_CALL(actor, cmd); } DETOUR_DECL_MEMBER(ActionResult< CTFBot >, CTFBotMvMEngineerIdle_Update, CTFBot *actor, float interval) { @@ -203,7 +203,7 @@ namespace Mod::AI::EngieBot_Wrangler if (CTFBotMvMEngineerDisableAutopilot::IsPossible(actor) && actor->GetVisionInterface()->GetPrimaryKnownThreat(false) != nullptr) { return ActionResult< CTFBot >::SuspendFor(new CTFBotMvMEngineerDisableAutopilot(), "This thing ain't on autopilot, son!"); } - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerIdle_Update)(actor, interval); + return DETOUR_MEMBER_CALL(actor, interval); } class CMod : public IMod diff --git a/src/mod/ai/focus_one_player.cpp b/src/mod/ai/focus_one_player.cpp index 2de552e4..cc3627bc 100644 --- a/src/mod/ai/focus_one_player.cpp +++ b/src/mod/ai/focus_one_player.cpp @@ -22,7 +22,7 @@ namespace Mod::AI::Focus_One_Player CTFPlayer *player = ToTFPlayer(ent); if (player != nullptr && IsTheTarget(player)) { return false; - // return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + // return DETOUR_MEMBER_CALL(ent); } return true; diff --git a/src/mod/ai/improved_targeting.cpp b/src/mod/ai/improved_targeting.cpp index da37f36b..3dc958d9 100644 --- a/src/mod/ai/improved_targeting.cpp +++ b/src/mod/ai/improved_targeting.cpp @@ -83,7 +83,7 @@ namespace Mod::AI::Improved_Targeting else if (threat2nonsentrybuilding && !threat1nonsentrybuilding) { return threat1; } - auto ret = DETOUR_MEMBER_CALL(CTFBotMainAction_SelectMoreDangerousThreat)(nextbot, them, threat1, threat2); + auto ret = DETOUR_MEMBER_CALL(nextbot, them, threat1, threat2); thread_bot_caller = nullptr; @@ -103,7 +103,7 @@ namespace Mod::AI::Improved_Targeting } } - return DETOUR_MEMBER_CALL(CTFBotMainAction_GetHealerOfThreat)(threat); + return DETOUR_MEMBER_CALL(threat); } bool callingfromhere = false; @@ -173,7 +173,7 @@ namespace Mod::AI::Improved_Targeting } Vector move = trace->endpos - actor->GetAbsOrigin(); } - return DETOUR_MEMBER_CALL(CTFBotMainAction_OnContact)(actor, ent, trace); + return DETOUR_MEMBER_CALL(actor, ent, trace); } RefCount rc_CTFBot_Touch; @@ -181,7 +181,7 @@ namespace Mod::AI::Improved_Targeting { auto bot = reinterpret_cast(this); SCOPED_INCREMENT_IF(rc_CTFBot_Touch, cvar_anti_spy_touch.GetBool()); - DETOUR_MEMBER_CALL(CTFBot_Touch)(ent); + DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(void, CTFBot_SuspectSpy, CTFPlayer *spy) @@ -189,7 +189,7 @@ namespace Mod::AI::Improved_Targeting if (rc_CTFBot_Touch && !callingfromhere) return; - DETOUR_MEMBER_CALL(CTFBot_SuspectSpy)(spy); + DETOUR_MEMBER_CALL(spy); } DETOUR_DECL_MEMBER(bool, CTFBot_IsExplosiveProjectileWeapon, CTFWeaponBase *weapon) @@ -202,12 +202,12 @@ namespace Mod::AI::Improved_Targeting } } - return DETOUR_MEMBER_CALL(CTFBot_IsExplosiveProjectileWeapon)(weapon); + return DETOUR_MEMBER_CALL(weapon); } DETOUR_DECL_MEMBER(ActionResult, CTFBotMedicHeal_Update, CTFBot *me, float interval) { - auto result = DETOUR_MEMBER_CALL(CTFBotMedicHeal_Update)(me, interval); + auto result = DETOUR_MEMBER_CALL(me, interval); auto medigun = rtti_cast(me->GetActiveTFWeapon()); auto medigunHasTarget = medigun != nullptr && medigun->GetHealTarget() == reinterpret_cast(this)->GetPatient(); if (medigun && medigunHasTarget && me->ExtAttr()[CTFBot::ExtendedAttr::MEDIC_LOOK_AT_THREATS]) { diff --git a/src/mod/ai/improved_useitem.cpp b/src/mod/ai/improved_useitem.cpp index 99f83855..5b391213 100644 --- a/src/mod/ai/improved_useitem.cpp +++ b/src/mod/ai/improved_useitem.cpp @@ -211,7 +211,7 @@ namespace Mod::AI::Improved_UseItem auto bot = reinterpret_cast(this); - CTFBotUseItem *result = reinterpret_cast(DETOUR_MEMBER_CALL(CTFBot_OpportunisticallyUseWeaponAbilities)()); + CTFBotUseItem *result = reinterpret_cast(DETOUR_MEMBER_CALL()); if (result != nullptr) { CTFWeaponBase *item = result->m_hItem; @@ -318,7 +318,7 @@ namespace Mod::AI::Improved_UseItem if (item_noisemaker != nullptr) { return item_noisemaker; } - return DETOUR_MEMBER_CALL(CPlayerInventory_GetInventoryItemByItemID)(param1, itemid); + return DETOUR_MEMBER_CALL(param1, itemid); } std::vector stack_m_bPlayingMannVsMachine; void Quirk_MvM_Pre() @@ -344,7 +344,7 @@ namespace Mod::AI::Improved_UseItem bool mannvsmachine = TFGameRules()->IsMannVsMachineMode(); TFGameRules()->Set_m_bPlayingMannVsMachine(false); - auto result = DETOUR_MEMBER_CALL(CTFBot_EquipLongRangeWeapon)(); + auto result = DETOUR_MEMBER_CALL(); TFGameRules()->Set_m_bPlayingMannVsMachine(mannvsmachine); //Quirk_MvM_Post(); diff --git a/src/mod/ai/medigun_shield_pathfinding.cpp b/src/mod/ai/medigun_shield_pathfinding.cpp index 015a614e..cd5d797d 100644 --- a/src/mod/ai/medigun_shield_pathfinding.cpp +++ b/src/mod/ai/medigun_shield_pathfinding.cpp @@ -12,7 +12,7 @@ namespace Mod::Perf::Medigun_Shield_Pathfinding_ShouldHitEntity { DETOUR_DECL_MEMBER(bool, NextBotTraversableTraceFilter_ShouldHitEntity, IHandleEntity *pEntity, int contentsMask) { - auto result = DETOUR_MEMBER_CALL(NextBotTraversableTraceFilter_ShouldHitEntity)(pEntity, contentsMask); + auto result = DETOUR_MEMBER_CALL(pEntity, contentsMask); if (result) { CBaseEntity *ent = EntityFromEntityHandle(pEntity); @@ -47,7 +47,7 @@ namespace Mod::Perf::Medigun_Shield_Pathfinding_IsEntityTraversable { DETOUR_DECL_MEMBER(bool, CTFBotLocomotion_IsEntityTraversable, CBaseEntity *ent, ILocomotion::TraverseWhenType ttype) { - auto result = DETOUR_MEMBER_CALL(CTFBotLocomotion_IsEntityTraversable)(ent, ttype); + auto result = DETOUR_MEMBER_CALL(ent, ttype); if (!result && !ent->IsPlayer()) { return ent->IsCombatItem(); } diff --git a/src/mod/ai/mvm_defender_bots.cpp b/src/mod/ai/mvm_defender_bots.cpp index 2fd0c206..8427e810 100644 --- a/src/mod/ai/mvm_defender_bots.cpp +++ b/src/mod/ai/mvm_defender_bots.cpp @@ -33,7 +33,7 @@ namespace Mod::AI::MvM_Defender_Bots return new CTFBotMvMDefender(); } - return DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_InitialContainedAction)(actor); + return DETOUR_MEMBER_CALL(actor); } @@ -47,13 +47,13 @@ namespace Mod::AI::MvM_Defender_Bots return FLT_MAX; } - return DETOUR_MEMBER_CALL(CTFBot_GetTimeLeftToCapture)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_HandleCommand_JoinTeam, const char *team) { - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinTeam)(team); + DETOUR_MEMBER_CALL(team); auto player = reinterpret_cast(this); @@ -125,7 +125,7 @@ namespace Mod::AI::MvM_Defender_Bots return ActionResult::SuspendFor(new CTFBotCollectMoney(), "Collecting money."); } - return DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_OnCommandString)(actor, cmd); + return DETOUR_MEMBER_CALL(actor, cmd); } @@ -168,7 +168,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(void, CTFBot_Spawn) { - DETOUR_MEMBER_CALL(CTFBot_Spawn)(); + DETOUR_MEMBER_CALL(); auto bot = reinterpret_cast(this); if (bot->GetTeamNumber() == TF_TEAM_RED) { @@ -211,7 +211,7 @@ namespace Mod::AI::MvM_Defender_Bots // NDebugOverlay::EntityText(ENTINDEX(tank), 3, CFmtStrN<256>("m_NodeDists[i]: %.0f", (*m_NodeDists)[*m_iCurrentNode]), // gpGlobals->interval_per_tick, 0xff, 0xff, 0xff, 0xff); - DETOUR_MEMBER_CALL(CTFTankBoss_TankBossThink)(); + DETOUR_MEMBER_CALL(); } #endif diff --git a/src/mod/ai/mvm_defender_bots/OLD/collectmoney.cpp b/src/mod/ai/mvm_defender_bots/OLD/collectmoney.cpp index 76d620c1..b6563023 100644 --- a/src/mod/ai/mvm_defender_bots/OLD/collectmoney.cpp +++ b/src/mod/ai/mvm_defender_bots/OLD/collectmoney.cpp @@ -216,7 +216,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(void, IVision_UpdateKnownEntities) { SCOPED_INCREMENT(rc_IVision_UpdateKnownEntities); - DETOUR_MEMBER_CALL(IVision_UpdateKnownEntities)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFBotVision_IsIgnored, CBaseEntity *ent) @@ -227,13 +227,13 @@ namespace Mod::AI::MvM_Defender_Bots } } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(void, CTFBotVision_CollectPotentiallyVisibleEntities, CUtlVector *ents) { - DETOUR_MEMBER_CALL(CTFBotVision_CollectPotentiallyVisibleEntities)(ents); + DETOUR_MEMBER_CALL(ents); IVision *vision = reinterpret_cast(this); @@ -255,7 +255,7 @@ namespace Mod::AI::MvM_Defender_Bots // return ActionResult::SuspendFor(new CTFBotCollectMoney(), "Collecting money."); // } // -// return DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_Update)(actor, dt); +// return DETOUR_MEMBER_CALL(actor, dt); // } diff --git a/src/mod/ai/mvm_defender_bots/quirks/getlastknownarea.cpp b/src/mod/ai/mvm_defender_bots/quirks/getlastknownarea.cpp index a5baeb4e..7ecfed65 100644 --- a/src/mod/ai/mvm_defender_bots/quirks/getlastknownarea.cpp +++ b/src/mod/ai/mvm_defender_bots/quirks/getlastknownarea.cpp @@ -20,7 +20,7 @@ namespace Mod::AI::MvM_Defender_Bots } } - return DETOUR_MEMBER_CALL(CTFBot_GetLastKnownArea)(); + return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/ai/mvm_defender_bots/quirks/isbot.cpp b/src/mod/ai/mvm_defender_bots/quirks/isbot.cpp index 5cf063c2..96ed15a6 100644 --- a/src/mod/ai/mvm_defender_bots/quirks/isbot.cpp +++ b/src/mod/ai/mvm_defender_bots/quirks/isbot.cpp @@ -21,7 +21,7 @@ namespace Mod::AI::MvM_Defender_Bots } return true; - // return DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_IsBot)(); + // return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/ai/mvm_defender_bots/quirks/isbotoftype.cpp b/src/mod/ai/mvm_defender_bots/quirks/isbotoftype.cpp index 74c76c33..3387e1ee 100644 --- a/src/mod/ai/mvm_defender_bots/quirks/isbotoftype.cpp +++ b/src/mod/ai/mvm_defender_bots/quirks/isbotoftype.cpp @@ -21,7 +21,7 @@ namespace Mod::AI::MvM_Defender_Bots } return 1337; - // return DETOUR_MEMBER_CALL(CTFBot_GetBotType)(); + // return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/ai/mvm_defender_bots/quirks/isfakeclient.cpp b/src/mod/ai/mvm_defender_bots/quirks/isfakeclient.cpp index c419f535..e75c6381 100644 --- a/src/mod/ai/mvm_defender_bots/quirks/isfakeclient.cpp +++ b/src/mod/ai/mvm_defender_bots/quirks/isfakeclient.cpp @@ -21,7 +21,7 @@ namespace Mod::AI::MvM_Defender_Bots } return true; - // return DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_IsFakeClient)(); + // return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/ai/mvm_defender_bots/quirks/mannvsmachinemode.cpp b/src/mod/ai/mvm_defender_bots/quirks/mannvsmachinemode.cpp index 452d2fe2..22f43f93 100644 --- a/src/mod/ai/mvm_defender_bots/quirks/mannvsmachinemode.cpp +++ b/src/mod/ai/mvm_defender_bots/quirks/mannvsmachinemode.cpp @@ -30,7 +30,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(CTFPlayer *, CTFBotMedicHeal_SelectPatient, CTFBot *actor, CTFPlayer *player) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotMedicHeal_SelectPatient)(actor, player); + auto result = DETOUR_MEMBER_CALL(actor, player); Quirk_MvM_Post(); return result; } @@ -38,7 +38,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(Action *, CTFBotEngineerBuild_InitialContainedAction, CTFBot *actor) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotEngineerBuild_InitialContainedAction)(actor); + auto result = DETOUR_MEMBER_CALL(actor); Quirk_MvM_Post(); return result; } @@ -46,7 +46,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_STATIC(bool, CTFBotGetAmmo_IsPossible, CTFBot *actor) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_STATIC_CALL(CTFBotGetAmmo_IsPossible)(actor); + auto result = DETOUR_STATIC_CALL(actor); Quirk_MvM_Post(); return result; } @@ -54,7 +54,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_STATIC(bool, CTFBotGetHealth_IsPossible, CTFBot *actor) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_STATIC_CALL(CTFBotGetHealth_IsPossible)(actor); + auto result = DETOUR_STATIC_CALL(actor); Quirk_MvM_Post(); return result; } @@ -62,7 +62,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(const CKnownEntity *, CTFBotSniperLurk_SelectMoreDangerousThreat, const INextBot *nextbot, const CBaseCombatCharacter *them, const CKnownEntity *threat1, const CKnownEntity *threat2) { Quirk_MvM_Pre(nextbot->GetEntity()->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotSniperLurk_SelectMoreDangerousThreat)(nextbot, them, threat1, threat2); + auto result = DETOUR_MEMBER_CALL(nextbot, them, threat1, threat2); Quirk_MvM_Post(); return result; } @@ -72,7 +72,7 @@ namespace Mod::AI::MvM_Defender_Bots auto vision = reinterpret_cast(this); Quirk_MvM_Pre(vision->GetBot()->GetEntity()->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBotVision_Update)(); + DETOUR_MEMBER_CALL(); Quirk_MvM_Post(); } @@ -81,7 +81,7 @@ namespace Mod::AI::MvM_Defender_Bots auto vision = reinterpret_cast(this); Quirk_MvM_Pre(vision->GetBot()->GetEntity()->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + auto result = DETOUR_MEMBER_CALL(ent); Quirk_MvM_Post(); return result; } @@ -91,7 +91,7 @@ namespace Mod::AI::MvM_Defender_Bots auto vision = reinterpret_cast(this); Quirk_MvM_Pre(vision->GetBot()->GetEntity()->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotVision_IsVisibleEntityNoticed)(ent); + auto result = DETOUR_MEMBER_CALL(ent); Quirk_MvM_Post(); return result; } @@ -101,7 +101,7 @@ namespace Mod::AI::MvM_Defender_Bots auto loco = reinterpret_cast(this); Quirk_MvM_Pre(loco->GetBot()->GetEntity()->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBotLocomotion_Approach)(v1, f1); + DETOUR_MEMBER_CALL(v1, f1); Quirk_MvM_Post(); } @@ -110,7 +110,7 @@ namespace Mod::AI::MvM_Defender_Bots auto body = reinterpret_cast(this); Quirk_MvM_Pre(body->GetBot()->GetEntity()->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotBody_GetHeadAimTrackingInterval)(); + auto result = DETOUR_MEMBER_CALL(); Quirk_MvM_Post(); return result; } @@ -120,7 +120,7 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBot_Touch)(ent); + DETOUR_MEMBER_CALL(ent); Quirk_MvM_Post(); } @@ -129,7 +129,7 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBot_ShouldFireCompressionBlast)(); + auto result = DETOUR_MEMBER_CALL(); Quirk_MvM_Post(); return result; } @@ -139,7 +139,7 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBot_EquipLongRangeWeapon)(); + auto result = DETOUR_MEMBER_CALL(); Quirk_MvM_Post(); return result; } @@ -149,7 +149,7 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBot_GetDesiredAttackRange)(); + auto result = DETOUR_MEMBER_CALL(); Quirk_MvM_Post(); return result; } @@ -159,7 +159,7 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBot_AvoidPlayers)(usercmd); + DETOUR_MEMBER_CALL(usercmd); Quirk_MvM_Post(); } @@ -168,14 +168,14 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBot_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); Quirk_MvM_Post(); } DETOUR_DECL_MEMBER(ActionResult, CTFBotMainAction_OnStuck, CTFBot *actor) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotMainAction_OnStuck)(actor); + auto result = DETOUR_MEMBER_CALL(actor); Quirk_MvM_Post(); return result; } @@ -183,7 +183,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(ActionResult, CTFBotMedicHeal_Update, CTFBot *actor, float dt) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotMedicHeal_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); Quirk_MvM_Post(); return result; } @@ -191,7 +191,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(ActionResult, CTFBotTacticalMonitor_Update, CTFBot *actor, float dt) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); Quirk_MvM_Post(); return result; } @@ -199,7 +199,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(void, CTFBotMainAction_FireWeaponAtEnemy, CTFBot *actor) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBotMainAction_FireWeaponAtEnemy)(actor); + DETOUR_MEMBER_CALL(actor); Quirk_MvM_Post(); } @@ -208,7 +208,7 @@ namespace Mod::AI::MvM_Defender_Bots auto bot = reinterpret_cast(this); Quirk_MvM_Pre(bot->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBot_GetFlagToFetch)(); + auto result = DETOUR_MEMBER_CALL(); Quirk_MvM_Post(); return result; } @@ -237,7 +237,7 @@ namespace Mod::AI::MvM_Defender_Bots } Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotMainAction_SelectMoreDangerousThreatInternal)(nextbot, them, threat1, threat2); + auto result = DETOUR_MEMBER_CALL(nextbot, them, threat1, threat2); Quirk_MvM_Post(); return result; } @@ -245,7 +245,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(ActionResult, CTFBotSpyAttack_Update, CTFBot *actor, float dt) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotSpyAttack_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); Quirk_MvM_Post(); return result; } @@ -253,7 +253,7 @@ namespace Mod::AI::MvM_Defender_Bots DETOUR_DECL_MEMBER(ActionResult, CTFBotStickybombSentrygun_Update, CTFBot *actor, float dt) { Quirk_MvM_Pre(actor->GetTeamNumber() == TF_TEAM_RED); - auto result = DETOUR_MEMBER_CALL(CTFBotStickybombSentrygun_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); Quirk_MvM_Post(); return result; } diff --git a/src/mod/ai/mvm_defender_bots/quirks/steamid.cpp b/src/mod/ai/mvm_defender_bots/quirks/steamid.cpp index 2fd255d1..535eb102 100644 --- a/src/mod/ai/mvm_defender_bots/quirks/steamid.cpp +++ b/src/mod/ai/mvm_defender_bots/quirks/steamid.cpp @@ -151,7 +151,7 @@ namespace Mod::AI::MvM_Defender_Bots } } - return DETOUR_MEMBER_CALL(CBasePlayer_GetSteamID)(pID); + return DETOUR_MEMBER_CALL(pID); } diff --git a/src/mod/ai/npc_nextbot/npc_nextbot.cpp b/src/mod/ai/npc_nextbot/npc_nextbot.cpp index 5b8e087f..4c7a92cf 100644 --- a/src/mod/ai/npc_nextbot/npc_nextbot.cpp +++ b/src/mod/ai/npc_nextbot/npc_nextbot.cpp @@ -25,7 +25,7 @@ namespace Mod::AI::NPC_Nextbot // VHOOK_DECL(void, CBaseEntity_GetServerClass, int team) // { - // VHOOK_CALL(CBotNPCArcher_ChangeTeam)(team); + // VHOOK_CALL(team); // auto me = reinterpret_cast(this); // if (team == TF_TEAM_RED) { // me->m_nSkin = 0; @@ -217,7 +217,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(void, CBotNPCArcher_CBotNPCArcher) { - DETOUR_MEMBER_CALL(CBotNPCArcher_CBotNPCArcher)(); + DETOUR_MEMBER_CALL(); auto bot = reinterpret_cast(this); if (create_my_nextbot) { bot->SetCollisionGroup(COLLISION_GROUP_PLAYER_MOVEMENT); @@ -237,7 +237,7 @@ namespace Mod::AI::NPC_Nextbot auto bot = reinterpret_cast(this); auto preHealth = bot->GetHealth(); auto preMaxHealth = bot->GetMaxHealth(); - DETOUR_MEMBER_CALL(CBotNPCArcher_Spawn)(); + DETOUR_MEMBER_CALL(); if (FStrEq(bot->GetClassname(), "$bot_npc")) { if (bot->m_bow != nullptr) { bot->m_bow.Get()->Remove(); @@ -265,7 +265,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(void, CBotNPCArcherIntention_CBotNPCArcherIntention, CBotNPCArcher *zombie) { - DETOUR_MEMBER_CALL(CBotNPCArcherIntention_CBotNPCArcherIntention)(zombie); + DETOUR_MEMBER_CALL(zombie); if (create_my_nextbot) { auto intention = reinterpret_cast(this); intention->m_behavior->SetAction(new CMyNextbotMainAction()); @@ -274,7 +274,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(void, CBotNPCArcherIntention_Reset) { - DETOUR_MEMBER_CALL(CBotNPCArcherIntention_Reset)(); + DETOUR_MEMBER_CALL(); auto intention = reinterpret_cast(this); if (intention->GetBot()->GetEntity()->GetEntityModule("mynextbotmodule") != nullptr) { intention->m_behavior->SetAction(new CMyNextbotMainAction()); @@ -283,7 +283,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(bool, CTraceFilterIgnorePlayers_ShouldHitEntity, IHandleEntity *pServerEntity, int contentsMask) { - auto result = DETOUR_MEMBER_CALL(CTraceFilterIgnorePlayers_ShouldHitEntity)(pServerEntity, contentsMask); + auto result = DETOUR_MEMBER_CALL(pServerEntity, contentsMask); if (result) { auto entity = EntityFromEntityHandle(pServerEntity); if (entity != nullptr && PStr<"$bot_npc">() == entity->GetClassname()) return false; @@ -297,13 +297,13 @@ namespace Mod::AI::NPC_Nextbot if (current_kill_icon != nullptr) { return current_kill_icon; } - auto result = DETOUR_MEMBER_CALL(CTFGameRules_GetKillingWeaponName)(info, pVictim, iWeaponID); + auto result = DETOUR_MEMBER_CALL(info, pVictim, iWeaponID); return result; } DETOUR_DECL_MEMBER(void, NextBotGroundLocomotion_ApplyAccumulatedApproach) { - DETOUR_MEMBER_CALL(NextBotGroundLocomotion_ApplyAccumulatedApproach)(); + DETOUR_MEMBER_CALL(); auto loco = reinterpret_cast(this); Msg("apply %f %f\n", loco->m_moveVector.x, loco->m_moveVector.y); } @@ -346,7 +346,7 @@ namespace Mod::AI::NPC_Nextbot } } - return VHOOK_CALL(CBotNPCArcher_OnTakeDamage)(info); + return VHOOK_CALL(info); } VHOOK_DECL(int, CBotNPCArcher_OnTakeDamage_Alive, const CTakeDamageInfo& rawInfo) @@ -359,7 +359,7 @@ namespace Mod::AI::NPC_Nextbot CTFGameRules::DamageModifyExtras_t outParams; info.SetDamage( TFGameRules()->ApplyOnDamageAliveModifyRules( info, ent, outParams ) ); - int dmg = VHOOK_CALL(CBotNPCArcher_OnTakeDamage_Alive)(info); + int dmg = VHOOK_CALL(info); if (preHealth - ent->GetHealth() > 0) { IGameEvent *event = gameeventmanager->CreateEvent("npc_hurt"); @@ -434,7 +434,7 @@ namespace Mod::AI::NPC_Nextbot { //Msg("Main Upkeep\n"); auto nextbot = reinterpret_cast(this); - VHOOK_CALL(CBotNPCArcher_Upkeep)(); + VHOOK_CALL(); } @@ -446,7 +446,7 @@ namespace Mod::AI::NPC_Nextbot auto mod = nextbot->GetEntity()->GetEntityModule("mynextbotmodule"); mod->Update(); if (!mod->m_bFreeze) { - VHOOK_CALL(CBotNPCArcher_Update)(); + VHOOK_CALL(); } SetCurrentNextbot(nullptr); } @@ -478,13 +478,13 @@ namespace Mod::AI::NPC_Nextbot } // Don't collide with other non teamed } - return VHOOK_CALL(CBotNPCArcher_ShouldCollide)(collisionGroup,contentsMask ); + return VHOOK_CALL(collisionGroup,contentsMask ); } VHOOK_DECL(void, CBotNPCArcher_ChangeTeam, int team) { - VHOOK_CALL(CBotNPCArcher_ChangeTeam)(team); + VHOOK_CALL(team); auto me = reinterpret_cast(this); bool zombie = GetNextbotModule(me)->m_bIsZombie; if (team == TF_TEAM_RED) { @@ -511,7 +511,7 @@ namespace Mod::AI::NPC_Nextbot { info_modified.AddDamageType(DMG_CRITICAL); } - return VHOOK_CALL(CBotNPCArcher_TraceAttack)(info_modified,vecDir, ptr, pAccumulator ); + return VHOOK_CALL(info_modified,vecDir, ptr, pAccumulator ); } VHOOK_DECL(const QAngle &, CBotNPCArcher_EyeAngles) @@ -521,7 +521,7 @@ namespace Mod::AI::NPC_Nextbot VHOOK_DECL(void, CBotNPCArcher_RefreshCollisionBounds) { - VHOOK_CALL(CBotNPCArcher_RefreshCollisionBounds)(); + VHOOK_CALL(); auto me = reinterpret_cast(this); GetNextbotModule(me)->SetEyeOffset(); } @@ -592,7 +592,7 @@ namespace Mod::AI::NPC_Nextbot // } // } - // return DETOUR_MEMBER_CALL(CTraceFilterSimple_ShouldHitEntity)(pServerEntity, contentsMask); + // return DETOUR_MEMBER_CALL(pServerEntity, contentsMask); // } template diff --git a/src/mod/ai/npc_nextbot/npc_nextbot_body.cpp b/src/mod/ai/npc_nextbot/npc_nextbot_body.cpp index e9e12e93..c895bbbe 100644 --- a/src/mod/ai/npc_nextbot/npc_nextbot_body.cpp +++ b/src/mod/ai/npc_nextbot/npc_nextbot_body.cpp @@ -779,7 +779,7 @@ namespace Mod::AI::NPC_Nextbot VHOOK_DECL(void, MyNextbotBody_Reset) { - VHOOK_CALL(MyNextbotBody_Reset)(); + VHOOK_CALL(); auto body = reinterpret_cast(this); auto entity = body->GetBot()->GetEntity(); MyNextbotModule *mod = entity->GetEntityModule("mynextbotmodule"); @@ -983,7 +983,7 @@ namespace Mod::AI::NPC_Nextbot auto body = reinterpret_cast(this); auto mod = GetNextbotModuleBody(body); mod->m_pEntity->AddGesture(TranslateActivity(body, mod->m_pEntity, mod, ACT_MP_JUMP_LAND)); - VHOOK_CALL(MyNextbotBody_OnLandOnGround)(ground); + VHOOK_CALL(ground); } VHOOK_DECL(bool, MyNextbotBody_IsHeadAimingOnTarget) diff --git a/src/mod/ai/npc_nextbot/npc_nextbot_locomotion.cpp b/src/mod/ai/npc_nextbot/npc_nextbot_locomotion.cpp index 83724708..c11667df 100644 --- a/src/mod/ai/npc_nextbot/npc_nextbot_locomotion.cpp +++ b/src/mod/ai/npc_nextbot/npc_nextbot_locomotion.cpp @@ -76,7 +76,7 @@ namespace Mod::AI::NPC_Nextbot VHOOK_DECL(void, MyNextbotLocomotion_Reset) { - VHOOK_CALL(MyNextbotLocomotion_Reset)(); + VHOOK_CALL(); auto loco = reinterpret_cast(this); auto entity = loco->GetBot()->GetEntity(); MyNextbotModule *mod = entity->GetEntityModule("mynextbotmodule"); @@ -120,7 +120,7 @@ namespace Mod::AI::NPC_Nextbot auto preAccumWeights = loco->m_accumApproachWeights; auto preAccumVectors = loco->m_accumApproachVectors; - VHOOK_CALL(MyNextbotLocomotion_Update)(); + VHOOK_CALL(); loco->m_accumApproachWeights = preAccumWeights; loco->m_accumApproachVectors = preAccumVectors; @@ -138,7 +138,7 @@ namespace Mod::AI::NPC_Nextbot VHOOK_DECL(void, MyNextbotLocomotion_Approach, const Vector &vec, float weight) { - VHOOK_CALL(MyNextbotLocomotion_Approach)(vec, weight); + VHOOK_CALL(vec, weight); TE_BeamPointsForDebug(vec, vec + Vector(0,0,100), 1.0f, 255, 255, 0); } diff --git a/src/mod/ai/npc_nextbot/npc_nextbot_unlag.cpp b/src/mod/ai/npc_nextbot/npc_nextbot_unlag.cpp index 1dc052ed..2cd4392f 100644 --- a/src/mod/ai/npc_nextbot/npc_nextbot_unlag.cpp +++ b/src/mod/ai/npc_nextbot/npc_nextbot_unlag.cpp @@ -330,7 +330,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(void, CLagCompensationManager_FinishLagCompensation, CBasePlayer *player) { - DETOUR_MEMBER_CALL(CLagCompensationManager_FinishLagCompensation)(player); + DETOUR_MEMBER_CALL(player); if (reinterpret_cast(this) != &g_LagCompensationManager.GetRef()) return; VPROF_BUDGET_FLAGS( "FinishNPCLagCompensation", VPROF_BUDGETGROUP_OTHER_NETWORKING, BUDGETFLAG_CLIENT|BUDGETFLAG_SERVER ); @@ -463,7 +463,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(void, CLagCompensationManager_StartLagCompensation, CBasePlayer *player, CUserCmd *cmd) { - DETOUR_MEMBER_CALL(CLagCompensationManager_StartLagCompensation)(player, cmd); + DETOUR_MEMBER_CALL(player, cmd); if (reinterpret_cast(this) != &g_LagCompensationManager.GetRef()) return; if (cmd == nullptr) return; @@ -645,7 +645,7 @@ namespace Mod::AI::NPC_Nextbot DETOUR_DECL_MEMBER(void, NextBotCombatCharacter_Spawn) { - DETOUR_MEMBER_CALL(NextBotCombatCharacter_Spawn)(); + DETOUR_MEMBER_CALL(); auto entity = reinterpret_cast(this); if (!FStrEq(entity->GetClassname(), "$bot_npc")) { entity->GetOrCreateEntityModule("lagcomp"); diff --git a/src/mod/ai/npc_nextbot/npc_nextbot_vision.cpp b/src/mod/ai/npc_nextbot/npc_nextbot_vision.cpp index 7d66a5a2..c93904ef 100644 --- a/src/mod/ai/npc_nextbot/npc_nextbot_vision.cpp +++ b/src/mod/ai/npc_nextbot/npc_nextbot_vision.cpp @@ -27,12 +27,12 @@ namespace Mod::AI::NPC_Nextbot } // Increase vision cooldown, for performace mod->m_VisionScanTime.Start(RandomFloat(0.8f, 1.2f)); - VHOOK_CALL(MyNextbotVision_Update)(); + VHOOK_CALL(); } VHOOK_DECL(void, MyNextbotVision_CollectPotentiallyVisibleEntities, CUtlVector *visible) { - VHOOK_CALL(MyNextbotVision_CollectPotentiallyVisibleEntities)(visible); + VHOOK_CALL(visible); for (int i = 0; i < IBaseObjectAutoList::AutoList().Count(); ++i) { auto obj = rtti_scast(IBaseObjectAutoList::AutoList()[i]); if (obj != nullptr && !obj->m_bPlacing && !obj->m_bCarried) { @@ -89,7 +89,7 @@ namespace Mod::AI::NPC_Nextbot if (subjectCombat != nullptr && IsOnNav(subjectCombat, 20, 4) && IsOnNav(entity, 20, 4) && entity->GetLastKnownArea() != nullptr && entity->GetLastKnownArea()->IsCompletelyVisible(subjectCombat->GetLastKnownArea())) { return true; } - return VHOOK_CALL(MyNextbotVision_IsAbleToSee)(subject, checkFOV, visibleSpot); + return VHOOK_CALL(subject, checkFOV, visibleSpot); } void LoadVisionHooks(void **vtable) { diff --git a/src/mod/ai/prevent_postmortem_updates.cpp b/src/mod/ai/prevent_postmortem_updates.cpp index c5d08ec1..a583262b 100644 --- a/src/mod/ai/prevent_postmortem_updates.cpp +++ b/src/mod/ai/prevent_postmortem_updates.cpp @@ -13,7 +13,7 @@ namespace Mod::AI::Prevent_Postmortem_Updates return EventDesiredResult::ChangeTo(CTFBotDead::New(), "I died!"); } - return DETOUR_MEMBER_CALL(Action_CTFBot_OnKilled)(actor, info); + return DETOUR_MEMBER_CALL(actor, info); } diff --git a/src/mod/ai/rocketjump.cpp b/src/mod/ai/rocketjump.cpp index 6f6e9fec..2880804a 100644 --- a/src/mod/ai/rocketjump.cpp +++ b/src/mod/ai/rocketjump.cpp @@ -221,7 +221,7 @@ namespace Mod::AI::RocketJump m_itUnderground->Reset(); - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } @@ -231,7 +231,7 @@ namespace Mod::AI::RocketJump { dmginfo = &info; SCOPED_INCREMENT(rc_CTFPlayer_ApplyPushFromDamage); - DETOUR_MEMBER_CALL(CTFPlayer_ApplyPushFromDamage)(info, vec); + DETOUR_MEMBER_CALL(info, vec); } DETOUR_DECL_MEMBER(void, CTFPlayer_ApplyAbsVelocityImpulse, const Vector& impulse) @@ -265,7 +265,7 @@ namespace Mod::AI::RocketJump } } - DETOUR_MEMBER_CALL(CTFPlayer_ApplyAbsVelocityImpulse)(impulse); + DETOUR_MEMBER_CALL(impulse); } diff --git a/src/mod/ai/wrapassassin_altfire.cpp b/src/mod/ai/wrapassassin_altfire.cpp index 31d19d21..6fc4d7fe 100644 --- a/src/mod/ai/wrapassassin_altfire.cpp +++ b/src/mod/ai/wrapassassin_altfire.cpp @@ -11,7 +11,7 @@ namespace Mod::AI::WrapAssassin_AltFire { // DevMsg("CTFBot::OpportunisticallyUseWeaponAbilities BEGIN\n"); SCOPED_INCREMENT(rc_CTFBot_OpportunisticallyUseWeaponAbilities); - auto result = DETOUR_MEMBER_CALL(CTFBot_OpportunisticallyUseWeaponAbilities)(); + auto result = DETOUR_MEMBER_CALL(); // DevMsg("CTFBot::OpportunisticallyUseWeaponAbilities END\n"); return result; } @@ -24,7 +24,7 @@ namespace Mod::AI::WrapAssassin_AltFire } // DevMsg(" CTFBat_Giftwrap::GetWeaponID PASSTHRU\n"); - return DETOUR_MEMBER_CALL(CTFBat_Giftwrap_GetWeaponID)(); + return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/anim/estimateabsvelocity_moveparent_fix.cpp b/src/mod/anim/estimateabsvelocity_moveparent_fix.cpp index face6239..9903b2bf 100644 --- a/src/mod/anim/estimateabsvelocity_moveparent_fix.cpp +++ b/src/mod/anim/estimateabsvelocity_moveparent_fix.cpp @@ -9,7 +9,7 @@ namespace Mod::Anim::EstimateAbsVelocity_MoveParent_Fix { auto ent = reinterpret_cast(this); - DETOUR_MEMBER_CALL(C_BaseEntity_EstimateAbsVelocity)(vel); + DETOUR_MEMBER_CALL(vel); CBaseEntity *ent_sv = UTIL_EntityByIndex(ent->entindex()); if (ent_sv != nullptr) { diff --git a/src/mod/anim/player_updatemodel_animstate_fix.cpp b/src/mod/anim/player_updatemodel_animstate_fix.cpp index 8175ede3..bc4813bc 100644 --- a/src/mod/anim/player_updatemodel_animstate_fix.cpp +++ b/src/mod/anim/player_updatemodel_animstate_fix.cpp @@ -14,7 +14,7 @@ namespace Mod::Anim::Player_UpdateModel_AnimState_Fix { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(Model)(); + DETOUR_MEMBER_CALL(); DevMsg("[Player #%d \"%s\"] In CTFPlayer::UpdateModel, calling m_PlayerAnimState->OnNewModel()\n", ENTINDEX(player), player->GetPlayerName()); diff --git a/src/mod/attr/blockbackstab_oldstyle.cpp b/src/mod/attr/blockbackstab_oldstyle.cpp index 9c58cef7..b37ccccf 100644 --- a/src/mod/attr/blockbackstab_oldstyle.cpp +++ b/src/mod/attr/blockbackstab_oldstyle.cpp @@ -33,7 +33,7 @@ namespace Mod::Attr::BlockBackstab_OldStyle SCOPED_INCREMENT(rc_CTFPlayer_CheckBlockBackstab); the_ent = nullptr; - bool ret = DETOUR_MEMBER_CALL(CTFPlayer_CheckBlockBackstab)(attacker); + bool ret = DETOUR_MEMBER_CALL(attacker); // { // ConColorMsg(Color(0xff, 0xff, 0x00), "> CTFPlayer::CheckBlockBackstab: ret %d\n", (int)ret); @@ -86,7 +86,7 @@ namespace Mod::Attr::BlockBackstab_OldStyle DETOUR_DECL_MEMBER(float, CAttributeManager_ApplyAttributeFloatWrapper, float val, CBaseEntity *ent, string_t name, CUtlVector *vec) { - float ret = DETOUR_MEMBER_CALL(CAttributeManager_ApplyAttributeFloatWrapper)(val, ent, name, vec); + float ret = DETOUR_MEMBER_CALL(val, ent, name, vec); // ConColorMsg(Color(0x00, 0xff, 0xff), " > CAttributeManager::ApplyAttributeFloatWrapper(%.1f, #%d, \"%s\", 0x%08X)\n", // val, ENTINDEX(ent), STRING(name), (uintptr_t)vec); @@ -115,7 +115,7 @@ namespace Mod::Attr::BlockBackstab_OldStyle // nEffects, ENTINDEX(the_ent), (the_ent != nullptr ? the_ent->GetClassname() : "")); // } // -// DETOUR_MEMBER_CALL(CBaseEntity_AddEffects)(nEffects); +// DETOUR_MEMBER_CALL(nEffects); // } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CTFPlayerShared_SetItemChargeMeter, loadout_positions_t slot, float value) @@ -133,7 +133,7 @@ namespace Mod::Attr::BlockBackstab_OldStyle } } - DETOUR_MEMBER_CALL(CTFPlayerShared_SetItemChargeMeter)(slot, value); + DETOUR_MEMBER_CALL(slot, value); } diff --git a/src/mod/attr/custom_attributes.cpp b/src/mod/attr/custom_attributes.cpp index 9857e34f..38159a65 100644 --- a/src/mod/attr/custom_attributes.cpp +++ b/src/mod/attr/custom_attributes.cpp @@ -170,7 +170,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(bool, CTFPlayer_CanAirDash) { - bool ret = DETOUR_MEMBER_CALL(CTFPlayer_CanAirDash)(); + bool ret = DETOUR_MEMBER_CALL(); if (!ret) { auto player = reinterpret_cast(this); if (!player->IsPlayerClass(TF_CLASS_SCOUT)) { @@ -185,7 +185,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(bool, CWeaponMedigun_AllowedToHealTarget, CBaseEntity *target) { - bool ret = DETOUR_MEMBER_CALL(CWeaponMedigun_AllowedToHealTarget)(target); + bool ret = DETOUR_MEMBER_CALL(target); auto medigun = reinterpret_cast(this); auto owner = medigun->GetOwnerEntity(); @@ -261,7 +261,7 @@ namespace Mod::Attr::Custom_Attributes medigun->SetCustomVariable("healingnonplayer", Variant(false)); } - DETOUR_MEMBER_CALL(CWeaponMedigun_HealTargetThink)(); + DETOUR_MEMBER_CALL(); if (healobject != nullptr && healobject->IsBaseObject() && healobject->GetHealth() < healobject->GetMaxHealth() && healobject->GetTeamNumber() == owner->GetTeamNumber()) { int can_heal = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER( medigun, can_heal, medic_machinery_beam ); @@ -675,7 +675,7 @@ namespace Mod::Attr::Custom_Attributes SpawnCustomProjectile(projectilename, weapon, weapon->GetTFPlayerOwner(), false); return; } - DETOUR_MEMBER_CALL(CTFJar_TossJarThink)(); + DETOUR_MEMBER_CALL(); } RefCount rc_AltFireAttack; @@ -789,7 +789,7 @@ namespace Mod::Attr::Custom_Attributes } else { - proj = DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); + proj = DETOUR_MEMBER_CALL(player); } player->SetLocalOrigin(player->GetLocalOrigin() - originOffset); player->pl->v_angle -= angleOffset; @@ -965,13 +965,13 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_RemoveProjectileAmmo, CTFPlayer *player) { if (fire_projectile_multi) - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_RemoveProjectileAmmo)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_UpdatePunchAngles, CTFPlayer *player) { if (fire_projectile_multi) - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_UpdatePunchAngles)(player); + DETOUR_MEMBER_CALL(player); } THINK_FUNC_DECL(RelightBowArrow) @@ -989,7 +989,7 @@ namespace Mod::Attr::Custom_Attributes bow->m_bArrowAlight = true; } - DETOUR_MEMBER_CALL(CTFCompoundBow_LaunchGrenade)(); + DETOUR_MEMBER_CALL(); int attib_arrow_mastery = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER( bow, attib_arrow_mastery, arrow_mastery ); @@ -1030,7 +1030,7 @@ namespace Mod::Attr::Custom_Attributes VHOOK_DECL(bool, CTFCompoundBow_Deploy) { - auto result = VHOOK_CALL(CTFCompoundBow_Deploy)(); + auto result = VHOOK_CALL(); auto bow = reinterpret_cast(this); int arrowIgnite = 0; @@ -1043,7 +1043,7 @@ namespace Mod::Attr::Custom_Attributes RefCount rc_stop_our_team_deflect; DETOUR_DECL_MEMBER(void, CTFWeaponBaseMelee_Swing, CTFPlayer *player) { - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Swing)(player); + DETOUR_MEMBER_CALL(player); auto weapon = reinterpret_cast(this); float smacktime = weapon->m_flSmackTime; float time = gpGlobals->curtime; @@ -1070,7 +1070,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(int, CBaseObject_OnTakeDamage, CTakeDamageInfo &info) { - int damage = DETOUR_MEMBER_CALL(CBaseObject_OnTakeDamage)(info); + int damage = DETOUR_MEMBER_CALL(info); auto weapon = info.GetWeapon(); if (weapon != nullptr) { auto tfweapon = ToBaseCombatWeapon(weapon); @@ -1100,7 +1100,7 @@ namespace Mod::Attr::Custom_Attributes is_ice = false; killer_weapon = info.GetWeapon(); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); int destroyBuildingsOnDeath = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(player, destroyBuildingsOnDeath, destroy_buildings_on_death); @@ -1127,7 +1127,7 @@ namespace Mod::Attr::Custom_Attributes { bIce |= is_ice; - DETOUR_MEMBER_CALL(CTFPlayer_CreateRagdollEntity)(bShouldGib, bBurning, bUberDrop, bOnGround, bYER, bGold, bIce, bAsh, iCustom, bClassic); + DETOUR_MEMBER_CALL(bShouldGib, bBurning, bUberDrop, bOnGround, bYER, bGold, bIce, bAsh, iCustom, bClassic); } void GetExplosionParticle(CTFPlayer *player, CTFWeaponBase *weapon, int &particle, int &particleDirectHit) { @@ -1167,7 +1167,7 @@ namespace Mod::Attr::Custom_Attributes particle_to_use = 0; particle_to_use_direct_hit = 0; GetExplosionParticle(stickbomb->GetTFPlayerOwner(), stickbomb,particle_to_use, particle_to_use_direct_hit); - DETOUR_MEMBER_CALL(CTFStickBomb_Smack)(); + DETOUR_MEMBER_CALL(); stickbomb = nullptr; particle_to_use_direct_hit = 0; particle_to_use = 0; @@ -1203,7 +1203,7 @@ namespace Mod::Attr::Custom_Attributes //info.m_DmgInfo->SetDamageType(info.m_DmgInfo->GetDamageType() & (~DMG_USEDISTANCEMOD)); if (minicrit) { stickbomb->GetTFPlayerOwner()->m_Shared->AddCond(TF_COND_NOHEALINGDAMAGEBUFF, 99.0f); - DETOUR_MEMBER_CALL(CTFGameRules_RadiusDamage)(info); + DETOUR_MEMBER_CALL(info); stickbomb->GetTFPlayerOwner()->m_Shared->RemoveCond(TF_COND_NOHEALINGDAMAGEBUFF); return; } @@ -1246,14 +1246,14 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFGameRules_RadiusDamage)(info); + DETOUR_MEMBER_CALL(info); } CBasePlayer *process_movement_player = nullptr; DETOUR_DECL_MEMBER(void, CTFGameMovement_ProcessMovement, CBasePlayer *player, void *data) { process_movement_player = player; - DETOUR_MEMBER_CALL(CTFGameMovement_ProcessMovement)(player, data); + DETOUR_MEMBER_CALL(player, data); process_movement_player = nullptr; } @@ -1267,7 +1267,7 @@ namespace Mod::Attr::Custom_Attributes restoreDucking = true; } } - bool ret = DETOUR_MEMBER_CALL(CTFGameMovement_CheckJumpButton)(); + bool ret = DETOUR_MEMBER_CALL(); if (restoreDucking) { process_movement_player->m_fFlags |= FL_DUCKING; } @@ -1551,7 +1551,7 @@ namespace Mod::Attr::Custom_Attributes if (modelname != nullptr) { return modelname; } - return DETOUR_MEMBER_CALL(CTFWeaponInvis_GetViewModel)(index); + return DETOUR_MEMBER_CALL(index); } void UpdateCustomModel(CTFPlayer *owner, CEconEntity *entity, CAttributeList &attrlist) { @@ -1623,7 +1623,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFWeaponBase_UpdateHands) { - DETOUR_MEMBER_CALL(CTFWeaponBase_UpdateHands)(); + DETOUR_MEMBER_CALL(); auto weapon = reinterpret_cast(this); GET_STRING_ATTRIBUTE(weapon, custom_view_model, viewmodel); @@ -1636,7 +1636,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CEconEntity_UpdateModelToClass) { - DETOUR_MEMBER_CALL(CEconEntity_UpdateModelToClass)(); + DETOUR_MEMBER_CALL(); auto entity = reinterpret_cast(this); auto owner = ToTFPlayer(entity->GetOwnerEntity()); @@ -1647,7 +1647,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_Equip, CBaseCombatCharacter *owner) { - DETOUR_MEMBER_CALL(CBaseCombatWeapon_Equip)(owner); + DETOUR_MEMBER_CALL(owner); auto ent = reinterpret_cast(this); GET_STRING_ATTRIBUTE_NO_CACHE(ent, attachment_name, attachmentname); @@ -1696,7 +1696,7 @@ namespace Mod::Attr::Custom_Attributes } ExplosionCustomSet(proj); - DETOUR_MEMBER_CALL(CTFWeaponBaseGrenadeProj_Explode)(pTrace, bitsDamageType); + DETOUR_MEMBER_CALL(pTrace, bitsDamageType); particle_to_use = 0; particle_to_use_direct_hit = 0; } @@ -1722,7 +1722,7 @@ namespace Mod::Attr::Custom_Attributes particle_to_use_direct_hit = 0; ExplosionCustomSet(proj); hit_explode_direct = pOther; - DETOUR_MEMBER_CALL(CTFBaseRocket_Explode)(pTrace, pOther); + DETOUR_MEMBER_CALL(pTrace, pOther); hit_explode_direct = nullptr; particle_to_use = 0; @@ -1734,7 +1734,7 @@ namespace Mod::Attr::Custom_Attributes auto proj = reinterpret_cast(this); ExplosionCustomSet(proj); hit_explode_direct = pOther; - DETOUR_MEMBER_CALL(CTFProjectile_EnergyBall_Explode)(pTrace, pOther); + DETOUR_MEMBER_CALL(pTrace, pOther); hit_explode_direct = nullptr; } @@ -1750,7 +1750,7 @@ namespace Mod::Attr::Custom_Attributes if (particle_to_use == -1) return; - DETOUR_STATIC_CALL(TE_TFExplosion)(filter, flDelay, vecOrigin, vecNormal, iWeaponID, nEntIndex, nDefID, nSound, iCustomParticle); + DETOUR_STATIC_CALL(filter, flDelay, vecOrigin, vecNormal, iWeaponID, nEntIndex, nDefID, nSound, iCustomParticle); } RefCount rc_CTFPlayer_TraceAttack; @@ -1763,8 +1763,8 @@ namespace Mod::Attr::Custom_Attributes int weaponid = weapon->GetWeaponID(); // Allow SPECIAL1 sound for Cow Mangler and SPECIAL3 sound for short circuit - if (index == SPECIAL1 && weaponid != TF_WEAPON_PARTICLE_CANNON) return DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); - if (index == SPECIAL3 && weaponid != TF_WEAPON_MECHANICAL_ARM) return DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); + if (index == SPECIAL1 && weaponid != TF_WEAPON_PARTICLE_CANNON) return DETOUR_MEMBER_CALL(index, soundtime); + if (index == SPECIAL3 && weaponid != TF_WEAPON_MECHANICAL_ARM) return DETOUR_MEMBER_CALL(index, soundtime); int attr_name = -1; @@ -1800,7 +1800,7 @@ namespace Mod::Attr::Custom_Attributes return; } auto oldOwner = weapon->GetOwner(); - DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); + DETOUR_MEMBER_CALL(index, soundtime); weapon_sound_override = nullptr; } @@ -1810,14 +1810,14 @@ namespace Mod::Attr::Custom_Attributes //reinterpret_cast(filter).AddRecipient(weapon_sound_override_owner); sound = weapon_sound_override; } - DETOUR_STATIC_CALL(CBaseEntity_EmitSound)(filter, iEntIndex, sound, pOrigin, start, duration); + DETOUR_STATIC_CALL(filter, iEntIndex, sound, pOrigin, start, duration); } RefCount rc_CTFWeaponFlameBall_FireProjectile; DETOUR_DECL_MEMBER(CBaseAnimating *, CTFWeaponFlameBall_FireProjectile, CTFPlayer *player) { SCOPED_INCREMENT(rc_CTFWeaponFlameBall_FireProjectile); - return DETOUR_MEMBER_CALL(CTFWeaponFlameBall_FireProjectile)(player); + return DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CBaseEntity_EmitSound_member, const char *sound, float start, float duration) @@ -1830,7 +1830,7 @@ namespace Mod::Attr::Custom_Attributes sound = soundfiring; } } - DETOUR_MEMBER_CALL(CBaseEntity_EmitSound_member)(sound, start, duration); + DETOUR_MEMBER_CALL(sound, start, duration); } int fire_bullet_num_shot = 0; @@ -1845,7 +1845,7 @@ namespace Mod::Attr::Custom_Attributes info.m_flDistance = rangeLimit; } } - DETOUR_MEMBER_CALL(CTFPlayer_FireBullet)(weapon, info, bDoEffects, nDamageType, nCustomDamageType); + DETOUR_MEMBER_CALL(weapon, info, bDoEffects, nDamageType, nCustomDamageType); fire_bullet_num_shot++; } @@ -1853,7 +1853,7 @@ namespace Mod::Attr::Custom_Attributes int iWeapon, int iMode, int iSeed, float flSpread, float flDamage, bool bCritical) { fire_bullet_num_shot = 0; - DETOUR_STATIC_CALL(FX_FireBullets)(pWpn, iPlayer, vecOrigin, vecAngles, iWeapon, iMode, iSeed, flSpread, flDamage, bCritical); + DETOUR_STATIC_CALL(pWpn, iPlayer, vecOrigin, vecAngles, iWeapon, iMode, iSeed, flSpread, flDamage, bCritical); fire_bullet_num_shot = 0; } @@ -1907,7 +1907,7 @@ namespace Mod::Attr::Custom_Attributes if (arrow->m_bPenetrate && ToTFPlayer(ent) != nullptr && ToTFPlayer(ent)->m_Shared->IsInvulnerable() && ent->GetTeamNumber() == arrow->GetTeamNumber()) { return true; } - auto ret = DETOUR_MEMBER_CALL(CTFProjectile_Arrow_StrikeTarget)(bbox, ent); + auto ret = DETOUR_MEMBER_CALL(bbox, ent); if (!ret && bounce_speed_target == 0) { float bounce_speed = 0; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(arrow->GetOriginalLauncher(), bounce_speed, grenade_bounce_speed); @@ -1998,7 +1998,7 @@ namespace Mod::Attr::Custom_Attributes TFGameRules()->RadiusDamage( radiusinfo ); weapon->SetAbsOrigin(origpos); hit_explode_direct = nullptr; - DETOUR_MEMBER_CALL(CBaseEntity_DispatchTraceAttack)(info2, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(info2, vecDir, ptr, pAccumulator); return; } } @@ -2008,19 +2008,19 @@ namespace Mod::Attr::Custom_Attributes minicrit = (info.GetDamageType() & DMG_RADIUS_MAX) != 0; stickbomb->GetTFPlayerOwner()->m_Shared->AddCond(TF_COND_NOHEALINGDAMAGEBUFF, 99.0f); - DETOUR_MEMBER_CALL(CBaseEntity_DispatchTraceAttack)(info, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(info, vecDir, ptr, pAccumulator); stickbomb->GetTFPlayerOwner()->m_Shared->RemoveCond(TF_COND_NOHEALINGDAMAGEBUFF); DevMsg("mini crit set: %d\n",minicrit); return; } } - DETOUR_MEMBER_CALL(CBaseEntity_DispatchTraceAttack)(useinfomod ? infomod : info, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(useinfomod ? infomod : info, vecDir, ptr, pAccumulator); } DETOUR_DECL_MEMBER(bool, CRecipientFilter_IgnorePredictionCull) { - return force_send_client || DETOUR_MEMBER_CALL(CRecipientFilter_IgnorePredictionCull)(); + return force_send_client || DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFCompoundBow_GetProjectileSpeed) @@ -2028,7 +2028,7 @@ namespace Mod::Attr::Custom_Attributes auto bow = reinterpret_cast(this); float speed = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(bow, speed, mult_projectile_speed); - speed *= DETOUR_MEMBER_CALL(CTFCompoundBow_GetProjectileSpeed)(); + speed *= DETOUR_MEMBER_CALL(); return speed; } @@ -2039,12 +2039,12 @@ namespace Mod::Attr::Custom_Attributes if (proj->GetOriginalLauncher() != nullptr) { CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(proj->GetOriginalLauncher(), speed, mult_projectile_speed); } - return speed * DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_GetInitialVelocity)(); + return speed * DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(CBaseEntity *, CTFWeaponBaseGun_FireEnergyBall, CTFPlayer *player, bool ring) { - auto proj = DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireEnergyBall)(player, ring); + auto proj = DETOUR_MEMBER_CALL(player, ring); if (ring && proj != nullptr) { auto weapon = reinterpret_cast(this); Vector vel = proj->GetAbsVelocity(); @@ -2060,7 +2060,7 @@ namespace Mod::Attr::Custom_Attributes auto bow = reinterpret_cast(this); float speed = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(bow, speed, mult_projectile_speed); - return speed * DETOUR_MEMBER_CALL(CTFCrossbow_GetProjectileSpeed)(); + return speed * DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFGrapplingHook_GetProjectileSpeed) @@ -2068,7 +2068,7 @@ namespace Mod::Attr::Custom_Attributes auto bow = reinterpret_cast(this); float speed = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(bow, speed, mult_projectile_speed); - return speed * DETOUR_MEMBER_CALL(CTFGrapplingHook_GetProjectileSpeed)(); + return speed * DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFShotgunBuildingRescue_GetProjectileSpeed) @@ -2076,7 +2076,7 @@ namespace Mod::Attr::Custom_Attributes auto bow = reinterpret_cast(this); float speed = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(bow, speed, mult_projectile_speed); - return speed * DETOUR_MEMBER_CALL(CTFShotgunBuildingRescue_GetProjectileSpeed)(); + return speed * DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFWeaponBaseGun_GetProjectileSpeed) @@ -2164,27 +2164,27 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(int, CTFWeaponBase_GetDamageType) { - return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL(CTFWeaponBase_GetDamageType)()); + return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL()); } DETOUR_DECL_MEMBER(int, CTFSniperRifle_GetDamageType) { - return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL(CTFSniperRifle_GetDamageType)()); + return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL()); } DETOUR_DECL_MEMBER(int, CTFSniperRifleClassic_GetDamageType) { - return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL(CTFSniperRifleClassic_GetDamageType)()); + return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL()); } DETOUR_DECL_MEMBER(int, CTFSMG_GetDamageType) { - return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL(CTFSMG_GetDamageType)()); + return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL()); } DETOUR_DECL_MEMBER(int, CTFRevolver_GetDamageType) { - return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL(CTFRevolver_GetDamageType)()); + return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL()); } DETOUR_DECL_MEMBER(int, CTFPistol_ScoutSecondary_GetDamageType) { - return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL(CTFPistol_ScoutSecondary_GetDamageType)()); + return GetDamageType(reinterpret_cast(this), DETOUR_MEMBER_CALL()); } bool CanHeadshot(CBaseProjectile *projectile) { @@ -2200,22 +2200,22 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(bool, CTFProjectile_HealingBolt_CanHeadshot) { - return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(CTFProjectile_HealingBolt_CanHeadshot)(); + return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFProjectile_EnergyRing_CanHeadshot) { - return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_CanHeadshot)(); + return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFProjectile_GrapplingHook_CanHeadshot) { - return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(CTFProjectile_GrapplingHook_CanHeadshot)(); + return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFProjectile_EnergyBall_CanHeadshot) { - return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(CTFProjectile_EnergyBall_CanHeadshot)(); + return CanHeadshot(reinterpret_cast(this)) || DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFProjectile_Arrow_CanHeadshot) @@ -2233,7 +2233,7 @@ namespace Mod::Attr::Custom_Attributes return false; } - return DETOUR_MEMBER_CALL(CTFProjectile_Arrow_CanHeadshot)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CBaseCombatCharacter_OnTakeDamage, const CTakeDamageInfo& info) @@ -2246,11 +2246,11 @@ namespace Mod::Attr::Custom_Attributes if (dmg_mult != 1.0f) { CTakeDamageInfo newinfo = info; newinfo.SetDamage(newinfo.GetDamage() * dmg_mult); - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(newinfo); + return DETOUR_MEMBER_CALL(newinfo); } } } - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } float GetDamageMult(CBaseProjectile *proj) @@ -2643,7 +2643,7 @@ namespace Mod::Attr::Custom_Attributes info.SetDamage(info.GetDamage() * dmg_mult); } - int ret = DETOUR_MEMBER_CALL(CTFGameRules_ApplyOnDamageModifyRules)(info, pVictim, b1); + int ret = DETOUR_MEMBER_CALL(info, pVictim, b1); // ApplyOnHit for non players and vs buildings if ((info.GetAttacker() == nullptr || !info.GetAttacker()->IsPlayer() || pVictim->IsBaseObject()) && weapon != nullptr) { @@ -2692,7 +2692,7 @@ namespace Mod::Attr::Custom_Attributes bool firing = minigun->m_iWeaponState == CTFMinigun::AC_STATE_FIRING; if (firing) minigun->m_iWeaponState = CTFMinigun::AC_STATE_SPINNING; - bool ret = DETOUR_MEMBER_CALL(CTFMinigun_CanHolster)(); + bool ret = DETOUR_MEMBER_CALL(); if (firing) minigun->m_iWeaponState = CTFMinigun::AC_STATE_FIRING; @@ -2703,11 +2703,11 @@ namespace Mod::Attr::Custom_Attributes int cannotApply = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(target, cannotApply, cannot_be_sapped); if (!cannotApply) - DETOUR_MEMBER_CALL(CObjectSapper_ApplyRoboSapperEffects)(target, duration); + DETOUR_MEMBER_CALL(target, duration); } DETOUR_DECL_MEMBER(bool, CObjectSapper_IsParentValid) { - bool ret = DETOUR_MEMBER_CALL(CObjectSapper_IsParentValid)(); + bool ret = DETOUR_MEMBER_CALL(); if (ret) { CTFPlayer * player = ToTFPlayer(reinterpret_cast(this)->GetBuiltOnEntity()); if (player != nullptr) { @@ -2722,7 +2722,7 @@ namespace Mod::Attr::Custom_Attributes } DETOUR_DECL_MEMBER(bool, CTFPlayer_IsAllowedToTaunt) { - bool ret = DETOUR_MEMBER_CALL(CTFPlayer_IsAllowedToTaunt)(); + bool ret = DETOUR_MEMBER_CALL(); auto player = reinterpret_cast(this); if (ret) { @@ -2761,7 +2761,7 @@ namespace Mod::Attr::Custom_Attributes } } - VHOOK_CALL(CUpgrades_StartTouch)(pOther); + VHOOK_CALL(pOther); } DETOUR_DECL_MEMBER(void, CUpgrades_UpgradeTouch, CBaseEntity *pOther) @@ -2778,7 +2778,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CUpgrades_UpgradeTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } DETOUR_DECL_MEMBER(void, CUpgrades_EndTouch, CBaseEntity *pOther) @@ -2799,7 +2799,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CUpgrades_EndTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } class WeaponModule : public EntityModule @@ -2947,7 +2947,7 @@ namespace Mod::Attr::Custom_Attributes SCOPED_INCREMENT(rc_CObjectSentrygun_FireRocket); sentry_gun_rocket = nullptr; - bool ret = DETOUR_MEMBER_CALL(CObjectSentrygun_FireRocket)(); + bool ret = DETOUR_MEMBER_CALL(); if (ret) { auto sentrygun = reinterpret_cast(this); CTFPlayer *owner = sentrygun->GetBuilder(); @@ -2967,7 +2967,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(bool, CBaseObject_CanBeUpgraded, CTFPlayer *player) { - bool ret = DETOUR_MEMBER_CALL(CBaseObject_CanBeUpgraded)(player); + bool ret = DETOUR_MEMBER_CALL(player); if (ret) { auto obj = reinterpret_cast(this); CTFPlayer *owner = obj->GetBuilder(); @@ -2992,14 +2992,14 @@ namespace Mod::Attr::Custom_Attributes return; } } - DETOUR_MEMBER_CALL(CBaseObject_StartUpgrading)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CObjectSentrygun_SentryThink) { auto obj = reinterpret_cast(this); CTFPlayer *owner = obj->GetBuilder(); - DETOUR_MEMBER_CALL(CObjectSentrygun_SentryThink)(); + DETOUR_MEMBER_CALL(); if (owner != nullptr) { int rapidTick = 0; if (GetBuildingAttributeInt<"rapidfire">(obj, "sentry_rapid_fire", false) != 0) { @@ -3026,7 +3026,7 @@ namespace Mod::Attr::Custom_Attributes } DETOUR_DECL_MEMBER(void, CBaseObject_StartBuilding, CBaseEntity *builder) { - DETOUR_MEMBER_CALL(CBaseObject_StartBuilding)(builder); + DETOUR_MEMBER_CALL(builder); auto obj = reinterpret_cast(this); CTFPlayer *owner = obj->GetBuilder(); if (owner != nullptr) { @@ -3036,7 +3036,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CBaseObject_StartPlacement, CTFPlayer *builder) { - DETOUR_MEMBER_CALL(CBaseObject_StartPlacement)(builder); + DETOUR_MEMBER_CALL(builder); auto obj = reinterpret_cast(this); if (builder != nullptr) { SetBuildingStuff(obj, builder); @@ -3050,7 +3050,7 @@ namespace Mod::Attr::Custom_Attributes return; Vector prepos = player->GetAbsOrigin(); - DETOUR_MEMBER_CALL(CObjectTeleporter_RecieveTeleportingPlayer)(player); + DETOUR_MEMBER_CALL(player); Vector postpos = player->GetAbsOrigin(); if (tele->GetModelScale() != 1.0f && prepos != postpos) { postpos.z = tele->WorldSpaceCenter().z + tele->CollisionProp()->OBBMaxs().z + 1.0f; @@ -3074,14 +3074,14 @@ namespace Mod::Attr::Custom_Attributes return true; } - return DETOUR_MEMBER_CALL(CTFGameRules_FPlayerCanTakeDamage)(pPlayer, pAttacker, info); + return DETOUR_MEMBER_CALL(pPlayer, pAttacker, info); } DETOUR_DECL_MEMBER(bool, CTFPlayer_WantsLagCompensationOnEntity, const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec *pEntityTransmitBits) { auto player = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFPlayer_WantsLagCompensationOnEntity)(pPlayer, pCmd, pEntityTransmitBits); + auto result = DETOUR_MEMBER_CALL(pPlayer, pCmd, pEntityTransmitBits); if (!result && player->GetTeamNumber() == pPlayer->GetTeamNumber()) { int friendly = HasAllowFriendlyFire(player->GetActiveWeapon(), player); @@ -3106,7 +3106,7 @@ namespace Mod::Attr::Custom_Attributes slowdown *= stun; } - DETOUR_MEMBER_CALL(CTFPlayerShared_StunPlayer)(duration, slowdown, flags, attacker); + DETOUR_MEMBER_CALL(duration, slowdown, flags, attacker); } struct gamevcollisionevent_t : public vcollisionevent_t @@ -3129,7 +3129,7 @@ namespace Mod::Attr::Custom_Attributes pEvent->pEntities[!index] = grenade_proj; } - DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_VPhysicsCollision)(index, pEvent); + DETOUR_MEMBER_CALL(index, pEvent); if (no_stick != 0) { pEvent->pEntities[!index] = hit_ent; @@ -3185,7 +3185,7 @@ namespace Mod::Attr::Custom_Attributes } hit_explode_direct = ent; - DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_PipebombTouch)(ent); + DETOUR_MEMBER_CALL(ent); hit_explode_direct = nullptr; } @@ -3198,14 +3198,14 @@ namespace Mod::Attr::Custom_Attributes return true; } - return DETOUR_STATIC_CALL(PropDynamic_CollidesWithGrenades)(ent); + return DETOUR_STATIC_CALL(ent); } RefCount rc_CTFPlayer_RegenThink; DETOUR_DECL_MEMBER(void, CTFPlayer_RegenThink) { SCOPED_INCREMENT(rc_CTFPlayer_RegenThink); - DETOUR_MEMBER_CALL(CTFPlayer_RegenThink)(); + DETOUR_MEMBER_CALL(); CTFPlayer *player = reinterpret_cast(this); @@ -3224,7 +3224,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(int, CTFPlayer_OnTakeDamage, CTakeDamageInfo &info) { player_taking_damage = reinterpret_cast(this); - int damage = DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(info); + int damage = DETOUR_MEMBER_CALL(info); player_taking_damage = nullptr; //Non sniper rifle explosive headshot @@ -3256,7 +3256,7 @@ namespace Mod::Attr::Custom_Attributes return true; } - return DETOUR_MEMBER_CALL(CSchemaAttributeType_Default_ConvertStringToEconAttributeValue)(pAttrDef, pszValue, out_pValue, floatforce); + return DETOUR_MEMBER_CALL(pAttrDef, pszValue, out_pValue, floatforce); } DETOUR_DECL_MEMBER(bool, static_attrib_t_BInitFromKV_SingleLine, const char *context, KeyValues *attribute, CUtlVector *errors, bool b) @@ -3265,7 +3265,7 @@ namespace Mod::Attr::Custom_Attributes attribute->SetName(attribute->GetName() + strlen("SET BONUS: ")); } - return DETOUR_MEMBER_CALL(static_attrib_t_BInitFromKV_SingleLine)(context, attribute, errors, b); + return DETOUR_MEMBER_CALL(context, attribute, errors, b); } std::vector> displacePlayers; @@ -3304,7 +3304,7 @@ namespace Mod::Attr::Custom_Attributes } } - return DETOUR_MEMBER_CALL(CTraceFilterObject_ShouldHitEntity)(pServerEntity, contentsMask); + return DETOUR_MEMBER_CALL(pServerEntity, contentsMask); } DETOUR_DECL_MEMBER(void, CTFPlayer_CancelTaunt) @@ -3314,7 +3314,7 @@ namespace Mod::Attr::Custom_Attributes if (iCancelTaunt != 0) { return; } - return DETOUR_MEMBER_CALL(CTFPlayer_CancelTaunt)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayer_IsAllowedToInitiateTauntWithPartner, CEconItemView *pEconItemView, char *pszErrorMessage, int cubErrorMessage) @@ -3324,7 +3324,7 @@ namespace Mod::Attr::Custom_Attributes if (iAllowTaunt != 0) { return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_IsAllowedToInitiateTauntWithPartner)( pEconItemView, pszErrorMessage, cubErrorMessage); + return DETOUR_MEMBER_CALL( pEconItemView, pszErrorMessage, cubErrorMessage); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_DeflectEntity, CBaseEntity *pTarget, CTFPlayer *pOwner, Vector &vecForward, Vector &vecCenter, Vector &vecSize) @@ -3346,7 +3346,7 @@ namespace Mod::Attr::Custom_Attributes return true; } } - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_DeflectEntity)(pTarget, pOwner, vecForward, vecCenter, vecSize); + auto result = DETOUR_MEMBER_CALL(pTarget, pOwner, vecForward, vecCenter, vecSize); if (result) { int deflectKeepTeam = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER ( weapon, deflectKeepTeam, reflect_keep_team ); @@ -3414,7 +3414,7 @@ namespace Mod::Attr::Custom_Attributes return str; } } - return DETOUR_MEMBER_CALL(CTFGameRules_GetKillingWeaponName)(info, pVictim, iWeaponID); + return DETOUR_MEMBER_CALL(info, pVictim, iWeaponID); } class PlayerTouchModule : public EntityModule @@ -3430,7 +3430,7 @@ namespace Mod::Attr::Custom_Attributes auto player = reinterpret_cast(this); if (toucher == nullptr || player == nullptr) return; - DETOUR_MEMBER_CALL(CTFPlayer_Touch)(toucher); + DETOUR_MEMBER_CALL(toucher); if (toucher->GetTeamNumber() == player->GetTeamNumber()) return; @@ -3495,7 +3495,7 @@ namespace Mod::Attr::Custom_Attributes } } } - DETOUR_MEMBER_CALL(CUpgrades_PlayerPurchasingUpgrade)(player, itemslot, upgradeslot, sell, free, refund); + DETOUR_MEMBER_CALL(player, itemslot, upgradeslot, sell, free, refund); if (!refund) { InspectAttributes(player, player , true, itemslot); @@ -3526,7 +3526,7 @@ namespace Mod::Attr::Custom_Attributes no_upgrade = attr != nullptr && attr->GetValuePtr()->m_Float > 0.0f; } SCOPED_INCREMENT_IF(rc_CTFPlayer_ReapplyItemUpgrades, no_upgrade); - DETOUR_MEMBER_CALL(CTFPlayer_ReapplyItemUpgrades)(item_view); + DETOUR_MEMBER_CALL(item_view); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, unsigned short, CUpgrades_ApplyUpgradeToItem, CTFPlayer* player, CEconItemView *item, int upgrade, int cost, bool downgrade, bool fresh) @@ -3536,7 +3536,7 @@ namespace Mod::Attr::Custom_Attributes return INVALID_ATTRIB_DEF_INDEX; } - return DETOUR_MEMBER_CALL(CUpgrades_ApplyUpgradeToItem)(player, item, upgrade, cost, downgrade, fresh); + return DETOUR_MEMBER_CALL(player, item, upgrade, cost, downgrade, fresh); } bool IsDeflectable(CBaseProjectile *proj) { @@ -3555,35 +3555,35 @@ namespace Mod::Attr::Custom_Attributes { auto ent = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(CTFProjectile_Rocket_IsDeflectable)() && IsDeflectable(ent); + return DETOUR_MEMBER_CALL() && IsDeflectable(ent); } DETOUR_DECL_MEMBER(bool, CTFProjectile_Arrow_IsDeflectable) { auto ent = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(CTFProjectile_Arrow_IsDeflectable)() && IsDeflectable(ent); + return DETOUR_MEMBER_CALL() && IsDeflectable(ent); } DETOUR_DECL_MEMBER(bool, CTFProjectile_Flare_IsDeflectable) { auto ent = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(CTFProjectile_Flare_IsDeflectable)() && IsDeflectable(ent); + return DETOUR_MEMBER_CALL() && IsDeflectable(ent); } DETOUR_DECL_MEMBER(bool, CTFProjectile_EnergyBall_IsDeflectable) { auto ent = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(CTFProjectile_EnergyBall_IsDeflectable)() && IsDeflectable(ent); + return DETOUR_MEMBER_CALL() && IsDeflectable(ent); } DETOUR_DECL_MEMBER(bool, CTFGrenadePipebombProjectile_IsDeflectable) { auto ent = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_IsDeflectable)() && IsDeflectable(ent); + return DETOUR_MEMBER_CALL() && IsDeflectable(ent); } DETOUR_DECL_MEMBER(int, CTFGrenadePipebombProjectile_OnTakeDamage, CTakeDamageInfo &info) @@ -3592,7 +3592,7 @@ namespace Mod::Attr::Custom_Attributes if (!IsDeflectable(ent)) { return 0; } - return DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } // Stop short circuit from deflecting the projectile @@ -3600,7 +3600,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFProjectile_MechanicalArmOrb_CheckForProjectiles) { SCOPED_INCREMENT(rc_CTFProjectile_MechanicalArmOrb_CheckForProjectiles); - DETOUR_MEMBER_CALL(CTFProjectile_MechanicalArmOrb_CheckForProjectiles)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFProjectile_Arrow_ArrowTouch; @@ -3625,12 +3625,12 @@ namespace Mod::Attr::Custom_Attributes } }*/ - return DETOUR_MEMBER_CALL(CBaseEntity_InSameTeam)(other); + return DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_OnAddBalloonHead) { - DETOUR_MEMBER_CALL(CTFPlayerShared_OnAddBalloonHead)(); + DETOUR_MEMBER_CALL(); CTFPlayer *player = reinterpret_cast(this)->GetOuter(); float gravity = 0.0f; @@ -3642,7 +3642,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFWeaponBase_ApplyOnHitAttributes, CBaseEntity *ent, CTFPlayer *player, const CTakeDamageInfo& info) { - DETOUR_MEMBER_CALL(CTFWeaponBase_ApplyOnHitAttributes)(ent, player, info); + DETOUR_MEMBER_CALL(ent, player, info); if (ent != nullptr) ApplyOnHitAttributes(reinterpret_cast(this), ent, player, info); } @@ -3653,7 +3653,7 @@ namespace Mod::Attr::Custom_Attributes //DevMsg("sentry deploy %d %d\n", sentry->m_bCarryDeploy + 0, sentry->m_bCarried + 0); if (sentry->m_bCarried) return; - DETOUR_MEMBER_CALL(CObjectSentrygun_MakeScaledBuilding)(player); + DETOUR_MEMBER_CALL(player); } @@ -3672,7 +3672,7 @@ namespace Mod::Attr::Custom_Attributes tele->m_iTeleportType = 1; restore = true; } - DETOUR_MEMBER_CALL(CObjectTeleporter_TeleporterTouch)(player); + DETOUR_MEMBER_CALL(player); if (restore) { tele->m_iTeleportType = 2; } @@ -3682,14 +3682,14 @@ namespace Mod::Attr::Custom_Attributes { auto weapon = reinterpret_cast(this); - float range = DETOUR_MEMBER_CALL(CWeaponMedigun_GetTargetRange)(); + float range = DETOUR_MEMBER_CALL(); CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(weapon, range, mult_medigun_range); return range; } DETOUR_DECL_MEMBER(bool, CTFBotTacticalMonitor_ShouldOpportunisticallyTeleport, CTFPlayer *bot) { - bool result = DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_ShouldOpportunisticallyTeleport)(bot); + bool result = DETOUR_MEMBER_CALL(bot); if (result) { int iCannotTeleport = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(bot, iCannotTeleport, cannot_be_teleported); @@ -3725,7 +3725,7 @@ namespace Mod::Attr::Custom_Attributes } SCOPED_INCREMENT(rc_CTFProjectile_Arrow_ArrowTouch); - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_ArrowTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); if (pOther->IsAlive() && pOther->GetTeamNumber() != arrow->GetTeamNumber() && pOther->MyCombatCharacterPointer() != nullptr) { float snapRadius = 0; @@ -3810,7 +3810,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFProjectile_Arrow_CreateTrail) { auto arrow = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_CreateTrail)(); + DETOUR_MEMBER_CALL(); THINK_FUNC_SET(arrow, UpdateArrowTrail, gpGlobals->curtime+0.01f); } @@ -3821,7 +3821,7 @@ namespace Mod::Attr::Custom_Attributes return 0; int healthpre = ent->GetHealth(); //DevMsg("Applytoentity damage %f %d\n", info->m_DmgInfo->GetDamage(), ent->CollisionProp()->IsPointInBounds(info->m_vecOrigin)); - auto result = DETOUR_MEMBER_CALL(CTFRadiusDamageInfo_ApplyToEntity)(ent); + auto result = DETOUR_MEMBER_CALL(ent); if (ent->GetHealth() != healthpre) { hit_entities_explosive++; } @@ -3840,7 +3840,7 @@ namespace Mod::Attr::Custom_Attributes { auto flamemgr = reinterpret_cast(this); - bool ret = DETOUR_MEMBER_CALL(CTFFlameManager_BCanBurnEntityThisFrame)(entity); + bool ret = DETOUR_MEMBER_CALL(entity); if (ret) { int iMaxAoe = GetFastAttributeInt(flamemgr->GetOwnerEntity(), 0, MAX_AOE_TARGETS); if (iMaxAoe != 0) { @@ -3866,12 +3866,12 @@ namespace Mod::Attr::Custom_Attributes auto arrow = reinterpret_cast(this); if (pOther == nullptr) { - DETOUR_MEMBER_CALL(CTFProjectile_BallOfFire_RocketTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); return; } int health_pre = pOther->GetHealth(); - DETOUR_MEMBER_CALL(CTFProjectile_BallOfFire_RocketTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); if (pOther != arrow && health_pre != pOther->GetHealth()) { int &counter = arrow->GetOrCreateEntityModule("penetrationnumber")->penetrationCount; @@ -3890,13 +3890,13 @@ namespace Mod::Attr::Custom_Attributes auto arrow = reinterpret_cast(this); if (pOther == nullptr) { - DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_ProjectileTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); return; } int health_pre = pOther->GetHealth(); bison_projectile_touch = pOther->GetTeamNumber() == arrow->GetTeamNumber() && gpGlobals->tickcount % 2 == 0; - DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_ProjectileTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); bison_projectile_touch = false; if (pOther != arrow && health_pre != pOther->GetHealth()) { @@ -3916,7 +3916,7 @@ namespace Mod::Attr::Custom_Attributes bison_projectile_touch = false; return false; } - return DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_ShouldPenetrate)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayerShared_CanRecieveMedigunChargeEffect, int eType) @@ -3928,7 +3928,7 @@ namespace Mod::Attr::Custom_Attributes return false; } - return DETOUR_MEMBER_CALL(CTFPlayerShared_CanRecieveMedigunChargeEffect)(eType); + return DETOUR_MEMBER_CALL(eType); } RefCount rc_CWeaponMedigun_StartHealingTarget; @@ -3967,7 +3967,7 @@ namespace Mod::Attr::Custom_Attributes auto mod = player->GetEntityModule("addcondimmunity"); if (mod != nullptr && std::find(mod->conds.begin(), mod->conds.end(), (int) nCond) != mod->conds.end()) return; - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond2)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_AddCond, ETFCond nCond, float flDuration, CBaseEntity *pProvider) @@ -3985,14 +3985,14 @@ namespace Mod::Attr::Custom_Attributes if (rc_CTFPlayerShared_AddCond) { - if (addcond_specific_cond != TF_COND_INVALID && addcond_specific_cond != nCond) return DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + if (addcond_specific_cond != TF_COND_INVALID && addcond_specific_cond != nCond) return DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); if (aoe_in_sphere_max_hit_count != 0 && ++aoe_in_sphere_hit_count > aoe_in_sphere_max_hit_count) { return; } // If one condition was added due to another condition, ignore it - if (rc_CTFPlayerShared_AddCondIn > 1) return DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + if (rc_CTFPlayerShared_AddCondIn > 1) return DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); auto attribProvider = addcond_provider_item != nullptr ? addcond_provider_item : addcond_provider; addcond_overridden = false; @@ -4008,7 +4008,7 @@ namespace Mod::Attr::Custom_Attributes //DevMsg("add cond post %d\n", addcond); if (addcond != 0) { addcond_overridden = true; - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)((ETFCond) addcond, flDuration, pProvider); + DETOUR_MEMBER_CALL((ETFCond) addcond, flDuration, pProvider); } } @@ -4042,7 +4042,7 @@ namespace Mod::Attr::Custom_Attributes } if (iCondOverride != 0) return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_RemoveCond, ETFCond nCond, bool bool1) @@ -4051,7 +4051,7 @@ namespace Mod::Attr::Custom_Attributes if (rc_CTFPlayerShared_RemoveCond) { - if (addcond_specific_cond != TF_COND_INVALID && addcond_specific_cond != nCond) return DETOUR_MEMBER_CALL(CTFPlayerShared_RemoveCond)(nCond, bool1); + if (addcond_specific_cond != TF_COND_INVALID && addcond_specific_cond != nCond) return DETOUR_MEMBER_CALL(nCond, bool1); auto attribProvider = addcond_provider_item != nullptr ? addcond_provider_item : addcond_provider; CTFPlayer *player = reinterpret_cast(this)->GetOuter(); @@ -4065,7 +4065,7 @@ namespace Mod::Attr::Custom_Attributes int addcond = (iCondOverride >> (i * 8)) & 255; if (addcond != 0) { nCond = (ETFCond) addcond; - DETOUR_MEMBER_CALL(CTFPlayerShared_RemoveCond)(nCond, bool1); + DETOUR_MEMBER_CALL(nCond, bool1); addcond_overridden = true; } } @@ -4095,14 +4095,14 @@ namespace Mod::Attr::Custom_Attributes } if (iCondOverride != 0) return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_RemoveCond)(nCond, bool1); + DETOUR_MEMBER_CALL(nCond, bool1); } DETOUR_DECL_MEMBER(bool, CTFPlayerShared_InCond, ETFCond nCond) { return false; // if (rc_CTFPlayerShared_InCond) { - // if (rc_CTFPlayerShared_AddCondWatch && nCond != TF_COND_STEALTHED) return DETOUR_MEMBER_CALL(CTFPlayerShared_InCond)(nCond); + // if (rc_CTFPlayerShared_AddCondWatch && nCond != TF_COND_STEALTHED) return DETOUR_MEMBER_CALL(nCond); // auto attribProvider = addcond_provider_item != nullptr ? addcond_provider_item : addcond_provider; // int iCondOverride = 0; @@ -4114,13 +4114,13 @@ namespace Mod::Attr::Custom_Attributes // int addcond = (iCondOverride >> (i * 8)) & 255; // if (addcond != 0) { // nCond = (ETFCond) addcond; - // if (DETOUR_MEMBER_CALL(CTFPlayerShared_InCond)(nCond)) return true; + // if (DETOUR_MEMBER_CALL(nCond)) return true; // } // } // return false; // } // } - // return DETOUR_MEMBER_CALL(CTFPlayerShared_InCond)(nCond); + // return DETOUR_MEMBER_CALL(nCond); } RefCount rc_ReplaceCond; @@ -4186,7 +4186,7 @@ namespace Mod::Attr::Custom_Attributes ReplaceCond(wep->GetTFPlayerOwner()->m_Shared.Get(), TF_COND_STEALTHED); addcond_specific_cond = TF_COND_STEALTHED; - auto result = DETOUR_MEMBER_CALL(CTFWeaponInvis_ActivateInvisibilityWatch)(); + auto result = DETOUR_MEMBER_CALL(); addcond_specific_cond = TF_COND_INVALID; ReplaceBackCond(wep->GetTFPlayerOwner()->m_Shared.Get(), TF_COND_STEALTHED); if (result && iCondOverride != 0) { @@ -4216,7 +4216,7 @@ namespace Mod::Attr::Custom_Attributes } ReplaceCond(*me, TF_COND_STEALTHED); addcond_specific_cond = TF_COND_STEALTHED; - DETOUR_MEMBER_CALL(CTFPlayerShared_FadeInvis)(mult); + DETOUR_MEMBER_CALL(mult); addcond_specific_cond = TF_COND_INVALID; ReplaceBackCond(*me, TF_COND_STEALTHED); } @@ -4240,7 +4240,7 @@ namespace Mod::Attr::Custom_Attributes ReplaceCond(*me, TF_COND_STEALTHED); } addcond_specific_cond = TF_COND_STEALTHED; - DETOUR_MEMBER_CALL(CTFPlayerShared_UpdateCloakMeter)(); + DETOUR_MEMBER_CALL(); addcond_specific_cond = TF_COND_INVALID; if (isSpy) { ReplaceBackCond(*me, TF_COND_STEALTHED); @@ -4255,7 +4255,7 @@ namespace Mod::Attr::Custom_Attributes addcond_provider_item = wep; ReplaceCond(wep->GetTFPlayerOwner()->m_Shared.Get(), TF_COND_STEALTHED); - DETOUR_MEMBER_CALL(CTFWeaponInvis_CleanupInvisibilityWatch)(); + DETOUR_MEMBER_CALL(); ReplaceBackCond(wep->GetTFPlayerOwner()->m_Shared.Get(), TF_COND_STEALTHED); } @@ -4267,7 +4267,7 @@ namespace Mod::Attr::Custom_Attributes addcond_provider = me; addcond_provider_item = GetEconEntityAtLoadoutSlot(me, LOADOUT_POSITION_PDA2); ReplaceCond(me->m_Shared.Get(), TF_COND_STEALTHED); - DETOUR_MEMBER_CALL(CTFPlayer_SpyDeadRingerDeath)(info); + DETOUR_MEMBER_CALL(info); ReplaceBackCond(me->m_Shared.Get(), TF_COND_STEALTHED); } @@ -4280,7 +4280,7 @@ namespace Mod::Attr::Custom_Attributes CALL_ATTRIB_HOOK_INT_ON_OTHER(GetEconEntityAtLoadoutSlot(player, LOADOUT_POSITION_PRIMARY), primaryHasRage, set_buff_type); addcond_provider_item = GetEconEntityAtLoadoutSlot(player, primaryHasRage != 0 ? LOADOUT_POSITION_PRIMARY : LOADOUT_POSITION_SECONDARY); - DETOUR_MEMBER_CALL(CTFPlayerShared_PulseRageBuff)(rage); + DETOUR_MEMBER_CALL(rage); } DETOUR_DECL_MEMBER(void, CTFPlayer_DoTauntAttack) @@ -4300,7 +4300,7 @@ namespace Mod::Attr::Custom_Attributes player->m_Shared->m_nPlayerCond |= 1 << TF_COND_TAUNTING; } - DETOUR_MEMBER_CALL(CTFPlayer_DoTauntAttack)(); + DETOUR_MEMBER_CALL(); if (removeTauntAfter) { player->m_Shared->m_nPlayerCond &= ~(1 << TF_COND_TAUNTING); @@ -4327,7 +4327,7 @@ namespace Mod::Attr::Custom_Attributes return; } - DETOUR_MEMBER_CALL(CTFPlayer_ClearTauntAttack)(); + DETOUR_MEMBER_CALL(); } #define WEAPON_USE_DETOUR \ @@ -4352,7 +4352,7 @@ namespace Mod::Attr::Custom_Attributes ReplaceCond(*reinterpret_cast(this), TF_COND_SODAPOPPER_HYPE); } addcond_specific_cond = TF_COND_SODAPOPPER_HYPE; - DETOUR_MEMBER_CALL(CTFPlayerShared_UpdateEnergyDrinkMeter)(); + DETOUR_MEMBER_CALL(); addcond_specific_cond = TF_COND_INVALID; if (addcond_provider_item != nullptr) { ReplaceBackCond(*reinterpret_cast(this), TF_COND_SODAPOPPER_HYPE); @@ -4368,7 +4368,7 @@ namespace Mod::Attr::Custom_Attributes if (addcond_provider_item != nullptr) { ReplaceCond(*reinterpret_cast(this), TF_COND_SODAPOPPER_HYPE); } - DETOUR_MEMBER_CALL(CTFPlayerShared_SetScoutHypeMeter)(meter); + DETOUR_MEMBER_CALL(meter); if (addcond_provider_item != nullptr) { ReplaceBackCond(*reinterpret_cast(this), TF_COND_SODAPOPPER_HYPE); } @@ -4379,7 +4379,7 @@ namespace Mod::Attr::Custom_Attributes WEAPON_USE_DETOUR auto wep = reinterpret_cast(this); ReplaceCond(wep->GetTFPlayerOwner()->m_Shared.Get(), TF_COND_SODAPOPPER_HYPE); - DETOUR_MEMBER_CALL(CTFSodaPopper_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); ReplaceBackCond(wep->GetTFPlayerOwner()->m_Shared.Get(), TF_COND_SODAPOPPER_HYPE); } @@ -4407,14 +4407,14 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_STATIC_CALL(JarExplode)(iEntIndex, pAttacker, pOriginalWeapon, pWeapon, vContactPoint, iTeam, flRadius, cond, flDuration, pszImpactEffect, text2); + DETOUR_STATIC_CALL(iEntIndex, pAttacker, pOriginalWeapon, pWeapon, vContactPoint, iTeam, flRadius, cond, flDuration, pszImpactEffect, text2); aoe_in_sphere_max_hit_count = 0; } DETOUR_DECL_MEMBER(void, CTFGasManager_OnCollide, CBaseEntity *entity, int id ) { SCOPED_INCREMENT(rc_CTFPlayerShared_AddCond); addcond_provider_item = addcond_provider = reinterpret_cast(this)->GetOwnerEntity(); - DETOUR_MEMBER_CALL(CTFGasManager_OnCollide)(entity, id); + DETOUR_MEMBER_CALL(entity, id); } struct MedigunEffects_t @@ -4473,7 +4473,7 @@ namespace Mod::Attr::Custom_Attributes effects.eCondition = (ETFCond) (iCondOverride & 255); effects.eWearingOffCondition = (ETFCond) GetNumberOfTFConds(); } - DETOUR_MEMBER_CALL(CTFPlayerShared_SetChargeEffect)(iCharge, bState, bInstant, effects, flWearOffTime, pProvider); + DETOUR_MEMBER_CALL(iCharge, bState, bInstant, effects, flWearOffTime, pProvider); if (iCondOverride != 0) { effects.eCondition = old_cond; effects.eWearingOffCondition = old_wearing_cond; @@ -4485,7 +4485,7 @@ namespace Mod::Attr::Custom_Attributes SCOPED_INCREMENT(rc_CTFPlayerShared_AddCond); addcond_provider = reinterpret_cast(this)->GetOuter(); addcond_provider_item = GetEconEntityAtLoadoutSlot(reinterpret_cast(this)->GetOuter(), LOADOUT_POSITION_MELEE); - DETOUR_MEMBER_CALL(CTFPlayerShared_PulseMedicRadiusHeal)(); + DETOUR_MEMBER_CALL(); } GlobalThunk g_MedigunEffects("g_MedigunEffects"); @@ -4523,7 +4523,7 @@ namespace Mod::Attr::Custom_Attributes effect.eWearingOffCondition = (ETFCond) GetNumberOfTFConds(); } - DETOUR_MEMBER_CALL(CTFPlayerShared_TestAndExpireChargeEffect)(type); + DETOUR_MEMBER_CALL(type); if (mod != nullptr && mod->condOverride[type] != -1) { auto weapon = rtti_cast(mod->condOverrideProvider[type].Get()); auto condOverride = mod->condOverride[type]; @@ -4557,7 +4557,7 @@ namespace Mod::Attr::Custom_Attributes SCOPED_INCREMENT(rc_CTFPlayerShared_RemoveCond); addcond_provider = reinterpret_cast(this)->GetOuter(); addcond_provider_item = reinterpret_cast(this)->GetOuter()->GetActiveWeapon(); - DETOUR_MEMBER_CALL(CTFPlayerShared_SetRevengeCrits)(crits); + DETOUR_MEMBER_CALL(crits); } DETOUR_DECL_MEMBER(void, CTFWearableDemoShield_DoCharge, CTFPlayer *player) @@ -4566,7 +4566,7 @@ namespace Mod::Attr::Custom_Attributes addcond_provider = player; addcond_provider_item = reinterpret_cast(this); addcond_overridden = false; - DETOUR_MEMBER_CALL(CTFWearableDemoShield_DoCharge)(player); + DETOUR_MEMBER_CALL(player); if (addcond_overridden) { player->m_Shared->m_flChargeMeter = 0; } @@ -4581,49 +4581,49 @@ namespace Mod::Attr::Custom_Attributes CALL_ATTRIB_HOOK_INT_ON_OTHER(addcond_provider_item, iCondOverride, effect_cond_override); SCOPED_INCREMENT_IF(rc_stop_stun, iCondOverride != 0); - DETOUR_MEMBER_CALL(CObjectSapper_ApplyRoboSapperEffects_Last)(target, duration); + DETOUR_MEMBER_CALL(target, duration); } DETOUR_DECL_MEMBER(bool, CTFFlareGun_Revenge_Holster, CBaseCombatWeapon *weapon) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFFlareGun_Revenge_Holster)(weapon); + return DETOUR_MEMBER_CALL(weapon); } DETOUR_DECL_MEMBER(bool, CTFShotgun_Revenge_Holster, CBaseCombatWeapon *weapon) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFShotgun_Revenge_Holster)(weapon); + return DETOUR_MEMBER_CALL(weapon); } DETOUR_DECL_MEMBER(bool, CTFRevolver_Holster, CBaseCombatWeapon *weapon) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFRevolver_Holster)(weapon); + return DETOUR_MEMBER_CALL(weapon); } DETOUR_DECL_MEMBER(bool, CTFFlareGun_Revenge_Deploy) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFFlareGun_Revenge_Deploy)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFShotgun_Revenge_Deploy) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFShotgun_Revenge_Deploy)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFRevolver_Deploy) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFRevolver_Deploy)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFChargedSMG_SecondaryAttack) { WEAPON_USE_DETOUR - return DETOUR_MEMBER_CALL(CTFChargedSMG_SecondaryAttack)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_AllowOverheal; @@ -4691,12 +4691,12 @@ namespace Mod::Attr::Custom_Attributes SCOPED_INCREMENT_IF(rc_AllowOverheal, overheal_allow != 0); - DETOUR_MEMBER_CALL(CTFPlayer_OnKilledOther_Effects)(other, info); + DETOUR_MEMBER_CALL(other, info); } DETOUR_DECL_MEMBER(float, CTFPlayer_TeamFortress_CalculateMaxSpeed, bool flag) { - float ret = DETOUR_MEMBER_CALL(CTFPlayer_TeamFortress_CalculateMaxSpeed)(flag); + float ret = DETOUR_MEMBER_CALL(flag); CTFPlayer *player = reinterpret_cast(this); if (player->HasTheFlag()) @@ -4721,7 +4721,7 @@ namespace Mod::Attr::Custom_Attributes { aoe_in_sphere_max_hit_count = GetFastAttributeInt(reinterpret_cast(this), 0, MAX_AOE_TARGETS); aoe_in_sphere_hit_count = 0; - DETOUR_MEMBER_CALL(CTFSniperRifle_ExplosiveHeadShot)(player1, player2); + DETOUR_MEMBER_CALL(player1, player2); aoe_in_sphere_max_hit_count = 0; } @@ -4743,7 +4743,7 @@ namespace Mod::Attr::Custom_Attributes if (multDmg != 1.0f) { bleeddmg = (bleeddmg * multDmg); } - DETOUR_MEMBER_CALL(CTFPlayerShared_MakeBleed)(attacker, weapon, bleedTime, bleeddmg, perm, val); + DETOUR_MEMBER_CALL(attacker, weapon, bleedTime, bleeddmg, perm, val); } void RemoveOnActiveAttributes(CEconEntity *weapon, const char *attributes) @@ -4861,7 +4861,7 @@ namespace Mod::Attr::Custom_Attributes info.SetWeapon(sentry->GetBuilder()->GetEntityForLoadoutSlot(LOADOUT_POSITION_PDA)); } - int damage = DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + int damage = DETOUR_MEMBER_CALL(info); CBaseProjectile *proj; if (entity->m_takedamage == DAMAGE_YES && entity->GetCustomVariableBool<"takesdamage">() && (proj = rtti_cast(entity)) != nullptr) { @@ -4932,7 +4932,7 @@ namespace Mod::Attr::Custom_Attributes if (sentry != nullptr && sentry->GetBuilder() != nullptr && info.GetWeapon() == sentry->GetBuilder()->GetEntityForLoadoutSlot(LOADOUT_POSITION_PDA)) { infoc.SetWeapon(nullptr); } - DETOUR_MEMBER_CALL(CTFGameRules_DeathNotice)(pVictim, infoc, eventName); + DETOUR_MEMBER_CALL(pVictim, infoc, eventName); } DETOUR_DECL_MEMBER(int, CTFPlayerShared_GetMaxBuffedHealth, bool flag1, bool flag2) @@ -4942,7 +4942,7 @@ namespace Mod::Attr::Custom_Attributes float value = old_value; value *= GetFastAttributeFloat(reinterpret_cast(this)->GetOuter(), 1.0f, MULT_MAX_OVERHEAL_SELF); - auto ret = DETOUR_MEMBER_CALL(CTFPlayerShared_GetMaxBuffedHealth)(flag1, flag2); + auto ret = DETOUR_MEMBER_CALL(flag1, flag2); if (value != old_value) tf_max_health_boost.SetValue(old_value); @@ -4955,21 +4955,21 @@ namespace Mod::Attr::Custom_Attributes bitsDamageType |= DMG_IGNORE_MAXHEALTH; } - return DETOUR_MEMBER_CALL(CTFPlayer_TakeHealth)(flHealth, bitsDamageType); + return DETOUR_MEMBER_CALL(flHealth, bitsDamageType); } CObjectDispenser *dispenser_provider = nullptr; DETOUR_DECL_MEMBER(bool, CObjectDispenser_DispenseAmmo, CTFPlayer *player) { dispenser_provider = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(CObjectDispenser_DispenseAmmo)(player); + return DETOUR_MEMBER_CALL(player); dispenser_provider = nullptr; } DETOUR_DECL_MEMBER(int, CObjectDispenser_DispenseMetal, CTFPlayer *player) { dispenser_provider = reinterpret_cast(this); - auto ret = DETOUR_MEMBER_CALL(CObjectDispenser_DispenseMetal)(player); + auto ret = DETOUR_MEMBER_CALL(player); dispenser_provider = nullptr; return ret; } @@ -4983,7 +4983,7 @@ namespace Mod::Attr::Custom_Attributes if (dispenser_provider != nullptr && type != TF_AMMO_METAL) { amount *= GetBuildingAttributeFloat<"ratemult">(dispenser_provider, "mult_dispenser_rate", true); } - return DETOUR_MEMBER_CALL(CTFPlayer_GiveAmmo)(amount, type, sound, source); + return DETOUR_MEMBER_CALL(amount, type, sound, source); } struct StickInfo @@ -5023,7 +5023,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_StickybombTouch)(other); + DETOUR_MEMBER_CALL(other); } @@ -5037,7 +5037,7 @@ namespace Mod::Attr::Custom_Attributes moneymaker = ToTFPlayer(killer_weapon->GetOwnerEntity()); } } - DETOUR_MEMBER_CALL(CTFPlayer_DropCurrencyPack)(pack, amount, forcedistribute, moneymaker); + DETOUR_MEMBER_CALL(pack, amount, forcedistribute, moneymaker); } @@ -5056,7 +5056,7 @@ namespace Mod::Attr::Custom_Attributes } } - return DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_GetMinTimeWhenPlayerMaySpawn)(player); + return DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(bool, CTFPlayer_ShouldGainInstantSpawn) @@ -5070,7 +5070,7 @@ namespace Mod::Attr::Custom_Attributes return false; } } - return DETOUR_MEMBER_CALL(CTFPlayer_ShouldGainInstantSpawn)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayer_IsReadyToSpawn) @@ -5084,12 +5084,12 @@ namespace Mod::Attr::Custom_Attributes return false; } } - return DETOUR_MEMBER_CALL(CTFPlayer_IsReadyToSpawn)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFGameRules_OnPlayerSpawned, CTFPlayer *player) { - DETOUR_MEMBER_CALL(CTFGameRules_OnPlayerSpawned)(player); + DETOUR_MEMBER_CALL(player); for (size_t i = 0; i < stick_info.size(); ) { auto &entry = stick_info[i]; if (entry.sticked == player && entry.sticky != nullptr) { @@ -5134,7 +5134,7 @@ namespace Mod::Attr::Custom_Attributes minigun->EmitSound(str); } } - DETOUR_MEMBER_CALL(CTFMinigun_WindDown)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFMinigun_WindUp) @@ -5147,7 +5147,7 @@ namespace Mod::Attr::Custom_Attributes minigun->EmitSound(str); } } - DETOUR_MEMBER_CALL(CTFMinigun_WindUp)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_DropAmmoPack, const CTakeDamageInfo& info, bool b1, bool b2) @@ -5166,7 +5166,7 @@ namespace Mod::Attr::Custom_Attributes dropped->InitDroppedWeapon(player, static_cast(weapon), info.GetAttacker() != nullptr && info.GetAttacker()->GetTeamNumber() == player->GetTeamNumber(), false); } } - DETOUR_MEMBER_CALL(CTFPlayer_DropAmmoPack)(info, b1, b2); + DETOUR_MEMBER_CALL(info, b1, b2); } DETOUR_DECL_STATIC(CTFDroppedWeapon *, CTFDroppedWeapon_Create, CTFPlayer *pOwner, const Vector& vecOrigin, const QAngle& vecAngles, const char *pszModelName, const CEconItemView *pItemView) @@ -5178,7 +5178,7 @@ namespace Mod::Attr::Custom_Attributes pszModelName = model; } } - auto wep = DETOUR_STATIC_CALL(CTFDroppedWeapon_Create)(pOwner, vecOrigin, vecAngles, pszModelName, pItemView); + auto wep = DETOUR_STATIC_CALL(pOwner, vecOrigin, vecAngles, pszModelName, pItemView); if (wep != nullptr && StringStartsWith(pItemView->GetItemDefinition()->GetItemClass(""), "tf_weapon_medigun")) { wep->m_nBody = 1; } @@ -5194,7 +5194,7 @@ namespace Mod::Attr::Custom_Attributes int noRegenerate = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(player, noRegenerate, no_resupply); if (!noRegenerate) { - DETOUR_MEMBER_CALL(CTFPlayer_Regenerate)(ammo); + DETOUR_MEMBER_CALL(ammo); } } bool CTFPlayer_ItemsMatch_Func(bool ret, CTFPlayer *player, CEconItemView *pCurWeaponItem, CEconItemView *pNewWeaponItem, CTFWeaponBase *pWpnEntity) { @@ -5222,7 +5222,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CTFPlayer_ItemsMatch, CEconItemView *pCurWeaponItem, CEconItemView *pNewWeaponItem, CTFWeaponBase *pWpnEntity) { - return CTFPlayer_ItemsMatch_Func(DETOUR_MEMBER_CALL(CTFPlayer_ItemsMatch)(pCurWeaponItem, pNewWeaponItem, pWpnEntity), reinterpret_cast(this), pCurWeaponItem, pNewWeaponItem, pWpnEntity); + return CTFPlayer_ItemsMatch_Func(DETOUR_MEMBER_CALL(pCurWeaponItem, pNewWeaponItem, pWpnEntity), reinterpret_cast(this), pCurWeaponItem, pNewWeaponItem, pWpnEntity); } THINK_FUNC_DECL(MinigunClearSounds) @@ -5269,7 +5269,7 @@ namespace Mod::Attr::Custom_Attributes } } } - DETOUR_MEMBER_CALL(CTFMinigun_SetWeaponState)(state); + DETOUR_MEMBER_CALL(state); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CTFFlameThrower_SetWeaponState, int state) @@ -5288,14 +5288,14 @@ namespace Mod::Attr::Custom_Attributes THINK_FUNC_SET(flamethrower, FlameThrowerClearSounds, gpGlobals->curtime); } } - DETOUR_MEMBER_CALL(CTFFlameThrower_SetWeaponState)(state); + DETOUR_MEMBER_CALL(state); } DETOUR_DECL_MEMBER(void, CTFProjectile_Arrow_FadeOut, int time) { auto arrow = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_FadeOut)(time); + DETOUR_MEMBER_CALL(time); float remove = 0; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(arrow->GetOriginalLauncher(), remove, arrow_hit_kill_time); if (remove != 0) { @@ -5315,7 +5315,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_CheckSkyboxImpact)(pOther); + DETOUR_MEMBER_CALL(pOther); } DETOUR_DECL_MEMBER(void, CTFProjectile_Arrow_BreakArrow) @@ -5329,14 +5329,14 @@ namespace Mod::Attr::Custom_Attributes CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(arrow->GetOriginalLauncher(), target_bounce_speed, arrow_target_bounce_speed); if (target_bounce_speed != 0) return; - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_BreakArrow)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CTFPlayerShared_CalculateObjectCost, CTFPlayer *builder, int object) { auto shared = reinterpret_cast(this); - int result = DETOUR_MEMBER_CALL(CTFPlayerShared_CalculateObjectCost)(builder, object); + int result = DETOUR_MEMBER_CALL(builder, object); if (object == OBJ_SENTRYGUN) { float sentry_cost = 1.0f; @@ -5359,7 +5359,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(ETFDmgCustom, CTFWeaponBase_GetPenetrateType) { - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_GetPenetrateType)(); + auto result = DETOUR_MEMBER_CALL(); if (result == TF_DMG_CUSTOM_NONE) { int penetrate = 0; @@ -5384,7 +5384,7 @@ namespace Mod::Attr::Custom_Attributes return 0.0f; } - return DETOUR_MEMBER_CALL(CBaseProjectile_GetCollideWithTeammatesDelay)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_TFPlayerThink) @@ -5395,13 +5395,13 @@ namespace Mod::Attr::Custom_Attributes player->m_Local->m_flStepSize = GetFastAttributeFloat(player, stepsize.GetFloat(), MULT_STEP_HEIGHT); } - DETOUR_MEMBER_CALL(CTFPlayer_TFPlayerThink)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(unsigned int, CTFGameMovement_PlayerSolidMask, bool brushonly) { CBasePlayer *player = reinterpret_cast(this)->player; - unsigned int mask = DETOUR_MEMBER_CALL(CTFGameMovement_PlayerSolidMask)(brushonly); + unsigned int mask = DETOUR_MEMBER_CALL(brushonly); if (GetFastAttributeInt(player, 0, IGNORE_PLAYER_CLIP) != 0) mask &= ~CONTENTS_PLAYERCLIP; @@ -5419,13 +5419,13 @@ namespace Mod::Attr::Custom_Attributes ){ cmd->buttons &= ~IN_JUMP; } - DETOUR_MEMBER_CALL(CTFPlayer_PlayerRunCommand)(cmd, moveHelper); + DETOUR_MEMBER_CALL(cmd, moveHelper); } DETOUR_DECL_MEMBER(void, CTFGameMovement_PreventBunnyJumping) { if(GetFastAttributeInt(reinterpret_cast(this)->player, 0, ALLOW_BUNNY_HOP) == 0){ - DETOUR_MEMBER_CALL(CTFGameMovement_PreventBunnyJumping)(); + DETOUR_MEMBER_CALL(); } } @@ -5441,7 +5441,7 @@ namespace Mod::Attr::Custom_Attributes weapon->m_bReloadsSingly = false; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_Reload)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_Holster) @@ -5473,7 +5473,7 @@ namespace Mod::Attr::Custom_Attributes RemoveOnActiveAttributes(weapon, attributes); } weapon->GetOrCreateEntityModule("weapon")->consecutiveShotsScore = 0.0f; - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_Holster)(); + auto result = DETOUR_MEMBER_CALL(); if (GetFastAttributeInt(weapon, 0, PASSIVE_RELOAD) != 0) { weapon->m_bInReload = true; } @@ -5494,7 +5494,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFWeaponBase_ItemHolsterFrame) { - DETOUR_MEMBER_CALL(CTFWeaponBase_ItemHolsterFrame)(); + DETOUR_MEMBER_CALL(); auto weapon = reinterpret_cast(this); if (weapon->GetMaxClip1() != -1 && GetFastAttributeInt(weapon, 0, PASSIVE_RELOAD) != 0) { @@ -5512,7 +5512,7 @@ namespace Mod::Attr::Custom_Attributes projectile->StopSound(sound); } } - DETOUR_MEMBER_CALL(CBaseProjectile_D2)(); + DETOUR_MEMBER_CALL(); } std::map, float> applyGunDelay; @@ -5528,7 +5528,7 @@ namespace Mod::Attr::Custom_Attributes // g_RecipientFilterPredictionSystem.GetRef().m_pSuppressHost = nullptr; //} - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_PrimaryAttack)(); + DETOUR_MEMBER_CALL(); if (weapon->m_flNextPrimaryAttack > gpGlobals->curtime) { float attackTime = weapon->m_flNextPrimaryAttack - gpGlobals->curtime; mod->consecutiveShotsScore += (weapon->m_flNextPrimaryAttack - gpGlobals->curtime); @@ -5609,7 +5609,7 @@ namespace Mod::Attr::Custom_Attributes it++; } } - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); if (!applyGunDelay.empty()) { for (auto it = applyGunDelay.begin(); it != applyGunDelay.end(); it++) { it->first->m_flNextPrimaryAttack = it->first->GetOrCreateEntityModule("weapon")->attackTimeSave; @@ -5643,7 +5643,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFPlayer_Spawn)(); + DETOUR_MEMBER_CALL(); int fov = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(player, fov, fov_override); @@ -5659,7 +5659,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(QAngle, CTFWeaponBase_GetSpreadAngles) { - auto ret = DETOUR_MEMBER_CALL(CTFWeaponBase_GetSpreadAngles)(); + auto ret = DETOUR_MEMBER_CALL(); auto weapon = reinterpret_cast(this); auto eye = weapon->GetOwner()->EyeAngles(); if (eye != ret) { @@ -5689,6 +5689,18 @@ namespace Mod::Attr::Custom_Attributes CTFPlayer *GetPlayerOwnerOfAttributeList(CAttributeList *list, bool ifProviding = true); bool attribute_manager_no_clear_cache; + +#ifdef PLATFORM_64BITS + DETOUR_DECL_MEMBER(bool, CSchemaAttributeType_String_BConvertStringToEconAttributeValue,const CEconItemAttributeDefinition *pAttrDef, const char *pszValue, attribute_data_union_t *out_pValue, bool compat) + { + auto ret = DETOUR_MEMBER_CALL(pAttrDef, pszValue, out_pValue, compat); + Msg("Convert string %p %p\n", out_pValue, out_pValue == nullptr ? nullptr : out_pValue->m_String); + if (out_pValue != nullptr) + last_parsed_string_attribute_value = out_pValue->m_String; + return ret; + } +#endif + DETOUR_DECL_MEMBER(void, CAttributeList_SetRuntimeAttributeValue, const CEconItemAttributeDefinition *pAttrDef, float flValue) { if (pAttrDef == nullptr) return; @@ -5706,6 +5718,19 @@ namespace Mod::Attr::Custom_Attributes AttributeChangeType changeType = AttributeChangeType::UPDATE; attribute_data_union_t oldValue; + attribute_data_union_t newValue; +#if 0 + if (!pAttrDef->IsType()) { + newValue.m_Float = flValue; + } + else{ + Msg("try to add ptr %zu %zu\n", flValue, last_parsed_string_attribute_value); + newValue.m_String = last_parsed_string_attribute_value; + } +#else + newValue.m_Float = flValue; +#endif + bool found = false; for (int i = 0; i < countpre; i++) { CEconItemAttribute &pAttribute = attrs[i]; @@ -5716,7 +5741,7 @@ namespace Mod::Attr::Custom_Attributes oldValue = pAttribute.GetValue(); found = true; if (memcmp(&oldValue.m_Float, &flValue, sizeof(float)) != 0) { - pAttribute.GetValuePtr()->m_Float = flValue; + *pAttribute.GetValuePtr() = newValue; list->NotifyManagerOfAttributeValueChanges(); changeType = AttributeChangeType::UPDATE; } @@ -5730,13 +5755,13 @@ namespace Mod::Attr::Custom_Attributes if (!found) { changeType = AttributeChangeType::ADD; auto attribute = CEconItemAttribute::Create(pAttrDef->GetIndex()); - attribute->GetValuePtr()->m_Float = flValue; + *attribute->GetValuePtr() = newValue; attrs.AddToTail(*attribute); CEconItemAttribute::Destroy(attribute); list->NotifyManagerOfAttributeValueChanges(); } - // DETOUR_MEMBER_CALL(CAttributeList_SetRuntimeAttributeValue)(pAttrDef, flValue); + // DETOUR_MEMBER_CALL(pAttrDef, flValue); // Move around attributes so that the custom attributes appear at the end of the list if (pAttrDef != nullptr && countpre != attrs.Count() && attrs.Count() > 20 && (pAttrDef->GetIndex() < 4200 || pAttrDef->GetIndex() > 5000)) { int count = attrs.Count(); @@ -5759,8 +5784,6 @@ namespace Mod::Attr::Custom_Attributes } if (changeType != AttributeChangeType::NONE) { - attribute_data_union_t newValue; - newValue.m_Float = flValue; OnAttributeChanged(list, pAttrDef, oldValue, newValue, changeType); } } @@ -5780,7 +5803,7 @@ namespace Mod::Attr::Custom_Attributes changeType = AttributeChangeType::REMOVE; } - DETOUR_MEMBER_CALL(CAttributeList_RemoveAttribute)(pAttrDef); + DETOUR_MEMBER_CALL(pAttrDef); if (changeType != AttributeChangeType::NONE) { attribute_data_union_t newValue; @@ -5801,7 +5824,7 @@ namespace Mod::Attr::Custom_Attributes pAttrDef = attrs[index].GetStaticData(); } - DETOUR_MEMBER_CALL(CAttributeList_RemoveAttributeByIndex)(index); + DETOUR_MEMBER_CALL(index); if (pAttrDef != nullptr) { changeType = AttributeChangeType::REMOVE; @@ -5821,7 +5844,7 @@ namespace Mod::Attr::Custom_Attributes oldValue = attr->GetValue(); } - DETOUR_MEMBER_CALL(CAttributeList_AddAttribute)(attr); + DETOUR_MEMBER_CALL(attr); if (oldValue.m_UInt != attr->GetValue().m_UInt) { changeType = AttributeChangeType::ADD; @@ -5832,7 +5855,6 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CAttributeList_DestroyAllAttributes) { auto list = reinterpret_cast(this); - auto &attrs = list->Attributes(); if (attrs.Count()) { for (int i = attrs.Count() - 1; i >= 0; i--) { @@ -5851,13 +5873,12 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CAttributeList_NotifyManagerOfAttributeValueChanges) { auto list = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CAttributeList_NotifyManagerOfAttributeValueChanges)(); + DETOUR_MEMBER_CALL(); } - DETOUR_DECL_MEMBER(float, CTFKnife_GetMeleeDamage, CBaseEntity *pTarget, int* piDamageType, int* piCustomDamage) { - float ret = DETOUR_MEMBER_CALL(CTFKnife_GetMeleeDamage)(pTarget, piDamageType, piCustomDamage); + float ret = DETOUR_MEMBER_CALL(pTarget, piDamageType, piCustomDamage); auto knife = reinterpret_cast(this); if (*piCustomDamage == TF_DMG_CUSTOM_BACKSTAB && knife->GetTFPlayerOwner() != nullptr && !knife->GetTFPlayerOwner()->IsBot() && pTarget->IsPlayer() && ToTFPlayer(pTarget)->IsMiniBoss() ) { @@ -5908,7 +5929,7 @@ namespace Mod::Attr::Custom_Attributes medigun->SetCustomVariable("healingnonplayer", Variant(false)); } - DETOUR_MEMBER_CALL(CWeaponMedigun_RemoveHealingTarget)(flag); + DETOUR_MEMBER_CALL(flag); } void AddMedigunAttributes(CAttributeList *target, const char *attribs) @@ -5971,7 +5992,7 @@ namespace Mod::Attr::Custom_Attributes SCOPED_INCREMENT_IF(rc_CWeaponMedigun_StartHealingTarget_Drain, drain != 0); startHealingTargetHealer = owner; startHealingTarget = targete; - DETOUR_MEMBER_CALL(CWeaponMedigun_StartHealingTarget)(targete); + DETOUR_MEMBER_CALL(targete); startHealingTarget = nullptr; startHealingTargetHealer = nullptr; } @@ -5985,7 +6006,7 @@ namespace Mod::Attr::Custom_Attributes if (iWeaponMod == 1) { while(true) { - if (DETOUR_MEMBER_CALL(CTFWeaponBase_Energy_Recharge)()) { + if (DETOUR_MEMBER_CALL()) { break; } } @@ -5993,7 +6014,7 @@ namespace Mod::Attr::Custom_Attributes //return true; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_Energy_Recharge)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CBasePlayer_ItemPostFrame) @@ -6077,7 +6098,7 @@ namespace Mod::Attr::Custom_Attributes } - DETOUR_MEMBER_CALL(CBasePlayer_ItemPostFrame)(); + DETOUR_MEMBER_CALL(); if (weapon != nullptr) { OnWeaponUpdate(weapon); // if ((player->m_nButtons & IN_ATTACK2) && GetFastAttributeFloat(weapon, 0, ALT_FIRE_ATTACK) != 0) { @@ -6118,7 +6139,7 @@ namespace Mod::Attr::Custom_Attributes { auto weapon = reinterpret_cast(this); - auto healRate = DETOUR_MEMBER_CALL(CWeaponMedigun_GetHealRate)(); + auto healRate = DETOUR_MEMBER_CALL(); if (rtti_cast(weapon->GetHealTarget()) != nullptr) { CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(weapon, healRate, revive_rate); } @@ -6129,7 +6150,7 @@ namespace Mod::Attr::Custom_Attributes { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Taunt)(index, taunt_concept); + DETOUR_MEMBER_CALL(index, taunt_concept); if (player->m_flTauntAttackTime > gpGlobals->curtime) { float attackDelayMult = 1.0f; @@ -6146,7 +6167,7 @@ namespace Mod::Attr::Custom_Attributes { auto weapon = reinterpret_cast(this); - delay = DETOUR_MEMBER_CALL(CTFWeaponBase_ApplyFireDelay)(delay); + delay = DETOUR_MEMBER_CALL(delay); if (weapon->IsMeleeWeapon()) { float flReducedHealthBonus = 1.0f; @@ -6171,7 +6192,7 @@ namespace Mod::Attr::Custom_Attributes return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_ApplyPunchImpulseX)(amount); + return DETOUR_MEMBER_CALL(amount); } DETOUR_DECL_MEMBER(void, CTFPlayer_ForceRespawn) @@ -6193,13 +6214,13 @@ namespace Mod::Attr::Custom_Attributes TE_TFParticleEffect(filter, 0.0f, "player_sparkles_blue", tele_pos, vec3_angle); } } - return DETOUR_MEMBER_CALL(CTFPlayer_ForceRespawn)(); + return DETOUR_MEMBER_CALL(); } void Misfire(CTFWeaponBaseGun *weapon) { weapon->CalcIsAttackCritical(); - //DETOUR_MEMBER_CALL(CTFWeaponBase_Misfire)(); + //DETOUR_MEMBER_CALL(); CTFPlayer *player = weapon->GetTFPlayerOwner(); if (!player) return; @@ -6221,7 +6242,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(bool, CTFWeaponBase_CheckReloadMisfire) { - bool result = DETOUR_MEMBER_CALL(CTFWeaponBase_CheckReloadMisfire)(); + bool result = DETOUR_MEMBER_CALL(); auto weapon = reinterpret_cast(this); int canOverload = 0; @@ -6238,7 +6259,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(bool, CObjectSentrygun_FindTarget) { - bool ret{DETOUR_MEMBER_CALL(CObjectSentrygun_FindTarget)()}; + bool ret{DETOUR_MEMBER_CALL()}; auto sentry{reinterpret_cast(this)}; CTFPlayer* builder{sentry->GetBuilder()}; if(builder){ @@ -6264,7 +6285,7 @@ namespace Mod::Attr::Custom_Attributes CTFPlayer *player = ToTFPlayer(reinterpret_cast(this)->player); //if ((player->GetFlags() & FL_ONGROUND) || (reinterpret_cast(this)->GetMoveData()->m_nOldButtons & IN_JUMP)) return; //ClientMsg(player, "redepl\n"); - DETOUR_MEMBER_CALL(CTFGameMovement_ToggleParachute)(); + DETOUR_MEMBER_CALL(); if (player->m_Shared->InCond(TF_COND_PARACHUTE_DEPLOYED)) { int parachuteRedeploy = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(player, parachuteRedeploy, parachute_redeploy); @@ -6284,7 +6305,7 @@ namespace Mod::Attr::Custom_Attributes float preSpeedUp = movement->GetMoveData()->m_flUpMove; - DETOUR_MEMBER_CALL(CTFGameMovement_HandleDuckingSpeedCrop)(); + DETOUR_MEMBER_CALL(); if (preSpeedFw != movement->GetMoveData()->m_flForwardMove || preSpeedSide != movement->GetMoveData()->m_flSideMove || preSpeedUp != movement->GetMoveData()->m_flUpMove) { float mult = GetFastAttributeFloat(player, 1, MULT_DUCK_SPEED); movement->GetMoveData()->m_flForwardMove *= mult; @@ -6298,7 +6319,7 @@ namespace Mod::Attr::Custom_Attributes { SCOPED_INCREMENT(rc_ProvidingAttributes); auto manager = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CAttributeManager_ProvideTo)(entity); + DETOUR_MEMBER_CALL(entity); auto item = rtti_cast(manager->m_hOuter.Get().Get()); if (item != nullptr) { auto &attrs = item->GetItem()->GetAttributeList().Attributes(); @@ -6316,7 +6337,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CAttributeManager_StopProvidingTo, CBaseEntity *entity) { SCOPED_INCREMENT(rc_ProvidingAttributes); - DETOUR_MEMBER_CALL(CAttributeManager_StopProvidingTo)(entity); + DETOUR_MEMBER_CALL(entity); auto manager = reinterpret_cast(this); auto item = rtti_cast(manager->m_hOuter.Get().Get()); if (item != nullptr) { @@ -6337,7 +6358,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFPlayer_HandleAnimEvent, animevent_t *pEvent) { - DETOUR_MEMBER_CALL(CTFPlayer_HandleAnimEvent)(pEvent); + DETOUR_MEMBER_CALL(pEvent); auto player = reinterpret_cast(this); if ((pEvent->event == AE_WPN_HIDE || pEvent->event == AE_WPN_UNHIDE) && player->GetActiveTFWeapon() != nullptr) { GET_STRING_ATTRIBUTE(player->GetActiveTFWeapon(), custom_item_model, model); @@ -6381,13 +6402,13 @@ namespace Mod::Attr::Custom_Attributes return vResult; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_GetParticleColor)(color); + return DETOUR_MEMBER_CALL(color); } DETOUR_DECL_STATIC(CTFProjectile_EnergyRing *, CTFProjectile_EnergyRing_Create, CTFWeaponBaseGun *pLauncher, const Vector &vecOrigin, const QAngle& vecAngles, float fSpeed, float fGravity, CBaseEntity *pOwner, CBaseEntity *pScorer, Vector vColor1, Vector vColor2, bool bCritical) { - auto ring = DETOUR_STATIC_CALL(CTFProjectile_EnergyRing_Create)(pLauncher, vecOrigin, vecAngles, fSpeed, fGravity, pOwner, pScorer, vColor1, vColor2, bCritical); + auto ring = DETOUR_STATIC_CALL(pLauncher, vecOrigin, vecAngles, fSpeed, fGravity, pOwner, pScorer, vColor1, vColor2, bCritical); if (ring != nullptr && pLauncher != nullptr) { int particleColor = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(pLauncher, particleColor, particle_color_rgb); @@ -6426,7 +6447,7 @@ namespace Mod::Attr::Custom_Attributes { auto weapon = reinterpret_cast(this); bool good = weapon->m_flNextPrimaryAttack <= gpGlobals->curtime; - DETOUR_MEMBER_CALL(CTFBat_Wood_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); if (good && weapon->m_flNextPrimaryAttack > gpGlobals->curtime) { float fireRateMult = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(weapon, fireRateMult, mult_postfiredelay); @@ -6442,7 +6463,7 @@ namespace Mod::Attr::Custom_Attributes CALL_ATTRIB_HOOK_INT_ON_OTHER(pPlayer, ignore, ignored_by_enemy_sentries); if (ignore != 0) return false; - return DETOUR_MEMBER_CALL(CObjectSentrygun_ValidTargetPlayer)(pPlayer, vecStart, vecEnd); + return DETOUR_MEMBER_CALL(pPlayer, vecStart, vecEnd); } ConVar sig_attr_burn_time_faster_burn("sig_attr_burn_time_faster_burn", "1", FCVAR_NOTIFY | FCVAR_GAMEDLL, @@ -6477,7 +6498,7 @@ namespace Mod::Attr::Custom_Attributes return; } } - DETOUR_MEMBER_CALL(CTFPlayerShared_Burn)(igniter, weapon, duration); + DETOUR_MEMBER_CALL(igniter, weapon, duration); if (weapon != nullptr && remainingFlameTime != shared->m_flFlameRemoveTime) { float mult = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(weapon, mult, mult_afterburn_delay); @@ -6507,7 +6528,7 @@ namespace Mod::Attr::Custom_Attributes auto shared = reinterpret_cast(this); float nextFlameTime = shared->m_flFlameBurnTime; - DETOUR_MEMBER_CALL(CTFPlayerShared_ConditionGameRulesThink)(); + DETOUR_MEMBER_CALL(); auto &bleedVec = shared->m_BleedInfo.Get(); FOR_EACH_VEC(bleedVec, i) { @@ -6589,7 +6610,7 @@ namespace Mod::Attr::Custom_Attributes }); } } - DETOUR_MEMBER_CALL(CGameMovement_CheckFalling)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CCurrencyPack_MyTouch, CBasePlayer *player) @@ -6598,7 +6619,7 @@ namespace Mod::Attr::Custom_Attributes int nCurHealth = player->GetHealth(); int nMaxHealth = player->GetMaxHealth(); - bool ret = DETOUR_MEMBER_CALL(CCurrencyPack_MyTouch)(player); + bool ret = DETOUR_MEMBER_CALL(player); if (ret) { float health = 0; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(player, health, health_from_credits); @@ -6629,23 +6650,23 @@ namespace Mod::Attr::Custom_Attributes CRecipientFilter filter2; filter2.CopyFrom(filter); filter2.AddRecipient(playerAnimSender); - DETOUR_MEMBER_CALL(CVEngineServer_PlaybackTempEntity)(filter2, delay, pSender, pST, classID); + DETOUR_MEMBER_CALL(filter2, delay, pSender, pST, classID); return; } - DETOUR_MEMBER_CALL(CVEngineServer_PlaybackTempEntity)(filter, delay, pSender, pST, classID); + DETOUR_MEMBER_CALL(filter, delay, pSender, pST, classID); } DETOUR_DECL_MEMBER(void, CTFPlayer_TraceAttack, const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, void *pAccumulator) { SCOPED_INCREMENT(rc_CTFPlayer_TraceAttack); - DETOUR_MEMBER_CALL(CTFPlayer_TraceAttack)(info, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(info, vecDir, ptr, pAccumulator); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_IsPassiveWeapon) { auto weapon = reinterpret_cast(this); return GetFastAttributeInt(weapon, 0, IS_PASSIVE_WEAPON) != 0; - //return DETOUR_MEMBER_CALL(CTFWeaponBase_IsPassiveWeapon)(); + //return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CBaseCombatWeapon_GetMaxClip1) @@ -6656,14 +6677,14 @@ namespace Mod::Attr::Custom_Attributes return clipAttr; } return weapon->GetWpnData().iMaxClip1; - //return DETOUR_MEMBER_CALL(CTFWeaponBase_IsPassiveWeapon)(); + //return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CTFWeaponBase_AutoFiresFullClip) { auto weapon = reinterpret_cast(this); return GetFastAttributeInt(weapon, 0, AUTO_FIRES_FULL_CLIP) != 0; - //return DETOUR_MEMBER_CALL(CTFWeaponBase_IsPassiveWeapon)(); + //return DETOUR_MEMBER_CALL(); } @@ -6675,7 +6696,7 @@ namespace Mod::Attr::Custom_Attributes if (burn_duration != 0.0f) { return 7.5f; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_GetAfterburnRateOnHit)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFBotVision_IsIgnored, CBaseEntity *ent) @@ -6689,7 +6710,7 @@ namespace Mod::Attr::Custom_Attributes return true; } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_SendWeaponAnim, int activity) @@ -6700,7 +6721,7 @@ namespace Mod::Attr::Custom_Attributes return false; } - return DETOUR_MEMBER_CALL(CBaseCombatWeapon_SendWeaponAnim)(activity); + return DETOUR_MEMBER_CALL(activity); } DETOUR_DECL_MEMBER(bool, CTFPlayer_CanDisguise) @@ -6711,7 +6732,7 @@ namespace Mod::Attr::Custom_Attributes if (alwaysAllowDisguise != 0) { return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_CanDisguise)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayer_CanGoInvisible, bool flagcheck) @@ -6722,7 +6743,7 @@ namespace Mod::Attr::Custom_Attributes if (alwaysAllowCloak != 0) { return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_CanGoInvisible)(flagcheck); + return DETOUR_MEMBER_CALL(flagcheck); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CObjectTeleporter_PlayerCanBeTeleported, CTFPlayer *player) @@ -6732,14 +6753,14 @@ namespace Mod::Attr::Custom_Attributes if (alwaysAllowTeleport != 0) { return true; } - return DETOUR_MEMBER_CALL(CObjectTeleporter_PlayerCanBeTeleported)(player); + return DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(bool, CSpellPickup_ItemCanBeTouchedByPlayer, CBasePlayer *player) { int cannotPickup = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(player, cannotPickup, cannot_pickup_spells); - return DETOUR_MEMBER_CALL(CSpellPickup_ItemCanBeTouchedByPlayer)(player); + return DETOUR_MEMBER_CALL(player); } void ChangeBuildingProperties(CTFPlayer *player, CBaseObject *obj); @@ -6757,7 +6778,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFPlayer_RemoveAllOwnedEntitiesFromWorld)(explode); + DETOUR_MEMBER_CALL(explode); } DETOUR_DECL_MEMBER(void, CTFBot_Event_Killed, const CTakeDamageInfo& info) @@ -6770,7 +6791,7 @@ namespace Mod::Attr::Custom_Attributes ChangeBuildingProperties(player, obj); } } - DETOUR_MEMBER_CALL(CTFBot_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); } class SentryWeaponModule : public EntityModule @@ -6833,7 +6854,7 @@ namespace Mod::Attr::Custom_Attributes return nullptr; } } - auto ret = DETOUR_STATIC_CALL(CTFProjectile_SentryRocket_Create)(vecOrigin, vecAngles, pOwner, pScorer); + auto ret = DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pScorer); sentry_gun_rocket = ret; return ret; } @@ -6842,17 +6863,17 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CTFPlayer_AddObject, CBaseObject *object) { - DETOUR_MEMBER_CALL(CTFPlayer_AddObject)(object); + DETOUR_MEMBER_CALL(object); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveObject, CBaseObject *object) { - DETOUR_MEMBER_CALL(CTFPlayer_RemoveObject)(object); + DETOUR_MEMBER_CALL(object); } DETOUR_DECL_MEMBER(float, CObjectDispenser_GetHealRate) { - auto ret = DETOUR_MEMBER_CALL(CObjectDispenser_GetHealRate)(); + auto ret = DETOUR_MEMBER_CALL(); auto dispenser = reinterpret_cast(this); ret *= GetBuildingAttributeFloat<"ratemult">(dispenser, "mult_dispenser_rate", true); return ret; @@ -6867,7 +6888,7 @@ namespace Mod::Attr::Custom_Attributes teleporter->m_iTeleportType = 1; restore = true; } - DETOUR_MEMBER_CALL(CObjectTeleporter_TeleporterThink)(); + DETOUR_MEMBER_CALL(); if (prestate == 3 && teleporter->m_iState == 6) { float rechargeDurationPre = teleporter->m_flCurrentRechargeDuration; float rate = GetBuildingAttributeFloat<"rechargeratemult">(teleporter, "mult_teleporter_recharge_rate", true); @@ -6884,7 +6905,7 @@ namespace Mod::Attr::Custom_Attributes auto obj = reinterpret_cast(this); CTFPlayer *owner = obj->GetBuilder(); - DETOUR_MEMBER_CALL(CObjectSentrygun_StartUpgrading)(); + DETOUR_MEMBER_CALL(); obj->m_iMaxAmmoShells *= GetBuildingAttributeFloat<"ammomult">(obj, "mvm_sentry_ammo", true); if (!obj->m_bCarryDeploy) { obj->m_iAmmoShells = obj->m_iMaxAmmoShells; @@ -6896,7 +6917,7 @@ namespace Mod::Attr::Custom_Attributes { auto obj = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CObjectSentrygun_Spawn)(); + DETOUR_MEMBER_CALL(); obj->m_iMaxAmmoShells *= GetBuildingAttributeFloat<"ammomult">(obj, "mvm_sentry_ammo", true); obj->m_iMaxAmmoRockets *= GetBuildingAttributeFloat<"ammomult">(obj, "mvm_sentry_ammo", true); obj->m_iMaxAmmoRockets *= GetBuildingAttributeFloat<"rocketammomult">(obj, "mult_sentry_rocket_ammo", false); @@ -6908,7 +6929,7 @@ namespace Mod::Attr::Custom_Attributes { auto obj = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CObjectTeleporter_TeleporterSend)(player); + DETOUR_MEMBER_CALL(player); if (player != nullptr && obj->GetCustomVariableInt<"speedboost">() != 0) { player->m_Shared->AddCond(TF_COND_SPEED_BOOST, 4.0f); } @@ -6927,12 +6948,12 @@ namespace Mod::Attr::Custom_Attributes return; } info.m_flDamage *= GetBuildingAttributeFloat<"damagemult">(obj, "mult_engy_sentry_damage", true); - VHOOK_CALL(CObjectSentrygun_FireBullets)(info); + VHOOK_CALL(info); } DETOUR_DECL_MEMBER(float, CObjectDispenser_GetDispenserRadius) { - auto ret = DETOUR_MEMBER_CALL(CObjectDispenser_GetDispenserRadius)(); + auto ret = DETOUR_MEMBER_CALL(); auto dispenser = reinterpret_cast(this); ret *= GetBuildingAttributeFloat<"radiusmult">(dispenser, "mult_dispenser_radius", true); return ret; @@ -6942,7 +6963,7 @@ namespace Mod::Attr::Custom_Attributes { auto sentry = reinterpret_cast(this); sentry->m_flSentryRange *= GetBuildingAttributeFloat<"rangemult">(sentry, "mult_sentry_range", true); - DETOUR_MEMBER_CALL(CObjectSentrygun_SentryRotate)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CObjectSentrygun_Attack) @@ -6950,7 +6971,7 @@ namespace Mod::Attr::Custom_Attributes auto sentry = reinterpret_cast(this); sentry->m_flSentryRange *= GetBuildingAttributeFloat<"rangemult">(sentry, "mult_sentry_range", true); float nextAttackPre = sentry->m_flNextAttack; - DETOUR_MEMBER_CALL(CObjectSentrygun_Attack)(); + DETOUR_MEMBER_CALL(); if (nextAttackPre < sentry->m_flNextAttack) { float rate = GetBuildingAttributeFloat<"fireratemult">(sentry, "mult_sentry_firerate", true); sentry->m_flFireRate *= rate; @@ -6965,7 +6986,7 @@ namespace Mod::Attr::Custom_Attributes auto sentry = reinterpret_cast(this); float nextAttackPre = sentry->m_flNextAttack; float nextAttackRocket = sentry->m_flNextRocketAttack; - DETOUR_MEMBER_CALL(CObjectSentrygun_FoundTarget)(entity, vecSoundCenter, noSound); + DETOUR_MEMBER_CALL(entity, vecSoundCenter, noSound); float rate = GetBuildingAttributeFloat<"fireratemult">(sentry, "mult_sentry_firerate", false); if (rate > 1) { sentry->m_flNextAttack = nextAttackPre; @@ -7034,7 +7055,7 @@ namespace Mod::Attr::Custom_Attributes model = newModel.c_str(); CBaseEntity::PrecacheModel(model); } - DETOUR_MEMBER_CALL(CObjectSentrygun_SetModel)(model); + DETOUR_MEMBER_CALL(model); } DETOUR_DECL_MEMBER(void, CObjectTeleporter_SetModel, const char *model) @@ -7071,7 +7092,7 @@ namespace Mod::Attr::Custom_Attributes model = newModel.c_str(); CBaseEntity::PrecacheModel(model); } - DETOUR_MEMBER_CALL(CObjectTeleporter_SetModel)(model); + DETOUR_MEMBER_CALL(model); } DETOUR_DECL_MEMBER(void, CObjectDispenser_SetModel, const char *model) @@ -7133,7 +7154,7 @@ namespace Mod::Attr::Custom_Attributes model = newModel.c_str(); CBaseEntity::PrecacheModel(model); } - DETOUR_MEMBER_CALL(CObjectDispenser_SetModel)(model); + DETOUR_MEMBER_CALL(model); } @@ -7148,7 +7169,7 @@ namespace Mod::Attr::Custom_Attributes if (modrocket != nullptr && modrocket->weapon != nullptr) { modrocket->weapon->Remove(); } - VHOOK_CALL(CObjectSentrygun_UpdateOnRemove)(); + VHOOK_CALL(); } DETOUR_DECL_MEMBER(void, CObjectSentrygun_EmitSentrySound, const char *sound) @@ -7166,7 +7187,7 @@ namespace Mod::Attr::Custom_Attributes return; } } - DETOUR_MEMBER_CALL(CObjectSentrygun_EmitSentrySound)(sound); + DETOUR_MEMBER_CALL(sound); } bool OverrideGib(CTFPlayer *player, const CTakeDamageInfo& info, bool &result) @@ -7208,7 +7229,7 @@ namespace Mod::Attr::Custom_Attributes auto bot = reinterpret_cast(this); bool result = false; if (OverrideGib(bot, info, result)) return result; - return DETOUR_MEMBER_CALL(CTFBot_ShouldGib)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(bool, CTFPlayer_ShouldGib, const CTakeDamageInfo& info) @@ -7216,7 +7237,7 @@ namespace Mod::Attr::Custom_Attributes auto player = reinterpret_cast(this); bool result = false; if (OverrideGib(player, info, result)) return result; - return DETOUR_MEMBER_CALL(CTFPlayer_ShouldGib)(info); + return DETOUR_MEMBER_CALL(info); } std::string sapperModelName; @@ -7241,7 +7262,7 @@ namespace Mod::Attr::Custom_Attributes } } } - return DETOUR_MEMBER_CALL(CObjectSapper_GetSapperModelName)(nModel, pchModelName); + return DETOUR_MEMBER_CALL(nModel, pchModelName); } DETOUR_DECL_MEMBER(const char *, CObjectSapper_GetSapperSoundName) @@ -7256,14 +7277,14 @@ namespace Mod::Attr::Custom_Attributes return sound; } } - return DETOUR_MEMBER_CALL(CObjectSapper_GetSapperSoundName)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(const char *, CObjectSapper_UpdateOnRemove) { auto sapper = reinterpret_cast(this); sapper->StopSound(sapper->GetCustomVariable<"customsound">("")); - return DETOUR_MEMBER_CALL(CObjectSapper_UpdateOnRemove)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_CBaseObject_FindSnapToBuildPos; @@ -7294,7 +7315,7 @@ namespace Mod::Attr::Custom_Attributes return found; } SCOPED_INCREMENT_IF(rc_CBaseObject_FindSnapToBuildPos, ally != 0); - return DETOUR_MEMBER_CALL(CBaseObject_FindSnapToBuildPos)(pObjectOverride); + return DETOUR_MEMBER_CALL(pObjectOverride); } DETOUR_DECL_MEMBER(CTFTeam *, CTFPlayer_GetOpposingTFTeam) @@ -7303,7 +7324,7 @@ namespace Mod::Attr::Custom_Attributes if (rc_CBaseObject_FindSnapToBuildPos) { return TFTeamMgr()->GetTeam(me->GetTeamNumber()); } - return DETOUR_MEMBER_CALL(CTFPlayer_GetOpposingTFTeam)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CObjectSapper_IsValidRoboSapperTarget, CTFPlayer *player) @@ -7314,7 +7335,7 @@ namespace Mod::Attr::Custom_Attributes if (ally) { return player->GetTeamNumber() == builder->GetTeamNumber() && player->IsAlive(); } - return DETOUR_MEMBER_CALL(CObjectSapper_IsValidRoboSapperTarget)(player); + return DETOUR_MEMBER_CALL(player); } #define DETOUR_DECL_MEMBER_PROJ_DAMAGE_MULT(className) \ @@ -7322,7 +7343,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(float, className##_GetDamage) \ { \ auto me = reinterpret_cast(this); \ - return DETOUR_MEMBER_CALL(className##_GetDamage)() * GetDamageMult(me); \ + return DETOUR_MEMBER_CALL() * GetDamageMult(me); \ } \ DETOUR_DECL_MEMBER_PROJ_DAMAGE_MULT(CTFProjectile_Cleaver); @@ -7335,7 +7356,7 @@ namespace Mod::Attr::Custom_Attributes { auto loco = reinterpret_cast(this); if (loco->GetBot()->GetEntity()->GetMoveType() == MOVETYPE_NOCLIP) return true; - return VHOOK_CALL(PlayerLocomotion_IsOnGround)(args); + return VHOOK_CALL(args); } DETOUR_DECL_MEMBER(void, CGameMovement_FullNoClipMove, float speed, float accel) @@ -7350,7 +7371,7 @@ namespace Mod::Attr::Custom_Attributes speed = noclip / 300; } } - DETOUR_MEMBER_CALL(CGameMovement_FullNoClipMove)(speed, accel); + DETOUR_MEMBER_CALL(speed, accel); } DETOUR_DECL_MEMBER(void, CTFPlayerMove_SetupMove, CBasePlayer *player, CUserCmd *ucmd, IMoveHelper *pHelper, CMoveData *move) @@ -7368,7 +7389,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFPlayerMove_SetupMove)(player, ucmd, pHelper, move); + DETOUR_MEMBER_CALL(player, ucmd, pHelper, move); if (restoreCond) { auto tfplayer = ToTFPlayer(player); @@ -7381,7 +7402,7 @@ namespace Mod::Attr::Custom_Attributes auto wep = reinterpret_cast(this); GET_STRING_ATTRIBUTE(wep, add_attributes_when_active, attributes); AddOnActiveAttributes(wep, attributes); - return DETOUR_MEMBER_CALL(CTFWeaponBase_Deploy)(); + return DETOUR_MEMBER_CALL(); } bool CanSapBuilding(CBaseObject *obj) { @@ -7399,7 +7420,7 @@ namespace Mod::Attr::Custom_Attributes } } - return DETOUR_MEMBER_CALL(CBaseObject_FindNearestBuildPoint)(pEntity, pBuilder, flNearestPoint, vecNearestBuildPoint, bIgnoreChecks); + return DETOUR_MEMBER_CALL(pEntity, pBuilder, flNearestPoint, vecNearestBuildPoint, bIgnoreChecks); } DETOUR_DECL_MEMBER(bool,CTFBotDeliverFlag_UpgradeOverTime, CTFBot *bot) @@ -7408,7 +7429,7 @@ namespace Mod::Attr::Custom_Attributes CALL_ATTRIB_HOOK_INT_ON_OTHER(bot, cannotUpgrade, cannot_upgrade_bomb); if (cannotUpgrade) return false; - return DETOUR_MEMBER_CALL(CTFBotDeliverFlag_UpgradeOverTime)(bot); + return DETOUR_MEMBER_CALL(bot); } IForward *viewmodels_enabled_forward; @@ -7442,7 +7463,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CServerGameClients_ClientPutInServer, edict_t *edict, const char *playername) { - DETOUR_MEMBER_CALL(CServerGameClients_ClientPutInServer)(edict, playername); + DETOUR_MEMBER_CALL(edict, playername); char path[512]; auto player = ((CTFPlayer*) edict->GetUnknown()); snprintf(path, 512, "%s%llu", disallowed_viewmodel_path.c_str(), player->GetSteamID().ConvertToUint64()); @@ -7502,7 +7523,7 @@ namespace Mod::Attr::Custom_Attributes if (ammoValueChange != 0) { GetPlayerClassData(classIndex == -1 ? player->GetPlayerClass()->GetClassIndex() : classIndex)->m_aAmmoMax[ammoIndex] += ammoValueChange; } - auto ret = DETOUR_MEMBER_CALL(CTFPlayer_GetMaxAmmo)(ammoIndex, classIndex); + auto ret = DETOUR_MEMBER_CALL(ammoIndex, classIndex); if (ammoValueChange != 0) { GetPlayerClassData(classIndex == -1 ? player->GetPlayerClass()->GetClassIndex() : classIndex)->m_aAmmoMax[ammoIndex] -= ammoValueChange; } @@ -7511,7 +7532,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFWeaponBuilder_StartPlacement) { - DETOUR_MEMBER_CALL(CTFWeaponBuilder_StartPlacement)(); + DETOUR_MEMBER_CALL(); auto builder = reinterpret_cast(this); string_t attrTest = NULL_STRING; @@ -7543,7 +7564,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CTFWeaponBuilder_StopPlacement) { - DETOUR_MEMBER_CALL(CTFWeaponBuilder_StopPlacement)(); + DETOUR_MEMBER_CALL(); auto builder = reinterpret_cast(this); if (builder->GetCustomVariableBool<"custombuildingviewmodel">()) { @@ -7563,7 +7584,7 @@ namespace Mod::Attr::Custom_Attributes VHOOK_DECL(Activity, CTFWeaponBuilder_TranslateViewmodelHandActivityInternal, Activity base) { - auto ret = VHOOK_CALL(CTFWeaponBuilder_TranslateViewmodelHandActivityInternal)(base); + auto ret = VHOOK_CALL(base); //Msg("Base %s Res %s\n", CAI_BaseNPC::GetActivityName(base), CAI_BaseNPC::GetActivityName(ret)); return ret; } @@ -7582,28 +7603,28 @@ namespace Mod::Attr::Custom_Attributes } } } - auto ret = VHOOK_CALL(CTFWeaponBuilder_SendWeaponAnim)(act); + auto ret = VHOOK_CALL(act); return ret; } DETOUR_DECL_MEMBER(int, CEconItemView_GetAnimationSlot) { - auto ret = DETOUR_MEMBER_CALL(CEconItemView_GetAnimationSlot)(); + auto ret = DETOUR_MEMBER_CALL(); //Msg("Slot %d\n", ret); return ret; } DETOUR_DECL_MEMBER(int, CTFWeaponBase_GetViewModelWeaponRole) { - auto ret = DETOUR_MEMBER_CALL(CTFWeaponBase_GetViewModelWeaponRole)(); + auto ret = DETOUR_MEMBER_CALL(); //Msg("SlotRole %d\n", ret); return ret; } DETOUR_DECL_MEMBER(Activity, CEconItemDefinition_GetActivityOverride, int team, Activity base) { - auto ret = DETOUR_MEMBER_CALL(CEconItemDefinition_GetActivityOverride)(team, base); + auto ret = DETOUR_MEMBER_CALL(team, base); //Msg("ActivityOverride %d %d\n", base, ret); return ret; } @@ -7613,7 +7634,7 @@ namespace Mod::Attr::Custom_Attributes auto flame = reinterpret_cast(this); SCOPED_INCREMENT_IF(rc_CTFFlameManager_OnCollide, flame->GetOwnerEntity() != nullptr && HasAllowFriendlyFire(flame->GetOwnerEntity(), flame->GetOwnerEntity()->GetOwnerEntity())); - DETOUR_MEMBER_CALL(CTFFlameManager_OnCollide)(entity, value); + DETOUR_MEMBER_CALL(entity, value); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_Heal, CBaseEntity *pHealer, float flAmount, float flOverhealBonus, float flOverhealDecayMult, bool bDispenserHeal, CTFPlayer *pHealScorer) @@ -7633,7 +7654,7 @@ namespace Mod::Attr::Custom_Attributes mod->maxOverheal = flOverhealBonus; } } - DETOUR_MEMBER_CALL(CTFPlayerShared_Heal)(pHealer, flAmount, flOverhealBonus, flOverhealDecayMult, bDispenserHeal, pHealScorer); + DETOUR_MEMBER_CALL(pHealer, flAmount, flOverhealBonus, flOverhealDecayMult, bDispenserHeal, pHealScorer); } DETOUR_DECL_MEMBER(void, CWeaponMedigun_SecondaryAttack) @@ -7649,7 +7670,7 @@ namespace Mod::Attr::Custom_Attributes medigun->SetHealTarget(nullptr); } } - DETOUR_MEMBER_CALL(CWeaponMedigun_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); if (healRestore != nullptr) { medigun->SetHealTarget(healRestore); } @@ -7668,7 +7689,7 @@ namespace Mod::Attr::Custom_Attributes medigun->SetHealTarget(nullptr); } } - DETOUR_MEMBER_CALL(CWeaponMedigun_CycleResistType)(); + DETOUR_MEMBER_CALL(); if (healRestore != nullptr) { medigun->SetHealTarget(healRestore); } @@ -7678,7 +7699,7 @@ namespace Mod::Attr::Custom_Attributes { auto medigun = reinterpret_cast(this); auto owner = medigun->GetTFPlayerOwner(); - auto result = DETOUR_MEMBER_CALL(CWeaponMedigun_FindAndHealTargets)(); + auto result = DETOUR_MEMBER_CALL(); auto target = ToTFPlayer(medigun->GetHealTarget()); if (result && owner != nullptr && target != nullptr && target->GetTeamNumber() == owner->GetTeamNumber()) { float drain = 0; @@ -7719,7 +7740,7 @@ namespace Mod::Attr::Custom_Attributes GET_STRING_ATTRIBUTE(weapon, fire_input_on_attack, input); FireInputAttribute(input, nullptr, Variant(), nullptr, player, weapon, -1.0f); ApplyPunch(player, weapon); - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(const char *, CTFPlayer_GetSceneSoundToken) @@ -7735,7 +7756,7 @@ namespace Mod::Attr::Custom_Attributes if (robotVoice != 0) { return "MVM_"; } - return DETOUR_MEMBER_CALL(CTFPlayer_GetSceneSoundToken)(); + return DETOUR_MEMBER_CALL(); } THINK_FUNC_DECL(SetActivityThink) @@ -7777,7 +7798,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFWeaponBase_ItemPostFrame)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CBaseCombatWeapon_SetIdealActivity, Activity act) @@ -7787,7 +7808,7 @@ namespace Mod::Attr::Custom_Attributes if (rc_AltFireAttack && weapon->m_IdealActivity == act && act == weapon->TranslateViewmodelHandActivityInternal((Activity) activityAttack)) { idealActivitySet = true; } - return DETOUR_MEMBER_CALL(CBaseCombatWeapon_SetIdealActivity)(act); + return DETOUR_MEMBER_CALL(act); } DETOUR_DECL_MEMBER(void, CTFWeaponBase_ItemBusyFrame) @@ -7803,7 +7824,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CTFWeaponBase_ItemBusyFrame)(); + DETOUR_MEMBER_CALL(); if (restore) { player->m_nButtons &= ~(IN_ATTACK); @@ -7818,7 +7839,7 @@ namespace Mod::Attr::Custom_Attributes return nullptr; } - return DETOUR_STATIC_CALL(CTFReviveMarker_Create)(player); + return DETOUR_STATIC_CALL(player); } DETOUR_DECL_STATIC(void, TE_PlayerAnimEvent, CBasePlayer *player, int anim, int data) @@ -7826,7 +7847,7 @@ namespace Mod::Attr::Custom_Attributes if (rc_AltFireAttack) { playerAnimSender = player; } - DETOUR_STATIC_CALL(TE_PlayerAnimEvent)(player, anim, data); + DETOUR_STATIC_CALL(player, anim, data); playerAnimSender = nullptr; } @@ -7855,7 +7876,7 @@ namespace Mod::Attr::Custom_Attributes } } - DETOUR_MEMBER_CALL(CBaseEntity_Touch)(other); + DETOUR_MEMBER_CALL(other); if (weaponAltFire != nullptr) { auto mod = weaponAltFire->GetEntityModule("altfireattrs"); @@ -7902,7 +7923,7 @@ namespace Mod::Attr::Custom_Attributes } } } - DETOUR_MEMBER_CALL(CCollisionEvent_PostCollision)(event); + DETOUR_MEMBER_CALL(event); if (weaponAltFire != nullptr) { auto mod = weaponAltFire->GetEntityModule("altfireattrs"); @@ -7933,7 +7954,7 @@ namespace Mod::Attr::Custom_Attributes } } - return DETOUR_MEMBER_CALL(CBaseCombatWeapon_HasPrimaryAmmo)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CBasePlayer_PlayStepSound, Vector& vecOrigin, surfacedata_t *psurface, float fvol, bool force) @@ -7944,14 +7965,14 @@ namespace Mod::Attr::Custom_Attributes player->EmitSound(sound); } - DETOUR_MEMBER_CALL(CBasePlayer_PlayStepSound)(vecOrigin, psurface, fvol, force); + DETOUR_MEMBER_CALL(vecOrigin, psurface, fvol, force); } DETOUR_DECL_MEMBER(void, CTFPlayer_OnTauntSucceeded, const char* pszSceneName, int iTauntIndex, int iTauntConcept) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_OnTauntSucceeded)(pszSceneName, iTauntIndex, iTauntConcept); + DETOUR_MEMBER_CALL(pszSceneName, iTauntIndex, iTauntConcept); GET_STRING_ATTRIBUTE(player, fire_input_on_taunt, input); FireInputAttribute(input, nullptr, Variant(AllocPooledString(pszSceneName)), nullptr, player, player, -1.0f); } @@ -7962,7 +7983,7 @@ namespace Mod::Attr::Custom_Attributes auto player = move->player; displacePlayers.clear(); - DETOUR_MEMBER_CALL(CGameMovement_PlayerMove)(); + DETOUR_MEMBER_CALL(); if (displacePlayers.empty()) return; for (auto &toucherH : displacePlayers) { @@ -8090,7 +8111,7 @@ namespace Mod::Attr::Custom_Attributes CALL_ATTRIB_HOOK_INT_ON_OTHER(pTFPlayer, cannotApply, cannot_be_sapped); if (cannotApply) return false; - return DETOUR_MEMBER_CALL(CBaseObject_FindBuildPointOnPlayer)(pTFPlayer, pBuilder, flNearestPoint, vecNearestBuildPoint); + return DETOUR_MEMBER_CALL(pTFPlayer, pBuilder, flNearestPoint, vecNearestBuildPoint); } DETOUR_DECL_MEMBER(void, CTFBaseRocket_Destroy) @@ -8099,7 +8120,7 @@ namespace Mod::Attr::Custom_Attributes int explode = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(rocket->GetOriginalLauncher(), explode, projectile_explode_on_destroy); if (explode == 3 && takeDamageAttacker != nullptr && takeDamageAttacker->GetTeamNumber() != (rocket->GetOwnerEntity() != nullptr ? rocket->GetOwnerEntity() : rocket)->GetTeamNumber()) { - DETOUR_MEMBER_CALL(CTFBaseRocket_Destroy)(); + DETOUR_MEMBER_CALL(); return; } if (explode == 2 && takeDamageAttacker != nullptr) { @@ -8113,7 +8134,7 @@ namespace Mod::Attr::Custom_Attributes rocket->Explode(&tr, GetContainingEntity(INDEXENT(0))); return; } - DETOUR_MEMBER_CALL(CTFBaseRocket_Destroy)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseGrenadeProj_Destroy) @@ -8122,7 +8143,7 @@ namespace Mod::Attr::Custom_Attributes int explode = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(rocket->GetOriginalLauncher(), explode, projectile_explode_on_destroy); if (explode == 3 && (takeDamageAttacker == nullptr || takeDamageAttacker->GetTeamNumber() != (rocket->GetThrower() != nullptr ? rocket->GetThrower() : rocket)->GetTeamNumber())) { - DETOUR_MEMBER_CALL(CTFWeaponBaseGrenadeProj_Destroy)(); + DETOUR_MEMBER_CALL(); return; } if (explode == 2 && takeDamageAttacker != nullptr) { @@ -8136,7 +8157,7 @@ namespace Mod::Attr::Custom_Attributes rocket->Explode(&tr, rocket->GetDamageType()); return; } - DETOUR_MEMBER_CALL(CTFWeaponBaseGrenadeProj_Destroy)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_CanHolster) @@ -8151,14 +8172,14 @@ namespace Mod::Attr::Custom_Attributes if (!hasFullClip && holdFire == 2) return false; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_CanHolster)(); + return DETOUR_MEMBER_CALL(); } bool flareCritBefore = false; DETOUR_DECL_MEMBER(void, CTFProjectile_Flare_Explode, CGameTrace *tr, CBaseEntity *ent) { flareCritBefore = reinterpret_cast(this)->m_bCritical; - DETOUR_MEMBER_CALL(CTFProjectile_Flare_Explode)(tr, ent); + DETOUR_MEMBER_CALL(tr, ent); } DETOUR_DECL_MEMBER(int, CTFProjectile_Flare_GetDamageType) @@ -8171,7 +8192,7 @@ namespace Mod::Attr::Custom_Attributes flare->m_bCritical = false; } } - return DETOUR_MEMBER_CALL(CTFProjectile_Flare_GetDamageType)(); + return DETOUR_MEMBER_CALL(); } // inline int GetMaxHealthForBuffing(CTFPlayer *player) { @@ -8463,7 +8484,7 @@ namespace Mod::Attr::Custom_Attributes } InspectAttributes(target, player, false); - DETOUR_MEMBER_CALL(CTFPlayer_InspectButtonPressed)(); + DETOUR_MEMBER_CALL(); } @@ -8488,13 +8509,13 @@ namespace Mod::Attr::Custom_Attributes respawnTimesForId[player->GetSteamID()] = player->GetDeathTime() + respawntime; } - DETOUR_MEMBER_CALL(CTFPlayer_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); RemoveAttributeManager(reinterpret_cast(this)); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CAttributeManager_ClearCache) { - DETOUR_MEMBER_CALL(CAttributeManager_ClearCache)(); + DETOUR_MEMBER_CALL(); auto mgr = reinterpret_cast(this); @@ -8512,7 +8533,7 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CEconEntity_UpdateOnRemove) { auto entity = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CEconEntity_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); RemoveAttributeManager(entity); } @@ -8521,7 +8542,7 @@ namespace Mod::Attr::Custom_Attributes Msg("should\n"); return false; - return VHOOK_CALL(CBaseProjectile_ShouldCollide)(collisionGroup, contentsMask); + return VHOOK_CALL(collisionGroup, contentsMask); } /*void OnAttributesChange(CAttributeManager *mgr) @@ -8543,13 +8564,13 @@ namespace Mod::Attr::Custom_Attributes DETOUR_DECL_MEMBER(void, CAttributeManager_OnAttributeValuesChanged) { - DETOUR_MEMBER_CALL(CAttributeManager_OnAttributeValuesChanged)(); + DETOUR_MEMBER_CALL(); auto mgr = reinterpret_cast(this); OnAttributesChange(mgr); } DETOUR_DECL_MEMBER(void, CAttributeContainer_OnAttributeValuesChanged) { - DETOUR_MEMBER_CALL(CAttributeContainer_OnAttributeValuesChanged)(); + DETOUR_MEMBER_CALL(); auto mgr = reinterpret_cast(this); OnAttributesChange(mgr); } @@ -8559,7 +8580,7 @@ namespace Mod::Attr::Custom_Attributes auto mgr = reinterpret_cast(this); auto player = ToTFPlayer(mgr->m_hOuter); if (player != nullptr) { - DETOUR_MEMBER_CALL(CAttributeContainerPlayer_OnAttributeValuesChanged)(); + DETOUR_MEMBER_CALL(); /*auto &rec = mgr->m_Providers.Get(); FOR_EACH_VEC(rec, i) { //Msg("Receiver %s\n", ent->GetClassname()); @@ -9371,11 +9392,15 @@ namespace Mod::Attr::Custom_Attributes MOD_ADD_DETOUR_MEMBER(CTFPlayer_Spawn, "CTFPlayer::Spawn"); MOD_ADD_DETOUR_MEMBER(CTFWeaponBase_GetSpreadAngles, "CTFWeaponBase::GetSpreadAngles"); +// #ifdef PLATFORM_64BITS +// // SetRuntimeAttributeValue supports only 4 byte attributes, and on 64 bits, strings are 8 byte +// MOD_ADD_DETOUR_MEMBER(CSchemaAttributeType_String_BConvertStringToEconAttributeValue, "CSchemaAttributeType_String::BConvertStringToEconAttributeValue"); +// #endif MOD_ADD_DETOUR_MEMBER(CAttributeList_SetRuntimeAttributeValue, "CAttributeList::SetRuntimeAttributeValue"); MOD_ADD_DETOUR_MEMBER(CAttributeList_RemoveAttribute, "CAttributeList::RemoveAttribute"); MOD_ADD_DETOUR_MEMBER(CAttributeList_RemoveAttributeByIndex, "CAttributeList::RemoveAttributeByIndex"); MOD_ADD_DETOUR_MEMBER(CAttributeList_AddAttribute, "CAttributeList::AddAttribute"); - MOD_ADD_DETOUR_MEMBER(CAttributeList_DestroyAllAttributes, "CAttributeList::DestroyAllAttributes"); + MOD_ADD_DETOUR_MEMBER(CAttributeList_DestroyAllAttributes, "CAttributeList::DestroyAllAttributes"); MOD_ADD_DETOUR_MEMBER(CWeaponMedigun_RemoveHealingTarget, "CWeaponMedigun::RemoveHealingTarget"); MOD_ADD_DETOUR_MEMBER(CWeaponMedigun_StartHealingTarget, "CWeaponMedigun::StartHealingTarget"); diff --git a/src/mod/attr/customprojectilemodel_precache.cpp b/src/mod/attr/customprojectilemodel_precache.cpp index 7d4abd5f..b5d7277c 100644 --- a/src/mod/attr/customprojectilemodel_precache.cpp +++ b/src/mod/attr/customprojectilemodel_precache.cpp @@ -12,7 +12,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_GetCustomProjectileModel, CAttribute_String *attr_str) { - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_GetCustomProjectileModel)(attr_str); + DETOUR_MEMBER_CALL(attr_str); const char *model_path = nullptr; CopyStringAttributeValueToCharPointerOutput(attr_str, &model_path); @@ -48,7 +48,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache class CTFWeaponInfo; DETOUR_DECL_MEMBER(CBaseAnimating *, CTFJar_CreateJarProjectile, Vector const& vec, QAngle const& ang, Vector const& vec2, Vector const& vec3, CBaseCombatCharacter* thrower, CTFWeaponInfo const& info) { - auto proj = DETOUR_MEMBER_CALL(CTFJar_CreateJarProjectile)(vec, ang, vec2, vec3, thrower, info); + auto proj = DETOUR_MEMBER_CALL(vec, ang, vec2, vec3, thrower, info); if (proj != nullptr) { SetCustomProjectileModel(reinterpret_cast(this),proj); } @@ -56,7 +56,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache } DETOUR_DECL_MEMBER(CBaseAnimating *, CTFJarMilk_CreateJarProjectile, Vector const& vec, QAngle const& ang, Vector const& vec2, Vector const& vec3, CBaseCombatCharacter* thrower, CTFWeaponInfo const& info) { - auto proj = DETOUR_MEMBER_CALL(CTFJarMilk_CreateJarProjectile)(vec, ang, vec2, vec3, thrower, info); + auto proj = DETOUR_MEMBER_CALL(vec, ang, vec2, vec3, thrower, info); if (proj != nullptr) { SetCustomProjectileModel(reinterpret_cast(this),proj); } @@ -64,7 +64,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache } DETOUR_DECL_MEMBER(CBaseAnimating *, CTFJarGas_CreateJarProjectile, Vector const& vec, QAngle const& ang, Vector const& vec2, Vector const& vec3, CBaseCombatCharacter* thrower, CTFWeaponInfo const& info) { - auto proj = DETOUR_MEMBER_CALL(CTFJarGas_CreateJarProjectile)(vec, ang, vec2, vec3, thrower, info); + auto proj = DETOUR_MEMBER_CALL(vec, ang, vec2, vec3, thrower, info); if (proj != nullptr) { SetCustomProjectileModel(reinterpret_cast(this),proj); } @@ -72,7 +72,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache } DETOUR_DECL_MEMBER(CBaseAnimating *, CTFCleaver_CreateJarProjectile, Vector const& vec, QAngle const& ang, Vector const& vec2, Vector const& vec3, CBaseCombatCharacter* thrower, CTFWeaponInfo const& info) { - auto proj = DETOUR_MEMBER_CALL(CTFCleaver_CreateJarProjectile)(vec, ang, vec2, vec3, thrower, info); + auto proj = DETOUR_MEMBER_CALL(vec, ang, vec2, vec3, thrower, info); if (proj != nullptr) { SetCustomProjectileModel(reinterpret_cast(this),proj); } @@ -83,7 +83,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache { auto proj = reinterpret_cast(this); CBaseEntity *original = proj->GetOriginalLauncher(); - DETOUR_MEMBER_CALL(CBaseProjectile_SetLauncher)(launcher); + DETOUR_MEMBER_CALL(launcher); if (original == nullptr && launcher != nullptr && launcher->MyCombatWeaponPointer() != nullptr) { SetCustomProjectileModel(launcher->MyCombatWeaponPointer(),proj); } @@ -91,7 +91,7 @@ namespace Mod::Attr::CustomProjectileModel_Precache DETOUR_DECL_MEMBER(CBaseAnimating *, CTFWeaponBaseGun_FireProjectile, CTFPlayer *player) { - auto proj = DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); + auto proj = DETOUR_MEMBER_CALL(player); if (proj != nullptr) { auto weapon = reinterpret_cast(this); SetCustomProjectileModel(weapon,proj); diff --git a/src/mod/attr/healonkill_overheal_melee.cpp b/src/mod/attr/healonkill_overheal_melee.cpp index 5f15f60d..95b2c8a3 100644 --- a/src/mod/attr/healonkill_overheal_melee.cpp +++ b/src/mod/attr/healonkill_overheal_melee.cpp @@ -11,7 +11,7 @@ namespace Mod::Attr::HealOnKill_Overheal_Melee auto melee = rtti_cast(info.GetWeapon()); if (melee != nullptr) ++rc_MeleeHoK; - DETOUR_MEMBER_CALL(CTFPlayer_OnKilledOther_Effects)(other, info); + DETOUR_MEMBER_CALL(other, info); if (melee != nullptr) --rc_MeleeHoK; } @@ -22,7 +22,7 @@ namespace Mod::Attr::HealOnKill_Overheal_Melee bitsDamageType |= DMG_IGNORE_MAXHEALTH; } - return DETOUR_MEMBER_CALL(CTFPlayer_TakeHealth)(flHealth, bitsDamageType); + return DETOUR_MEMBER_CALL(flHealth, bitsDamageType); } diff --git a/src/mod/attr/undocumented.cpp b/src/mod/attr/undocumented.cpp index 1874e54b..9c090f52 100644 --- a/src/mod/attr/undocumented.cpp +++ b/src/mod/attr/undocumented.cpp @@ -25,7 +25,7 @@ namespace Mod::Attr::Undocumented return cvar_force_distribute_currency_on_death.GetFloat(); } - return DETOUR_STATIC_CALL(CAttributeManager_ApplyAttributeFloatWrapper)(val, ent, name, vec); + return DETOUR_STATIC_CALL(val, ent, name, vec); } diff --git a/src/mod/bot/bot_player_slot_reorder.cpp b/src/mod/bot/bot_player_slot_reorder.cpp index d8f33173..36c32e50 100644 --- a/src/mod/bot/bot_player_slot_reorder.cpp +++ b/src/mod/bot/bot_player_slot_reorder.cpp @@ -18,7 +18,7 @@ namespace Mod::Bot::Bot_Player_Slot_Reorder SCOPED_INCREMENT(rc_CBaseServer_CreateFakeClient); SCOPED_INCREMENT_IF(rc_CBaseServer_CreateFakeClient_HLTV, tv_name.GetString() == name); - return DETOUR_MEMBER_CALL(CBaseServer_CreateFakeClient)(name); + return DETOUR_MEMBER_CALL(name); } inline int GetHLTVSlot() @@ -47,7 +47,7 @@ namespace Mod::Bot::Bot_Player_Slot_Reorder // Create clients to fill all slots while (server->GetClientCount() != server->GetMaxClients()) { - CBaseClient *lastClient = DETOUR_MEMBER_CALL(CBaseServer_GetFreeClient)(adr); + CBaseClient *lastClient = DETOUR_MEMBER_CALL(adr); if (lastClient != nullptr) { clientList.push_back(lastClient); lastClient->m_bFakePlayer = true; @@ -83,7 +83,7 @@ namespace Mod::Bot::Bot_Player_Slot_Reorder return nullptr; } - auto client = DETOUR_MEMBER_CALL(CBaseServer_GetFreeClient)(adr); + auto client = DETOUR_MEMBER_CALL(adr); if (client != nullptr) { if (!rc_CBaseServer_CreateFakeClient_HLTV && client->GetPlayerSlot() == gpGlobals->maxClients - 1 && tv_enable.GetBool()) { return nullptr; diff --git a/src/mod/bot/interrupt_action.cpp b/src/mod/bot/interrupt_action.cpp index ebbfb9b4..de14a697 100644 --- a/src/mod/bot/interrupt_action.cpp +++ b/src/mod/bot/interrupt_action.cpp @@ -328,7 +328,7 @@ namespace Mod::Common::Interrupt_Action return EventDesiredResult::SuspendFor(CreateInterruptAction(actor, cmd), "Executing interrupt task"); } - return DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_OnCommandString)(actor, cmd); + return DETOUR_MEMBER_CALL(actor, cmd); } class CMod : public IMod diff --git a/src/mod/bot/isspacetospawnhere_scale.cpp b/src/mod/bot/isspacetospawnhere_scale.cpp index 19e5e44d..31688122 100644 --- a/src/mod/bot/isspacetospawnhere_scale.cpp +++ b/src/mod/bot/isspacetospawnhere_scale.cpp @@ -53,7 +53,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale SCOPED_INCREMENT_IF(rc_CTFBotSpawner_Spawn, the_bot_scale != 1.0f && cvar_botspawnfix.GetBool()); - return DETOUR_MEMBER_CALL(CTFBotSpawner_Spawn)(where, ents); + return DETOUR_MEMBER_CALL(where, ents); } @@ -66,7 +66,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale the_spy_scale = spy->GetModelScale(); SCOPED_INCREMENT_IF(rc_TeleportNearVictim, the_spy_scale != 1.0f); - return DETOUR_STATIC_CALL(TeleportNearVictim)(spy, victim, dist); + return DETOUR_STATIC_CALL(spy, victim, dist); } @@ -78,7 +78,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale the_pos = &pos; if (cvar_debug.GetBool()) DevMsg("\nIsSpaceToSpawnHere BEGIN @ %.7f\n", Plat_FloatTime()); - auto result = DETOUR_STATIC_CALL(IsSpaceToSpawnHere)(pos); + auto result = DETOUR_STATIC_CALL(pos); if (cvar_debug.GetBool()) DevMsg("IsSpaceToSpawnHere END @ %.7f\n\n", Plat_FloatTime()); return result; } @@ -99,7 +99,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale bool isbotmvm = player->IsBot() && TFGameRules()->IsMannVsMachineMode(); - int result = DETOUR_MEMBER_CALL(CTFGameMovement_CheckStuck)(); + int result = DETOUR_MEMBER_CALL(); if (isbotmvm) TFGameRules()->Set_m_bPlayingMannVsMachine(true); @@ -185,7 +185,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale old_scale_map[player] = player->GetModelScale(); - DETOUR_MEMBER_CALL(CTFPlayerShared_OnAddHalloweenTiny)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, IEngineTrace_TraceRay, const Ray_t& ray, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace) @@ -224,7 +224,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale NDebugOverlay::Box(*the_pos, vecMins, vecMaxs, 0xff, 0xff, 0xff, 0x40, 10.0f); } - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray_alt, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray_alt, fMask, pTraceFilter, pTrace); return; } @@ -259,13 +259,13 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale NDebugOverlay::Box(*the_pos, vecMins, vecMaxs, 0xff, 0xff, 0xff, 0x40, 10.0f); } - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray_alt, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray_alt, fMask, pTraceFilter, pTrace); return; } } if (stuck_player != nullptr) { - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); //Hit world entity, teleporting player away if possible if (pTrace->startsolid && (pTrace->m_pEnt == nullptr || ENTINDEX(pTrace->m_pEnt) == 0)) { @@ -287,7 +287,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale ray_alt.m_Start = ray.m_Start + vTest[i]; trace_t trace_alt; - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray_alt, fMask, pTraceFilter, &trace_alt); + DETOUR_MEMBER_CALL(ray_alt, fMask, pTraceFilter, &trace_alt); if ( !(trace_alt.startsolid && (trace_alt.m_pEnt == nullptr || ENTINDEX(trace_alt.m_pEnt) == 0)) ) { @@ -312,7 +312,7 @@ namespace Mod::Bot::IsSpaceToSpawnHere_Scale return; } - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); if (isbotmvm) TFGameRules()->Set_m_bPlayingMannVsMachine(false); diff --git a/src/mod/bot/kart_locomotion.cpp b/src/mod/bot/kart_locomotion.cpp index d98de3f2..1726f2a2 100644 --- a/src/mod/bot/kart_locomotion.cpp +++ b/src/mod/bot/kart_locomotion.cpp @@ -36,7 +36,7 @@ namespace Mod::Bot::Kart_Locomotion return; } - DETOUR_MEMBER_CALL(CTFBotMainAction_Dodge)(); + DETOUR_MEMBER_CALL(); } /* don't strafe and jump around when stuck */ @@ -46,7 +46,7 @@ namespace Mod::Bot::Kart_Locomotion return EventDesiredResult::Continue(); } - return DETOUR_MEMBER_CALL(CTFBotMainAction_OnStuck)(actor); + return DETOUR_MEMBER_CALL(actor); } @@ -56,7 +56,7 @@ namespace Mod::Bot::Kart_Locomotion auto loco = reinterpret_cast(this); CTFBot *bot = ToTFBot(loco->GetBot()->GetEntity()); - DETOUR_MEMBER_CALL(PlayerLocomotion_Approach)(dst, f1); + DETOUR_MEMBER_CALL(dst, f1); if (bot != nullptr && bot->m_Shared->InCond(TF_COND_HALLOWEEN_KART)) { diff --git a/src/mod/bot/kill_before_forcespec.cpp b/src/mod/bot/kill_before_forcespec.cpp index c6adb073..11d6e26f 100644 --- a/src/mod/bot/kill_before_forcespec.cpp +++ b/src/mod/bot/kill_before_forcespec.cpp @@ -16,7 +16,7 @@ namespace Mod::Bot::Kill_Before_ForceSpec ENTINDEX(bot), bot->GetTeamNumber(), bot->GetHealth(), (bot->IsAlive() ? "true" : "false")); } - return DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } @@ -40,7 +40,7 @@ namespace Mod::Bot::Kill_Before_ForceSpec } } - DETOUR_MEMBER_CALL(CTFPlayer_ForceChangeTeam)(iTeamNum, b1); + DETOUR_MEMBER_CALL(iTeamNum, b1); } @@ -57,7 +57,7 @@ namespace Mod::Bot::Kill_Before_ForceSpec return; } - DETOUR_MEMBER_CALL(CTFBot_ChangeTeam)(iTeamNum, bAutoTeam, bSilent, b3); + DETOUR_MEMBER_CALL(iTeamNum, bAutoTeam, bSilent, b3); } diff --git a/src/mod/bot/medieval_nonmelee.cpp b/src/mod/bot/medieval_nonmelee.cpp index 16967d9c..242ab7d3 100644 --- a/src/mod/bot/medieval_nonmelee.cpp +++ b/src/mod/bot/medieval_nonmelee.cpp @@ -79,7 +79,7 @@ namespace Mod::Bot::Medieval_NonMelee TFGameRules()->Set_m_bPlayingMedieval(false); } - DETOUR_MEMBER_CALL(CTFBot_OnEventChangeAttributes)(ecattr); + DETOUR_MEMBER_CALL(ecattr); if (TFGameRules()->IsMannVsMachineMode() && player->IsBot()) { TFGameRules()->Set_m_bPlayingMedieval(medieval); diff --git a/src/mod/bot/runfast.cpp b/src/mod/bot/runfast.cpp index d2cf2ab3..7cb9caff 100644 --- a/src/mod/bot/runfast.cpp +++ b/src/mod/bot/runfast.cpp @@ -96,7 +96,7 @@ namespace Mod::Bot::RunFast reinterpret_cast(actor->MyNextBotPointer())->m_bScheduledForNextTick = true; } - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } ConVar cvar_jump("sig_bot_runfast_allowjump", "0", FCVAR_GAMEDLL, @@ -106,7 +106,7 @@ namespace Mod::Bot::RunFast { /* don't let bots try to jump without autojump, it just slows them down */ if ( rc_CTFBotMainAction_Update || cvar_jump.GetBool() || reinterpret_cast(this)->GetRunSpeed() < 350.0f) - DETOUR_MEMBER_CALL(PlayerLocomotion_Jump)(); + DETOUR_MEMBER_CALL(); } class CMod : public IMod diff --git a/src/mod/bot/spy_selectrandomreachableenemy.cpp b/src/mod/bot/spy_selectrandomreachableenemy.cpp index 923adc0a..01e28cba 100644 --- a/src/mod/bot/spy_selectrandomreachableenemy.cpp +++ b/src/mod/bot/spy_selectrandomreachableenemy.cpp @@ -39,7 +39,7 @@ namespace Mod::Bot::Spy_SelectRandomReachableEnemy DETOUR_DECL_MEMBER(CTFPlayer *, CTFBot_SelectRandomReachableEnemy) { bot = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFBot_SelectRandomReachableEnemy)(); + auto result = DETOUR_MEMBER_CALL(); bot = nullptr; return result; @@ -52,7 +52,7 @@ namespace Mod::Bot::Spy_SelectRandomReachableEnemy CTFPlayer *player = action->m_chasePlayer; if (player != nullptr && actor->GetVisionInterface()->IsIgnored(player)) action->m_chasePlayer = nullptr; - auto result = DETOUR_MEMBER_CALL(CTFBotAttackFlagDefenders_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); return result; } @@ -60,7 +60,7 @@ namespace Mod::Bot::Spy_SelectRandomReachableEnemy { if (bot != nullptr) { CUtlVector tempVector; - DETOUR_STATIC_CALL(CollectPlayers_CTFPlayer)(&tempVector, team, isAlive, shouldAppend); + DETOUR_STATIC_CALL(&tempVector, team, isAlive, shouldAppend); for (auto player : tempVector) { if (!bot->GetVisionInterface()->IsIgnored(player)) @@ -69,7 +69,7 @@ namespace Mod::Bot::Spy_SelectRandomReachableEnemy return playerVector->Count(); } - return DETOUR_STATIC_CALL(CollectPlayers_CTFPlayer)(playerVector, team, isAlive, shouldAppend); + return DETOUR_STATIC_CALL(playerVector, team, isAlive, shouldAppend); } // ISSUE: the callers of SelectRandomReachableEnemy may hang onto the enemy diff --git a/src/mod/canteen/share_recall_canteen.cpp b/src/mod/canteen/share_recall_canteen.cpp index c35f78a1..5c0277f5 100644 --- a/src/mod/canteen/share_recall_canteen.cpp +++ b/src/mod/canteen/share_recall_canteen.cpp @@ -15,7 +15,7 @@ namespace Mod::Canteen::Share_Recall_Canteen int canteen_specialist; DETOUR_DECL_STATIC(int, CAttributeManager_AttribHookValue_int, int value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) { - auto result = DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_int)(value, attr, ent, vec, b1); + auto result = DETOUR_STATIC_CALL(value, attr, ent, vec, b1); if (rc_CTFPowerupBottle_ReapplyProvision > 0 && !got_attr && value == 0 && V_stricmp(attr, "canteen_specialist") == 0) { canteen_specialist = result; @@ -38,7 +38,7 @@ namespace Mod::Canteen::Share_Recall_Canteen got_cond = true; } - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } @@ -63,7 +63,7 @@ namespace Mod::Canteen::Share_Recall_Canteen got_cond = false; ++rc_CTFPowerupBottle_ReapplyProvision; - DETOUR_MEMBER_CALL(CTFPowerupBottle_ReapplyProvision)(); + DETOUR_MEMBER_CALL(); --rc_CTFPowerupBottle_ReapplyProvision; if (!got_attr || !got_cond) return; diff --git a/src/mod/common/commands.cpp b/src/mod/common/commands.cpp index 627b346a..daf0a6c9 100644 --- a/src/mod/common/commands.cpp +++ b/src/mod/common/commands.cpp @@ -82,7 +82,7 @@ namespace Mod::Common::Commands } if (*p != '!' && *p != '/') { - DETOUR_STATIC_CALL(Host_Say)(edict, args, team); + DETOUR_STATIC_CALL(edict, args, team); return; } p++; @@ -114,7 +114,7 @@ namespace Mod::Common::Commands return; } } - DETOUR_STATIC_CALL(Host_Say)(edict, args, team); + DETOUR_STATIC_CALL(edict, args, team); } DETOUR_DECL_MEMBER(bool, CBasePlayer_ClientCommand, const CCommand& args) @@ -138,12 +138,12 @@ namespace Mod::Common::Commands } } - return DETOUR_MEMBER_CALL(CBasePlayer_ClientCommand)(args); + return DETOUR_MEMBER_CALL(args); } DETOUR_DECL_MEMBER(void, CServerGameClients_ClientPutInServer, edict_t *edict, const char *playername) { - DETOUR_MEMBER_CALL(CServerGameClients_ClientPutInServer)(edict, playername); + DETOUR_MEMBER_CALL(edict, playername); ClientMsg((CBasePlayer *)GetContainingEntity(edict), "rafradek's srcds performance optimizer loaded\n"); } diff --git a/src/mod/common/common.cpp b/src/mod/common/common.cpp index befea22f..a4d6f6e6 100644 --- a/src/mod/common/common.cpp +++ b/src/mod/common/common.cpp @@ -49,7 +49,7 @@ namespace Mod::Common::Common } } - bool ignored = DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + bool ignored = DETOUR_MEMBER_CALL(ent); if (restoreTeam != -1) { player->m_Shared->m_nDisguiseTeam = restoreTeam; @@ -75,7 +75,7 @@ namespace Mod::Common::Common return entityme->GetTeamNumber() != entityhit->GetTeamNumber() || !entityhit->IsPlayer(); } - bool result = DETOUR_MEMBER_CALL(CTraceFilterObject_ShouldHitEntity)(pServerEntity, contentsMask); + bool result = DETOUR_MEMBER_CALL(pServerEntity, contentsMask); if (result) { @@ -106,7 +106,7 @@ namespace Mod::Common::Common DETOUR_DECL_STATIC_CALL_CONVENTION(__gcc_regcall, bool, PassServerEntityFilter, IHandleEntity *ent1, IHandleEntity *ent2) { - auto ret = DETOUR_STATIC_CALL(PassServerEntityFilter)(ent1, ent2); + auto ret = DETOUR_STATIC_CALL(ent1, ent2); { if (ret) { auto entity1 = EntityFromEntityHandle(ent1); diff --git a/src/mod/common/extraentitydata.cpp b/src/mod/common/extraentitydata.cpp index baa23f8f..dc49ecce 100644 --- a/src/mod/common/extraentitydata.cpp +++ b/src/mod/common/extraentitydata.cpp @@ -56,7 +56,7 @@ namespace Mod::Etc::ExtraEntityData { DETOUR_DECL_MEMBER(void, CBaseEntity_CBaseEntity, bool flag) { - DETOUR_MEMBER_CALL(CBaseEntity_CBaseEntity)(flag); + DETOUR_MEMBER_CALL(flag); /*auto entity = reinterpret_cast(this); if (entity->IsPlayer()) { entity->m_extraEntityData = new ExtraEntityDataPlayer(entity); @@ -74,7 +74,7 @@ namespace Mod::Etc::ExtraEntityData // delete entity->m_extraEntityData; // entity->m_extraEntityData = nullptr; // } - DETOUR_MEMBER_CALL(CBaseEntity_D2)(); + DETOUR_MEMBER_CALL(); } class CMod : public IMod diff --git a/src/mod/common/weapon_shoot.cpp b/src/mod/common/weapon_shoot.cpp index 57fe368e..fccb6e64 100644 --- a/src/mod/common/weapon_shoot.cpp +++ b/src/mod/common/weapon_shoot.cpp @@ -162,31 +162,31 @@ namespace Mod::Common::Weapon_Shoot } } - return DETOUR_MEMBER_CALL(CTFGameRules_FPlayerCanTakeDamage)(pPlayer, pAttacker, info); + return DETOUR_MEMBER_CALL(pPlayer, pAttacker, info); } DETOUR_DECL_STATIC(CTFWeaponBase *, GetKilleaterWeaponFromDamageInfo, CTakeDamageInfo &info) { if (info.GetWeapon() != nullptr && info.GetWeapon()->MyCombatWeaponPointer() != nullptr && info.GetWeapon()->MyCombatWeaponPointer()->GetOwner() == nullptr) return nullptr; - return DETOUR_STATIC_CALL(GetKilleaterWeaponFromDamageInfo)( info); + return DETOUR_STATIC_CALL( info); } DETOUR_DECL_STATIC(void, EconItemInterface_OnOwnerKillEaterEvent_Batched, void *pEconInterface, class CTFPlayer *pOwner, class CTFPlayer *pVictim, int eEventType, int nIncrementValue) { if (pOwner == nullptr) return; - DETOUR_STATIC_CALL(EconItemInterface_OnOwnerKillEaterEvent_Batched)(pEconInterface, pOwner, pVictim, eEventType, nIncrementValue); + DETOUR_STATIC_CALL(pEconInterface, pOwner, pVictim, eEventType, nIncrementValue); } DETOUR_DECL_STATIC(void, EconItemInterface_OnOwnerKillEaterEvent, void *pEconEntity, CTFPlayer *pOwner, CTFPlayer *pVictim, int eEventType, int nIncrementValue) { if (pOwner == nullptr) return; - DETOUR_STATIC_CALL(EconItemInterface_OnOwnerKillEaterEvent)(pEconEntity, pOwner, pVictim, eEventType, nIncrementValue); + DETOUR_STATIC_CALL(pEconEntity, pOwner, pVictim, eEventType, nIncrementValue); } DETOUR_DECL_MEMBER(void, CTFPlayer_Event_Killed, const CTakeDamageInfo& info) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); CBaseEntity *observer = player->m_hObserverTarget; if (info.GetInflictor() != nullptr) { variant_t var; @@ -206,7 +206,7 @@ namespace Mod::Common::Weapon_Shoot if (info.GetWeapon() != nullptr && info.GetWeapon()->GetCustomVariableBool<"istempowner">()) { infoc.SetAttacker(info.GetInflictor()); } - DETOUR_MEMBER_CALL(CTFGameRules_DeathNotice)(pVictim, infoc, eventName); + DETOUR_MEMBER_CALL(pVictim, infoc, eventName); } class CDmgAccumulator; @@ -223,34 +223,34 @@ namespace Mod::Common::Weapon_Shoot info.SetInflictor(shooting_weapon); } } - DETOUR_MEMBER_CALL(CBaseEntity_DispatchTraceAttack)(info, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(info, vecDir, ptr, pAccumulator); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_RemoveProjectileAmmo, CTFPlayer *player) { if (rc_FireWeapon_RemoveAmmo) return; - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_RemoveProjectileAmmo)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_UpdatePunchAngles, CTFPlayer *player) { if (rc_FireWeapon) return; - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_UpdatePunchAngles)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_DoFireEffects) { if (rc_FireWeapon) return; - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_DoFireEffects)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_DoAnimationEvent, PlayerAnimEvent_t event, int data) { if (rc_FireWeapon) return; - DETOUR_MEMBER_CALL(CTFPlayer_DoAnimationEvent)(event, data); + DETOUR_MEMBER_CALL(event, data); } DETOUR_DECL_MEMBER(void, CTFProjectile_Flare_SendDeathNotice) @@ -258,7 +258,7 @@ namespace Mod::Common::Weapon_Shoot auto flare = reinterpret_cast(this); if (flare->GetOwnerEntity() != nullptr && ToTFPlayer(flare->GetOwnerEntity()) == nullptr) return; - DETOUR_MEMBER_CALL(CTFProjectile_Flare_SendDeathNotice)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_WeaponSound, int index, float soundtime) @@ -270,11 +270,11 @@ namespace Mod::Common::Weapon_Shoot auto me = reinterpret_cast(this); auto oldOwner = me->GetOwner(); me->SetOwner(nullptr); - DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); + DETOUR_MEMBER_CALL(index, soundtime); me->SetOwner(oldOwner); } else { - DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); + DETOUR_MEMBER_CALL(index, soundtime); } } @@ -297,7 +297,7 @@ namespace Mod::Common::Weapon_Shoot info.SetDamage(info.GetDamage() * 3); } - auto result = DETOUR_MEMBER_CALL(CTFGameRules_ApplyOnDamageModifyRules)(info, pVictim, b1); + auto result = DETOUR_MEMBER_CALL(info, pVictim, b1); if (info.GetAttacker() == nullptr || !info.GetAttacker()->IsPlayer()) { auto playerVictim = ToTFPlayer(pVictim); @@ -329,7 +329,7 @@ namespace Mod::Common::Weapon_Shoot // Msg("Trace do %d %d\n", filter, simpleFilter); // } - // return DETOUR_STATIC_CALL(UTIL_PlayerBulletTrace)(vec1, vec2, vec3, val1, filter, trace); + // return DETOUR_STATIC_CALL(vec1, vec2, vec3, val1, filter, trace); // } DETOUR_DECL_MEMBER(void, CTraceFilterSimple_CTraceFilterSimple, const IHandleEntity *passentity, int collisionGroup, ShouldHitFunc_t pExtraShouldHitCheckFn) @@ -338,7 +338,7 @@ namespace Mod::Common::Weapon_Shoot passentity = shooting_shooter; } - return DETOUR_MEMBER_CALL(CTraceFilterSimple_CTraceFilterSimple)(passentity, collisionGroup, pExtraShouldHitCheckFn); + return DETOUR_MEMBER_CALL(passentity, collisionGroup, pExtraShouldHitCheckFn); } DETOUR_DECL_MEMBER(void, CTFProjectile_BallOfFire_Burn, CBaseEntity *entity) @@ -348,14 +348,14 @@ namespace Mod::Common::Weapon_Shoot if ((owner == nullptr || !owner->IsPlayer())) { reinterpret_cast(this)->m_bLandedBonusDamage = true; } - DETOUR_MEMBER_CALL(CTFProjectile_BallOfFire_Burn)(entity); + DETOUR_MEMBER_CALL(entity); } DETOUR_DECL_STATIC(void, TE_FireBullets, int iPlayerIndex, const Vector &vOrigin, const QAngle &vAngles, int iWeaponID, int iMode, int iSeed, float flSpread, bool bCritical) { if (rc_FireWeapon) return; - DETOUR_STATIC_CALL(TE_FireBullets)(iPlayerIndex, vOrigin, vAngles, iWeaponID, iMode, iSeed, flSpread, bCritical); + DETOUR_STATIC_CALL(iPlayerIndex, vOrigin, vAngles, iWeaponID, iMode, iSeed, flSpread, bCritical); } int customDamageTypeBullet = 0; @@ -377,7 +377,7 @@ namespace Mod::Common::Weapon_Shoot SCOPED_INCREMENT_IF(rc_FireWeaponDoTrace, doTrace); - DETOUR_MEMBER_CALL(CTFPlayer_FireBullet)(weapon, info, bDoEffects, nDamageType, nCustomDamageType); + DETOUR_MEMBER_CALL(weapon, info, bDoEffects, nDamageType, nCustomDamageType); } DETOUR_DECL_MEMBER(void, CTFPlayer_MaybeDrawRailgunBeam, IRecipientFilter *filter, CTFWeaponBase *weapon, const Vector &vStartPos, const Vector &vEndPos) @@ -389,14 +389,14 @@ namespace Mod::Common::Weapon_Shoot auto tracerName = reinterpret_cast(this)->GetTracerType(); DispatchParticleEffect(isCritTrace ? CFmtStr("%s_crit", tracerName).Get() : tracerName, PATTACH_ABSORIGIN, nullptr, nullptr, vStartPos, true, vec3_origin, vec3_origin, false, false, &cp, nullptr); } - DETOUR_MEMBER_CALL(CTFPlayer_MaybeDrawRailgunBeam)(filter, weapon, vStartPos, vEndPos); + DETOUR_MEMBER_CALL(filter, weapon, vStartPos, vEndPos); } DETOUR_DECL_MEMBER(void, CLagCompensationManager_StartLagCompensation, CBasePlayer *player, CUserCmd *cmd) { if (cmd == nullptr) return; - DETOUR_MEMBER_CALL(CLagCompensationManager_StartLagCompensation)(player, cmd); + DETOUR_MEMBER_CALL(player, cmd); } DETOUR_DECL_MEMBER(void, CTFProjectile_Flare_Explode_Air, trace_t *pTrace, int bitsDamageType, bool bSelfOnly) @@ -404,7 +404,7 @@ namespace Mod::Common::Weapon_Shoot auto flare = reinterpret_cast(this); if (ToTFPlayer(flare->GetOwnerEntity()) == nullptr) flare->SetOwnerEntity(nullptr); - DETOUR_MEMBER_CALL(CTFProjectile_Flare_Explode_Air)(pTrace, bitsDamageType, bSelfOnly); + DETOUR_MEMBER_CALL(pTrace, bitsDamageType, bSelfOnly); } DETOUR_DECL_MEMBER(void, CTFBall_Ornament_Explode, trace_t *pTrace, int bitsDamageType) @@ -423,7 +423,7 @@ namespace Mod::Common::Weapon_Shoot proj->Remove(); return; } - DETOUR_MEMBER_CALL(CTFBall_Ornament_Explode)(pTrace, bitsDamageType); + DETOUR_MEMBER_CALL(pTrace, bitsDamageType); } class CMod : public IMod diff --git a/src/mod/cond/enhanced_cmds.cpp b/src/mod/cond/enhanced_cmds.cpp index 3c2361df..0beb777e 100644 --- a/src/mod/cond/enhanced_cmds.cpp +++ b/src/mod/cond/enhanced_cmds.cpp @@ -58,7 +58,7 @@ namespace Mod::Cond::Enhanced_Cmds return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_ClientCommand)(args); + return DETOUR_MEMBER_CALL(args); } diff --git a/src/mod/cond/reprogrammed.cpp b/src/mod/cond/reprogrammed.cpp index 3a25f720..f7554d75 100644 --- a/src/mod/cond/reprogrammed.cpp +++ b/src/mod/cond/reprogrammed.cpp @@ -600,7 +600,7 @@ namespace Mod::Cond::Reprogrammed player->SetCustomVariable<"KilledAsNeutral">(Variant(false)); } - DETOUR_MEMBER_CALL(CTFPlayer_Spawn)(); + DETOUR_MEMBER_CALL(); } void OnRemoveReprogrammedNeutral(CTFPlayer *player) @@ -642,7 +642,7 @@ namespace Mod::Cond::Reprogrammed return iWantedTeam; } - return DETOUR_MEMBER_CALL(CTFGameRules_GetTeamAssignmentOverride)(pPlayer, iWantedTeam, b1); + return DETOUR_MEMBER_CALL(pPlayer, iWantedTeam, b1); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_OnConditionAdded, ETFCond cond) @@ -659,7 +659,7 @@ namespace Mod::Cond::Reprogrammed return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_OnConditionAdded)(cond); + DETOUR_MEMBER_CALL(cond); if (cond == TF_COND_MVM_BOT_STUN_RADIOWAVE) { OnAddMVMBotRadiowave(shared->GetOuter()); } @@ -678,7 +678,7 @@ namespace Mod::Cond::Reprogrammed OnRemoveReprogrammedNeutral(shared->GetOuter()); return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_OnConditionRemoved)(cond); + DETOUR_MEMBER_CALL(cond); } @@ -688,13 +688,13 @@ namespace Mod::Cond::Reprogrammed return ActionResult::Continue(); } - return DETOUR_MEMBER_CALL(CTFBotScenarioMonitor_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } DETOUR_DECL_MEMBER(ActionResult, CTFBotMainAction_Update, CTFBot *actor, float dt) { - auto result = DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (result.transition == ActionTransition::CONTINUE && TFGameRules()->IsMannVsMachineMode() && actor->GetTeamNumber() != TF_TEAM_BLUE) { @@ -722,13 +722,13 @@ namespace Mod::Cond::Reprogrammed return nullptr; } - return DETOUR_MEMBER_CALL(CTFPlayer_FindPartnerTauntInitiator)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFGameRules_BetweenRounds_Start) { - DETOUR_MEMBER_CALL(CTFGameRules_BetweenRounds_Start)(); + DETOUR_MEMBER_CALL(); if (cvar_hellmet.GetBool() && TFGameRules()->IsMannVsMachineMode()) { // for (int i = 0; i < IBaseObjectAutoList::AutoList().Count(); ++i) { @@ -754,7 +754,7 @@ namespace Mod::Cond::Reprogrammed //Red giant backstab instakill fix DETOUR_DECL_MEMBER(float, CTFKnife_GetMeleeDamage, CBaseEntity *pTarget, int* piDamageType, int* piCustomDamage) { - float ret = DETOUR_MEMBER_CALL(CTFKnife_GetMeleeDamage)(pTarget, piDamageType, piCustomDamage); + float ret = DETOUR_MEMBER_CALL(pTarget, piDamageType, piCustomDamage); if (pTarget->IsPlayer() && ret == pTarget->GetHealth() * 2 && ToTFPlayer(pTarget)->IsMiniBoss()) { CTFKnife *weapon = reinterpret_cast(this); @@ -779,7 +779,7 @@ namespace Mod::Cond::Reprogrammed DETOUR_DECL_MEMBER(void, CTFBotMissionSuicideBomber_Detonate, CTFBot *actor) { SCOPED_INCREMENT(rc_CTFBotMissionSuicideBomber_Detonate); - DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_Detonate)(actor); + DETOUR_MEMBER_CALL(actor); } DETOUR_DECL_MEMBER(int, CTFPlayer_OnTakeDamage, const CTakeDamageInfo& info) @@ -794,11 +794,11 @@ namespace Mod::Cond::Reprogrammed { CTakeDamageInfo newinfo = info; newinfo.SetDamage( 600.f ); - return DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(newinfo); + return DETOUR_MEMBER_CALL(newinfo); } } - return DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(int, CBaseCombatCharacter_OnTakeDamage, const CTakeDamageInfo& info) @@ -808,15 +808,15 @@ namespace Mod::Cond::Reprogrammed if (!character->IsPlayer() && !character->IsBaseObject()) { CTakeDamageInfo newinfo = info; newinfo.SetDamage( 600.f ); - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(newinfo); + return DETOUR_MEMBER_CALL(newinfo); } } - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(ActionResult, CTFBotMedicHeal_Update, CTFBot *actor, float dt) { - auto result = DETOUR_MEMBER_CALL(CTFBotMedicHeal_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (cvar_hellmet.GetBool() && actor->GetTeamNumber() != TF_TEAM_BLUE && TFGameRules()->IsMannVsMachineMode()) { bool is_changeto_fetchflag = @@ -840,7 +840,7 @@ namespace Mod::Cond::Reprogrammed DETOUR_DECL_MEMBER(bool, CObjectSapper_IsValidRoboSapperTarget, CTFPlayer *player) { - auto result = DETOUR_MEMBER_CALL(CObjectSapper_IsValidRoboSapperTarget)(player); + auto result = DETOUR_MEMBER_CALL(player); auto builder = reinterpret_cast(this)->GetBuilder(); return result || (player != nullptr && !(builder != nullptr && player->GetTeamNumber() == builder->GetTeamNumber()) && player->IsAlive() && player->m_Shared->InCond(TF_COND_REPROGRAMMED) && !player->m_Shared->IsInvulnerable() && !player->m_Shared->InCond(TF_COND_SAPPED)); } @@ -868,7 +868,7 @@ namespace Mod::Cond::Reprogrammed team = GetEnemyTeam(ourTeam); setDisguiseTeamToSpec = true; } - DETOUR_MEMBER_CALL(CTFPlayerShared_Disguise)(team, iclass, victim, onKill); + DETOUR_MEMBER_CALL(team, iclass, victim, onKill); if (setDisguiseTeamToSpec) { shared->m_nDesiredDisguiseTeam = TEAM_SPECTATOR; } @@ -879,7 +879,7 @@ namespace Mod::Cond::Reprogrammed DETOUR_DECL_MEMBER(void, CTFPlayer_ModifyOrAppendCriteria, void *criteria) { SCOPED_INCREMENT_IF(rc_CTFPlayer_ModifyOrAppendCriteria, TFGameRules()->IsMannVsMachineMode() && *(reinterpret_cast(this)->GetPlayerClass()->GetCustomModel()) != 0 ); - DETOUR_MEMBER_CALL(CTFPlayer_ModifyOrAppendCriteria)(criteria); + DETOUR_MEMBER_CALL(criteria); } DETOUR_DECL_STATIC(bool, TF_IsHolidayActive) @@ -887,7 +887,7 @@ namespace Mod::Cond::Reprogrammed if (rc_CTFPlayer_ModifyOrAppendCriteria) return false; else - return DETOUR_STATIC_CALL(TF_IsHolidayActive)(); + return DETOUR_STATIC_CALL(); } RefCount rc_CTFGameRules_FireGameEvent__teamplay_round_start; @@ -895,7 +895,7 @@ namespace Mod::Cond::Reprogrammed { SCOPED_INCREMENT_IF(rc_CTFGameRules_FireGameEvent__teamplay_round_start, (event != nullptr && strcmp(event->GetName(), "teamplay_round_start") == 0)); - DETOUR_MEMBER_CALL(CTFGameRules_FireGameEvent)(event); + DETOUR_MEMBER_CALL(event); } RefCount rc_CBaseObject_FindSnapToBuildPos; @@ -955,14 +955,14 @@ namespace Mod::Cond::Reprogrammed CollectPlayers(playerVector, TF_TEAM_RED, isAlive, shouldAppend); CollectPlayers(playerVector, TF_TEAM_BLUE, isAlive, true); } - return DETOUR_STATIC_CALL(CollectPlayers_CTFPlayer)(playerVector, team, isAlive, shouldAppend); + return DETOUR_STATIC_CALL(playerVector, team, isAlive, shouldAppend); } int getteam = -1; DETOUR_DECL_MEMBER(bool, CObjectSentrygun_FindTarget) { auto sentry = reinterpret_cast(this); - bool result = DETOUR_MEMBER_CALL(CObjectSentrygun_FindTarget)(); + bool result = DETOUR_MEMBER_CALL(); if (!result){ if (sentry->GetTeamNumber() > TEAM_SPECTATOR) { @@ -979,7 +979,7 @@ namespace Mod::Cond::Reprogrammed } if (objs || hasplayers) { getteam = TEAM_SPECTATOR; - result = DETOUR_MEMBER_CALL(CObjectSentrygun_FindTarget)(); + result = DETOUR_MEMBER_CALL(); } } else if (sentry->GetTeamNumber() == TEAM_SPECTATOR) { @@ -996,7 +996,7 @@ namespace Mod::Cond::Reprogrammed } if (objs || hasplayers) { getteam = TF_TEAM_RED; - result = DETOUR_MEMBER_CALL(CObjectSentrygun_FindTarget)(); + result = DETOUR_MEMBER_CALL(); } } } @@ -1008,13 +1008,13 @@ namespace Mod::Cond::Reprogrammed { if (getteam >= 0) team = getteam; - return DETOUR_MEMBER_CALL(CTFTeamManager_GetTeam)(team); + return DETOUR_MEMBER_CALL(team); } DETOUR_DECL_MEMBER(bool, NextBotPlayer_CTFPlayer_IsBot) { auto *bot = reinterpret_cast *>(this); - return DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_IsBot)() && !(bot->GetTeamNumber() == TEAM_SPECTATOR && bot->IsAlive()); + return DETOUR_MEMBER_CALL() && !(bot->GetTeamNumber() == TEAM_SPECTATOR && bot->IsAlive()); } CDetour *detour_isbot = nullptr; @@ -1034,7 +1034,7 @@ namespace Mod::Cond::Reprogrammed team_spec->RemovePlayerNonVirtual(bot); } - bool result = DETOUR_MEMBER_CALL(CTFBotSpawner_Spawn)(where, ents); + bool result = DETOUR_MEMBER_CALL(where, ents); for (CBasePlayer *bot : spec_players) { team_spec->AddPlayerNonVirtual(bot); @@ -1046,7 +1046,7 @@ namespace Mod::Cond::Reprogrammed DETOUR_DECL_MEMBER(void, CWave_ActiveWaveUpdate) { auto wave = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CWave_ActiveWaveUpdate)(); + DETOUR_MEMBER_CALL(); if (wave->IsDoneWithNonSupportWaves()) { for (int i = 1; i < gpGlobals->maxClients; i++) { CBasePlayer *player = UTIL_PlayerByIndex(i); @@ -1084,7 +1084,7 @@ namespace Mod::Cond::Reprogrammed } } } - return DETOUR_MEMBER_CALL(CTraceFilterObject_ShouldHitEntity)(pServerEntity, contentsMask); + return DETOUR_MEMBER_CALL(pServerEntity, contentsMask); } RefCount rc_CTFBot_Event_Killed; @@ -1093,7 +1093,7 @@ namespace Mod::Cond::Reprogrammed static ConVarRef cvar_player_team("sig_mvm_jointeam_blue_allow_force"); auto bot = reinterpret_cast(this); SCOPED_INCREMENT_IF(rc_CTFBot_Event_Killed, cvar_player_team.GetBool() || bot->GetTeamNumber() == TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFBot_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(bool, IGameEventManager2_FireEvent, IGameEvent *event, bool bDontBroadcast) @@ -1104,7 +1104,7 @@ namespace Mod::Cond::Reprogrammed return false; } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } DETOUR_DECL_MEMBER(bool, CTFBotMedicHeal_IsVisibleToEnemy, CTFBot *me, const Vector &where) @@ -1113,7 +1113,7 @@ namespace Mod::Cond::Reprogrammed return false; } - return DETOUR_MEMBER_CALL(CTFBotMedicHeal_IsVisibleToEnemy)(me, where); + return DETOUR_MEMBER_CALL(me, where); } RefCount rc_CTFPlayer_ApplyPushFromDamage_block; @@ -1132,7 +1132,7 @@ namespace Mod::Cond::Reprogrammed } } SCOPED_INCREMENT_IF(rc_CTFPlayer_ApplyPushFromDamage_block, block); - DETOUR_MEMBER_CALL(CTFPlayer_ApplyPushFromDamage)(info, vec); + DETOUR_MEMBER_CALL(info, vec); } DETOUR_DECL_MEMBER(void, CTFPlayer_ApplyAbsVelocityImpulse, const Vector *v1) @@ -1141,7 +1141,7 @@ namespace Mod::Cond::Reprogrammed if (rc_CTFPlayer_ApplyPushFromDamage_block) return; - DETOUR_MEMBER_CALL(CTFPlayer_ApplyAbsVelocityImpulse)(v1); + DETOUR_MEMBER_CALL(v1); } DETOUR_DECL_MEMBER(const char *, CTFWeaponBase_GetShootSound, int iIndex) @@ -1154,7 +1154,7 @@ namespace Mod::Cond::Reprogrammed weapon->SetTeamNumber(TF_TEAM_BLUE); } - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_GetShootSound)(iIndex); + auto result = DETOUR_MEMBER_CALL(iIndex); weapon->SetTeamNumber(oldWeaponTeam); return result; @@ -1172,7 +1172,7 @@ namespace Mod::Cond::Reprogrammed } } }); - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); for (auto &weapon : weaponsTeamSwitched) { weapon.first->SetTeamNumber(weapon.second); } @@ -1195,7 +1195,7 @@ namespace Mod::Cond::Reprogrammed } //DevMsg("\n[Update]\n"); //DevMsg("reached goal %d,detonating %d,failures %d, %d %f %f\n",me->m_bDetReachedGoal, me->m_bDetonating ,me->m_nConsecutivePathFailures,ENTINDEX(me->m_hTarget), me->m_vecDetonatePos.x, me->m_vecTargetPos.x); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); return result; } @@ -1203,7 +1203,7 @@ namespace Mod::Cond::Reprogrammed DETOUR_DECL_MEMBER(bool, CBaseObject_FindSnapToBuildPos, CBaseObject *pObjectOverride) { auto me = reinterpret_cast(this); - bool success = DETOUR_MEMBER_CALL(CBaseObject_FindSnapToBuildPos)(pObjectOverride); + bool success = DETOUR_MEMBER_CALL(pObjectOverride); if (pObjectOverride != nullptr) return success; @@ -1284,12 +1284,12 @@ namespace Mod::Cond::Reprogrammed if (me->GetTeamNumber() == TEAM_SPECTATOR && me->IsAlive()) { return TFTeamMgr()->GetTeam(RandomInt(TF_TEAM_RED, TF_TEAM_BLUE)); } - return DETOUR_MEMBER_CALL(CTFPlayer_GetOpposingTFTeam)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CTFKnife_CanPerformBackstabAgainstTarget, CTFPlayer *target ) { - bool ret = DETOUR_MEMBER_CALL(CTFKnife_CanPerformBackstabAgainstTarget)(target); + bool ret = DETOUR_MEMBER_CALL(target); if ( !ret && TFGameRules() && TFGameRules()->IsMannVsMachineMode() && target->GetTeamNumber() == TEAM_SPECTATOR ) { @@ -1306,7 +1306,7 @@ namespace Mod::Cond::Reprogrammed DETOUR_DECL_MEMBER(bool, CTFBotVision_IsIgnored, CBaseEntity *ent) { CTFBot *me = reinterpret_cast(reinterpret_cast(this)->GetBot()->GetEntity()); - if (me->GetTeamNumber() != TEAM_SPECTATOR || !sig_cond_reprogrammed_neutral_spy_disguise.GetBool()) return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + if (me->GetTeamNumber() != TEAM_SPECTATOR || !sig_cond_reprogrammed_neutral_spy_disguise.GetBool()) return DETOUR_MEMBER_CALL(ent); auto player = ToTFPlayer(ent); int restoreTeam = -1; @@ -1316,7 +1316,7 @@ namespace Mod::Cond::Reprogrammed player->m_Shared->m_nDisguiseTeam = me->GetTeamNumber(); } } - bool ret = DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + bool ret = DETOUR_MEMBER_CALL(ent); if (restoreTeam != -1) { player->m_Shared->m_nDisguiseTeam = restoreTeam; } @@ -1332,22 +1332,22 @@ namespace Mod::Cond::Reprogrammed if (teamnum == TF_TEAM_RED || teamnum == TEAM_SPECTATOR) { player->SetTeamNumber(TF_TEAM_BLUE); } - DETOUR_MEMBER_CALL(CTFPlayer_DeathSound)(info); + DETOUR_MEMBER_CALL(info); player->SetTeamNumber(teamnum); } else - DETOUR_MEMBER_CALL(CTFPlayer_DeathSound)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CTFPistol_ScoutPrimary_Push) { SCOPED_INCREMENT(rc_CollectPlayers_SpecEnemy); - DETOUR_MEMBER_CALL(CTFPistol_ScoutPrimary_Push)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_C2) { - DETOUR_MEMBER_CALL(CTFPlayerShared_C2)(); + DETOUR_MEMBER_CALL(); reinterpret_cast(this)->m_ConditionData->EnsureCount(GetExtraConditionCount()); } @@ -1356,7 +1356,7 @@ namespace Mod::Cond::Reprogrammed if (nCond < 0 || nCond >= GetExtraConditionCount()) { return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_RemoveAllCond) @@ -1369,7 +1369,7 @@ namespace Mod::Cond::Reprogrammed shared->RemoveCond((ETFCond)i); } } - DETOUR_MEMBER_CALL(CTFPlayerShared_RemoveAllCond)(); + DETOUR_MEMBER_CALL(); } class CMod : public IMod, public IModCallbackListener, public IFrameUpdatePostEntityThinkListener diff --git a/src/mod/credits/better_radius_collection.cpp b/src/mod/credits/better_radius_collection.cpp index 53b5319c..9588c846 100644 --- a/src/mod/credits/better_radius_collection.cpp +++ b/src/mod/credits/better_radius_collection.cpp @@ -24,7 +24,7 @@ namespace Mod::Credits::Better_Radius_Collection { /* don't mess with CBonusPack stuff in other game modes */ if (!TFGameRules()->IsMannVsMachineMode()) { - DETOUR_MEMBER_CALL(CTFPlayerShared_RadiusCurrencyCollectionCheck)(); + DETOUR_MEMBER_CALL(); return; } diff --git a/src/mod/credits/spawn_autocollect.cpp b/src/mod/credits/spawn_autocollect.cpp index 1ea40489..b3fec02a 100644 --- a/src/mod/credits/spawn_autocollect.cpp +++ b/src/mod/credits/spawn_autocollect.cpp @@ -25,7 +25,7 @@ namespace Mod::Credits::Spawn_AutoCollect { auto pack = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CCurrencyPack_ComeToRest)(); + DETOUR_MEMBER_CALL(); if (!pack->IsMarkedForDeletion() && !pack->IsBeingPulled() && !pack->IsDistributed()) { int credit_team = GetCreditTeamNum(); diff --git a/src/mod/debug/airblastvuln.cpp b/src/mod/debug/airblastvuln.cpp index 7fbd83d9..2434a738 100644 --- a/src/mod/debug/airblastvuln.cpp +++ b/src/mod/debug/airblastvuln.cpp @@ -16,7 +16,7 @@ namespace Mod::Debug::AirblastVuln DETOUR_DECL_STATIC(float, CAttributeManager_AttribHookValue_float, float value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) { - auto result = DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_float)(value, attr, ent, vec, b1); + auto result = DETOUR_STATIC_CALL(value, attr, ent, vec, b1); CTFBot *bot = ToTFBot(const_cast(ent)); if (bot != nullptr && bot->IsMiniBoss()) { @@ -73,7 +73,7 @@ namespace Mod::Debug::AirblastVuln Vector vBefore; player->GetVelocity(&vBefore, nullptr); - DETOUR_MEMBER_CALL(CTFPlayer_ApplyGenericPushbackImpulse)(impulse, inflictor); + DETOUR_MEMBER_CALL(impulse, inflictor); Vector vAfter; player->GetVelocity(&vAfter, nullptr); diff --git a/src/mod/debug/better_ent_text.cpp b/src/mod/debug/better_ent_text.cpp index 173a38d1..df943f49 100644 --- a/src/mod/debug/better_ent_text.cpp +++ b/src/mod/debug/better_ent_text.cpp @@ -24,7 +24,7 @@ namespace Mod::Debug::Better_Ent_Text { auto ent = reinterpret_cast(this); - int line = DETOUR_MEMBER_CALL(CBaseEntity_DrawDebugTextOverlays)(); + int line = DETOUR_MEMBER_CALL(); if ((ent->m_debugOverlays & OVERLAY_TEXT_BIT) != 0) { ent->EntityText(line++, CFmtStr("Team: %d %s", ent->GetTeamNumber(), GetTeamNameString(ent->GetTeamNumber())), 0.0f, 0xff, 0xff, 0xff, 0xff); diff --git a/src/mod/debug/bottle_break.cpp b/src/mod/debug/bottle_break.cpp index 1a769bb1..5f829a5a 100644 --- a/src/mod/debug/bottle_break.cpp +++ b/src/mod/debug/bottle_break.cpp @@ -209,7 +209,7 @@ namespace Mod::Debug::Bottle_Break // DETOUR_DECL_MEMBER(bool, CEconItemDefinition_BInitFromKV, KeyValues *kv, CUtlVector *errors) // { -// auto result = DETOUR_MEMBER_CALL(CEconItemDefinition_BInitFromKV)(kv, errors); +// auto result = DETOUR_MEMBER_CALL(kv, errors); // // if (result) { // short index = reinterpret_cast(this)->m_iItemDefIndex; diff --git a/src/mod/debug/building_status.cpp b/src/mod/debug/building_status.cpp index 7d329f36..4e900c99 100644 --- a/src/mod/debug/building_status.cpp +++ b/src/mod/debug/building_status.cpp @@ -130,14 +130,14 @@ namespace Mod::Debug::Building_Status return true; } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } /* make TFBots actually notice teleporters in MvM mode */ DETOUR_DECL_MEMBER(void, CTFBotVision_CollectPotentiallyVisibleEntities, CUtlVector *ents) { - DETOUR_MEMBER_CALL(CTFBotVision_CollectPotentiallyVisibleEntities)(ents); + DETOUR_MEMBER_CALL(ents); ForEachEntity([&](CBaseEntity *ent){ auto tele = rtti_cast(ent); diff --git a/src/mod/debug/changelevel.cpp b/src/mod/debug/changelevel.cpp index 29deb0aa..405b8476 100644 --- a/src/mod/debug/changelevel.cpp +++ b/src/mod/debug/changelevel.cpp @@ -34,7 +34,7 @@ namespace Mod::Debug::ChangeLevel DETOUR_DECL_MEMBER(bool, CChangeLevelIssue_CanCallVote, int i1, const char *s1, int& fail, int& i2) { - auto result = DETOUR_MEMBER_CALL(CChangeLevelIssue_CanCallVote)(i1, s1, fail, i2); + auto result = DETOUR_MEMBER_CALL(i1, s1, fail, i2); DevMsg("[CChangeLevelIssue::CanCallVote: %s] [i1:%d] [s1:\"%s\"] [fail:%d] [i2:%d]\n", (result ? "YES" : " NO"), i1, s1, fail, i2); return result; @@ -44,19 +44,19 @@ namespace Mod::Debug::ChangeLevel { DevMsg("[CChangeLevelIssue::ExecuteCommand] [@ 0x5c: \"%s\"]\n", (const char *)((uintptr_t)this + 0x5c)); - DETOUR_MEMBER_CALL(CChangeLevelIssue_ExecuteCommand)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CVEngineServer_ChangeLevel, const char *s1, const char *s2) { DevMsg("[CVEngineServer::ChangeLevel] [s1:\"%s\"] [s2:\"%s\"]\n", s1, s2); - DETOUR_MEMBER_CALL(CVEngineServer_ChangeLevel)(s1, s2); + DETOUR_MEMBER_CALL(s1, s2); } DETOUR_DECL_STATIC(void, Host_Changelevel_f, const CCommand& args) { DevMsg("[Host_Changelevel_f] [%s]\n", args.GetCommandString()); - DETOUR_STATIC_CALL(Host_Changelevel_f)(args); + DETOUR_STATIC_CALL(args); } diff --git a/src/mod/debug/client_desync.cpp b/src/mod/debug/client_desync.cpp index 2d75c4d2..d2e6f0b3 100644 --- a/src/mod/debug/client_desync.cpp +++ b/src/mod/debug/client_desync.cpp @@ -43,7 +43,7 @@ namespace Mod::Debug::Client_Desync } - DETOUR_MEMBER_CALL(C_TFPlayer_OnPreDataChanged)(updateType); + DETOUR_MEMBER_CALL(updateType); } DETOUR_DECL_MEMBER(void, C_TFPlayer_OnDataChanged, DataUpdateType_t updateType) @@ -57,7 +57,7 @@ namespace Mod::Debug::Client_Desync Plat_FloatTime(), player->entindex(), n_changed, DataUpdateType_ToString(updateType)); } - DETOUR_MEMBER_CALL(C_TFPlayer_OnDataChanged)(updateType); + DETOUR_MEMBER_CALL(updateType); } diff --git a/src/mod/debug/client_player_track.cpp b/src/mod/debug/client_player_track.cpp index 59c8c82c..f46fd286 100644 --- a/src/mod/debug/client_player_track.cpp +++ b/src/mod/debug/client_player_track.cpp @@ -49,7 +49,7 @@ namespace Mod::Client::Player_Track TrackPlayers(); - DETOUR_MEMBER_CALL(CViewRender_Render)(rect); + DETOUR_MEMBER_CALL(rect); } diff --git a/src/mod/debug/conds.cpp b/src/mod/debug/conds.cpp index fed649e6..f7cd7f1f 100644 --- a/src/mod/debug/conds.cpp +++ b/src/mod/debug/conds.cpp @@ -12,7 +12,7 @@ namespace Mod::Debug::Conds ClientMsgAll("[CondDebug] #%d \"%s\" +++ %d %s\n", ENTINDEX(player), player->GetPlayerName(), (int)cond, GetTFConditionName(cond)); - DETOUR_MEMBER_CALL(CTFPlayerShared_OnConditionAdded)(cond); + DETOUR_MEMBER_CALL(cond); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_OnConditionRemoved, ETFCond cond) @@ -22,7 +22,7 @@ namespace Mod::Debug::Conds ClientMsgAll("[CondDebug] #%d \"%s\" --- %d %s\n", ENTINDEX(player), player->GetPlayerName(), (int)cond, GetTFConditionName(cond)); - DETOUR_MEMBER_CALL(CTFPlayerShared_OnConditionRemoved)(cond); + DETOUR_MEMBER_CALL(cond); } diff --git a/src/mod/debug/console_scramble_v2.cpp b/src/mod/debug/console_scramble_v2.cpp index 3c0c74ff..d7018f05 100644 --- a/src/mod/debug/console_scramble_v2.cpp +++ b/src/mod/debug/console_scramble_v2.cpp @@ -13,7 +13,7 @@ namespace Mod::Debug::Console_Scramble_v2 fflush(f); } - auto result = DETOUR_STATIC_CALL(Sys_SpewFunc)(spewType, pMsg); + auto result = DETOUR_STATIC_CALL(spewType, pMsg); if (f != nullptr) { fprintf(f, "%04X << Sys_SpewFunc [%12.7f] [Tick %5d] [SpewFunc %08x] \"%s\"\n", ThreadGetCurrentId(), Plat_FloatTime(), gpGlobals->tickcount, (uintptr_t)GetSpewOutputFunc(), pMsg); @@ -39,7 +39,7 @@ namespace Mod::Debug::Console_Scramble_v2 fflush(f); } - DETOUR_STATIC_CALL(ConColorMsg)(clr, "%s", buf); + DETOUR_STATIC_CALL(clr, "%s", buf); if (f != nullptr) { fprintf(f, "%04X << ConColorMsg [%12.7f] [Tick %5d] [SpewFunc %08x] \"%s\"\n", ThreadGetCurrentId(), Plat_FloatTime(), gpGlobals->tickcount, (uintptr_t)GetSpewOutputFunc(), buf); diff --git a/src/mod/debug/ctfbotproxy.cpp b/src/mod/debug/ctfbotproxy.cpp index 8c0a5fe5..3b2c5668 100644 --- a/src/mod/debug/ctfbotproxy.cpp +++ b/src/mod/debug/ctfbotproxy.cpp @@ -155,7 +155,7 @@ namespace Mod::Debug::CTFBotProx DETOUR_DECL_STATIC(string_t, AllocPooledString, const char *pszValue) { ConColorMsg(Color(0xff, 0xff, 0x00, 0xff), "AllocPooledString(%s)\n", pszValue); - return DETOUR_STATIC_CALL(AllocPooledString)(pszValue); + return DETOUR_STATIC_CALL(pszValue); } DETOUR_DECL_MEMBER(void, CTFBotProxy_C1) @@ -166,7 +166,7 @@ namespace Mod::Debug::CTFBotProx ConColorMsg(Color(0x00, 0xff, 0xff, 0xff), "CTFBotProxy constructed @ 0x%08x (diff: 0x%08x)\n", (uintptr_t)this, diff); prev = (uintptr_t)this; - DETOUR_MEMBER_CALL(CTFBotProxy_C1)(); + DETOUR_MEMBER_CALL(); } @@ -180,14 +180,14 @@ namespace Mod::Debug::CTFBotProx } } - return DETOUR_MEMBER_CALL(IServerGameDLL_LevelInit)(pMapName, pMapEntities, pOldLevel, pLandmarkName, loadGame, background); + return DETOUR_MEMBER_CALL(pMapName, pMapEntities, pOldLevel, pLandmarkName, loadGame, background); } DETOUR_DECL_STATIC(void, MapEntity_ParseAllEntities, const char *pMapData, IMapEntityFilter *pFilter, bool bActivateEntities) { printf("MapEntity_ParseAllEntities: %s\n", MakeEscapedVersion(pMapData)); - DETOUR_STATIC_CALL(MapEntity_ParseAllEntities)(pMapData, pFilter, bActivateEntities); + DETOUR_STATIC_CALL(pMapData, pFilter, bActivateEntities); } DETOUR_DECL_STATIC(const char *, MapEntity_ParseEntity, CBaseEntity *&pEntity, const char *pEntData, IMapEntityFilter *pFilter) @@ -195,12 +195,12 @@ namespace Mod::Debug::CTFBotProx printf("MapEntity_ParseEntity: %s\n", MakeEscapedVersion(pEntData)); // PrintLineBrokenEscapedVersion(pEntData); - return DETOUR_STATIC_CALL(MapEntity_ParseEntity)(pEntity, pEntData, pFilter); + return DETOUR_STATIC_CALL(pEntity, pEntData, pFilter); } DETOUR_DECL_STATIC(const char *, MapEntity_ParseToken, const char *data, char *newToken) { - auto result = DETOUR_STATIC_CALL(MapEntity_ParseToken)(data, newToken); + auto result = DETOUR_STATIC_CALL(data, newToken); int len1 = result - data; int len2 = strlen(newToken); @@ -224,7 +224,7 @@ namespace Mod::Debug::CTFBotProx (pe->m_pActivator != nullptr ? STRING(pe->m_pActivator->GetEntityName()) : "none"), (pe->m_pCaller != nullptr ? STRING(pe->m_pCaller ->GetEntityName()) : "none")); - DETOUR_MEMBER_CALL(CEventQueue_AddEvent)(pe); + DETOUR_MEMBER_CALL(pe); } DETOUR_DECL_MEMBER(void, CEventQueue_ServiceEvents) @@ -248,7 +248,7 @@ namespace Mod::Debug::CTFBotProx } } - DETOUR_MEMBER_CALL(CEventQueue_ServiceEvents)(); + DETOUR_MEMBER_CALL(); } diff --git a/src/mod/debug/damage_overlay.cpp b/src/mod/debug/damage_overlay.cpp index e143854d..d6cf6bc7 100644 --- a/src/mod/debug/damage_overlay.cpp +++ b/src/mod/debug/damage_overlay.cpp @@ -22,7 +22,7 @@ namespace Mod::Debug::Damage_Overlay { pre_dmg = info.GetDamage(); - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(int, CBaseEntity_TakeDamage, const CTakeDamageInfo& inputInfo) @@ -32,7 +32,7 @@ namespace Mod::Debug::Damage_Overlay pre_hp = ent->GetHealth(); post_dmg = 0.0f; - auto result = DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(inputInfo); + auto result = DETOUR_MEMBER_CALL(inputInfo); post_hp = ent->GetHealth(); diff --git a/src/mod/debug/deflect_angle.cpp b/src/mod/debug/deflect_angle.cpp index 7c25f546..e667053e 100644 --- a/src/mod/debug/deflect_angle.cpp +++ b/src/mod/debug/deflect_angle.cpp @@ -98,7 +98,7 @@ namespace Mod::Debug::Deflect_Angle { deflect_ent = ent; SCOPED_INCREMENT(rc_CTFWeaponBase_DeflectEntity); - return DETOUR_MEMBER_CALL(CTFWeaponBase_DeflectEntity)(ent, player, v1); + return DETOUR_MEMBER_CALL(ent, player, v1); } @@ -113,14 +113,14 @@ namespace Mod::Debug::Deflect_Angle if (player != nullptr) { CTraceFilterProjectileDeflection filter(oldfilter->GetPassEntity(), 0, player->GetTeamNumber()); - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, &filter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, &filter, pTrace); return; } } } #endif - DETOUR_MEMBER_CALL()(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); if (rc_CTFWeaponBase_DeflectEntity > 0 && fMask == 0x200400b) { NDebugOverlay::Line(pTrace->startpos, pTrace->endpos, 0x00, 0xff, 0x00, false, 2.0f); @@ -191,7 +191,7 @@ namespace Mod::Debug::Deflect_Angle } } - return DETOUR_MEMBER_CALL(CTraceFilterSimple_ShouldHitEntity)(pServerEntity, contentsMask); + return DETOUR_MEMBER_CALL(pServerEntity, contentsMask); } diff --git a/src/mod/debug/deflect_angle_v2.cpp b/src/mod/debug/deflect_angle_v2.cpp index 895ddf05..f643dccd 100644 --- a/src/mod/debug/deflect_angle_v2.cpp +++ b/src/mod/debug/deflect_angle_v2.cpp @@ -23,13 +23,13 @@ namespace Mod::Debug::Deflect_Angle_v2 { deflect_ent = ent; SCOPED_INCREMENT(rc_CTFWeaponBase_DeflectEntity); - return DETOUR_MEMBER_CALL(CTFWeaponBase_DeflectEntity)(ent, player, v1); + return DETOUR_MEMBER_CALL(ent, player, v1); } DETOUR_DECL_MEMBER(void, IEngineTrace_TraceRay, const Ray_t& ray, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace) { - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); if (rc_CTFWeaponBase_DeflectEntity > 0 && fMask == 0x200400b) { // NDebugOverlay::Line(pTrace->startpos, pTrace->endpos, 0x00, 0xff, 0x00, false, 2.0f); @@ -108,7 +108,7 @@ namespace Mod::Debug::Deflect_Angle_v2 if (pEntity->IsPlayer()) return false; } - return DETOUR_MEMBER_CALL(CTraceFilterDeflection_ShouldHitEntity)(pHandleEntity, contentsMask); + return DETOUR_MEMBER_CALL(pHandleEntity, contentsMask); } diff --git a/src/mod/debug/draw_cphyscollide.cpp b/src/mod/debug/draw_cphyscollide.cpp index daa7a169..0ead9e1c 100644 --- a/src/mod/debug/draw_cphyscollide.cpp +++ b/src/mod/debug/draw_cphyscollide.cpp @@ -87,7 +87,7 @@ namespace Mod::Debug::Draw_CPhysCollide } } - return DETOUR_MEMBER_CALL(C_BaseAnimating_DrawModel)(flags); + return DETOUR_MEMBER_CALL(flags); } @@ -98,7 +98,7 @@ namespace Mod::Debug::Draw_CPhysCollide #if 0 DETOUR_DECL_MEMBER(void, C_BaseAnimating_DoInternalDrawModel, ClientModelRenderInfo_t *pInfo, DrawModelState_t *pState, matrix3x4_t *pBoneToWorldArray) { - DETOUR_MEMBER_CALL(C_BaseAnimating_DoInternalDrawModel)(pInfo, pState, pBoneToWorldArray); + DETOUR_MEMBER_CALL(pInfo, pState, pBoneToWorldArray); } @@ -111,7 +111,7 @@ namespace Mod::Debug::Draw_CPhysCollide DevMsg("C_BaseEntity::VPhysicsUpdate [this: %08x]\n", (uintptr_t)this); - DETOUR_MEMBER_CALL(C_BaseEntity_VPhysicsUpdate)(pPhysics); + DETOUR_MEMBER_CALL(pPhysics); const CPhysCollide *pCollide = pPhysics->GetCollide(); if (pCollide != nullptr) { diff --git a/src/mod/debug/energyring_knockback.cpp b/src/mod/debug/energyring_knockback.cpp index 33b9fe2b..795d42d1 100644 --- a/src/mod/debug/energyring_knockback.cpp +++ b/src/mod/debug/energyring_knockback.cpp @@ -27,7 +27,7 @@ namespace Mod::Debug::EnergyRing_Knockback } } - return DETOUR_MEMBER_CALL(CTFGameRules_ApplyOnDamageModifyRules)(info, pVictim, b1); + return DETOUR_MEMBER_CALL(info, pVictim, b1); } diff --git a/src/mod/debug/feigndeath_ragdoll.cpp b/src/mod/debug/feigndeath_ragdoll.cpp index 9f088531..16118762 100644 --- a/src/mod/debug/feigndeath_ragdoll.cpp +++ b/src/mod/debug/feigndeath_ragdoll.cpp @@ -9,12 +9,12 @@ namespace Mod::Debug::FeignDeath_Ragdoll DETOUR_DECL_MEMBER(void, CTFPlayer_CreateFeignDeathRagdoll, const CTakeDamageInfo& info, bool b1, bool b2, bool b3) { SCOPED_INCREMENT(rc_CreateFeignDeathRagdoll); - DETOUR_MEMBER_CALL(CTFPlayer_CreateFeignDeathRagdoll)(info, b1, b2, b3); + DETOUR_MEMBER_CALL(info, b1, b2, b3); } DETOUR_DECL_STATIC(CBaseEntity *, CreateEntityByName, const char *className, int iForceEdictIndex) { - auto result = DETOUR_STATIC_CALL(CreateEntityByName)(className, iForceEdictIndex); + auto result = DETOUR_STATIC_CALL(className, iForceEdictIndex); if (rc_CreateFeignDeathRagdoll > 0 && strcmp(className, "tf_ragdoll") == 0 && result != nullptr) { auto ragdoll = reinterpret_cast(result); diff --git a/src/mod/debug/flamethrower_impulse_101.cpp b/src/mod/debug/flamethrower_impulse_101.cpp index 4764dbbb..1827983f 100644 --- a/src/mod/debug/flamethrower_impulse_101.cpp +++ b/src/mod/debug/flamethrower_impulse_101.cpp @@ -5,7 +5,7 @@ namespace Mod::Debug::Flamethrower_Impulse_101 { DETOUR_DECL_MEMBER(const char *, C_TFFlameThrower_FullCritChargedEffectName) { - auto result = DETOUR_MEMBER_CALL(C_TFFlameThrower_FullCritChargedEffectName)(); + auto result = DETOUR_MEMBER_CALL(); NDebugOverlay::Clear(); NDebugOverlay::ScreenText(0.05f, 0.05f, CFmtStr("C_TFFlameThrower::FullCritChargedEffectName (this = 0x%08x)", diff --git a/src/mod/debug/flamethrower_mojo.cpp b/src/mod/debug/flamethrower_mojo.cpp index b6db9324..1f9752a8 100644 --- a/src/mod/debug/flamethrower_mojo.cpp +++ b/src/mod/debug/flamethrower_mojo.cpp @@ -207,7 +207,7 @@ namespace Mod::Debug::Flamethrower_Mojo DETOUR_DECL_MEMBER(Vector, CTFFlameThrower_GetFlameOriginPos) { - auto result = DETOUR_MEMBER_CALL(CTFFlameThrower_GetFlameOriginPos)(); + auto result = DETOUR_MEMBER_CALL(); // DevMsg("[CTFFlameThrower::GetFlameOriginPos] [%+6.1f %+6.1f %+6.1f]\n", // result.x, result.y, result.z); @@ -222,7 +222,7 @@ namespace Mod::Debug::Flamethrower_Mojo SCOPED_INCREMENT(rc_CTFFlameEntity_Create); - auto result = DETOUR_STATIC_CALL(CTFFlameEntity_Create)(origin, angles, owner, f1, i1, f2, b1, b2); + auto result = DETOUR_STATIC_CALL(origin, angles, owner, f1, i1, f2, b1, b2); if (result != nullptr) { // DevMsg("[CTFFlameEntity::Create] [%+6.1f %+6.1f %+6.1f]\n", @@ -248,7 +248,7 @@ namespace Mod::Debug::Flamethrower_Mojo DETOUR_DECL_MEMBER(void, CTFFlameEntity_Spawn) { - DETOUR_MEMBER_CALL(CTFFlameEntity_Spawn)(); + DETOUR_MEMBER_CALL(); // BACKTRACE(); @@ -317,7 +317,7 @@ namespace Mod::Debug::Flamethrower_Mojo // DevMsg("[CTFFlameEntity::RemoveFlame] [%+6.1f %+6.1f %+6.1f]\n", // flame->GetAbsOrigin().x, flame->GetAbsOrigin().y, flame->GetAbsOrigin().z); - DETOUR_MEMBER_CALL(CTFFlameEntity_RemoveFlame)(); + DETOUR_MEMBER_CALL(); } @@ -345,7 +345,7 @@ namespace Mod::Debug::Flamethrower_Mojo int num_thinks = info.num_thinks++; } - DETOUR_MEMBER_CALL(CTFFlameEntity_FlameThink)(); + DETOUR_MEMBER_CALL(); } @@ -355,7 +355,7 @@ namespace Mod::Debug::Flamethrower_Mojo DETOUR_DECL_MEMBER(void, IEngineTrace_TraceRay, const Ray_t& ray, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace) { - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); if (cvar_show_traces.GetBool() && rc_CTFFlameEntity_FlameThink > 0 && rc_CTFFlameEntity_OnCollide <= 0 && fMask == MASK_SOLID) { auto m_pPassEnt = *reinterpret_cast((uintptr_t)pTraceFilter + 0x4); @@ -401,7 +401,7 @@ namespace Mod::Debug::Flamethrower_Mojo NDebugOverlay::EntityTextAtPosition(flame->WorldSpaceCenter(), -2, "HIT", 0.10f, info.col_lt.r(), info.col_lt.g(), info.col_lt.b(), 0xff); } - DETOUR_MEMBER_CALL(CTFFlameEntity_OnCollide)(pOther); + DETOUR_MEMBER_CALL(pOther); } @@ -417,13 +417,13 @@ namespace Mod::Debug::Flamethrower_Mojo NDebugOverlay::VertArrow(vecArrowTop, vecArrowBottom, 1.0f, 0xff, 0xff, 0xff, 0x00, true, 1.00f); NDebugOverlay::EntityBounds(proj, 0xff, 0xff, 0xff, 0x10, 1.00f); - DETOUR_MEMBER_CALL(CBaseProjectile_CollideWithTeammatesThink)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(int, D_RandomInt, int iMinVal, int iMaxVal) { - auto result = DETOUR_STATIC_CALL(D_RandomInt)(iMinVal, iMaxVal); + auto result = DETOUR_STATIC_CALL(iMinVal, iMaxVal); if (rc_CTFFlameEntity_Create > 0) { DevMsg("RandomInt(%d, %d) = %d\n", iMinVal, iMaxVal, result); @@ -451,48 +451,48 @@ namespace Mod::Debug::Flamethrower_Mojo DETOUR_DECL_MEMBER(void, IServerGameDLL_GameFrame, bool simulating) { TRACE("@%.3f", gpGlobals->curtime); - DETOUR_MEMBER_CALL(IServerGameDLL_GameFrame)(simulating); + DETOUR_MEMBER_CALL(simulating); } DETOUR_DECL_STATIC(void, Physics_RunThinkFunctions, bool simulating) { TRACE("@%.3f", gpGlobals->curtime); - DETOUR_STATIC_CALL(Physics_RunThinkFunctions)(simulating); + DETOUR_STATIC_CALL(simulating); } DETOUR_DECL_STATIC(void, Physics_SimulateEntity, CBaseEntity *pEntity) { auto flame = rtti_cast(pEntity); TRACE_IF(flame != nullptr, "@%.3f #%d", gpGlobals->curtime, ENTINDEX(flame)); - DETOUR_STATIC_CALL(Physics_SimulateEntity)(pEntity); + DETOUR_STATIC_CALL(pEntity); } DETOUR_DECL_MEMBER(void, CBaseEntity_PhysicsSimulate) { auto flame = rtti_cast(reinterpret_cast(this)); TRACE_IF(flame != nullptr, "@%.3f #%d", gpGlobals->curtime, ENTINDEX(flame)); - DETOUR_MEMBER_CALL(CBaseEntity_PhysicsSimulate)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CBaseEntity_PhysicsNoclip) { auto flame = rtti_cast(reinterpret_cast(this)); TRACE_IF(flame != nullptr, "@%.3f #%d", gpGlobals->curtime, ENTINDEX(flame)); - DETOUR_MEMBER_CALL(CBaseEntity_PhysicsNoclip)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CBaseEntity_PhysicsRunThink, thinkmethods_t thinkMethod) { auto flame = rtti_cast(reinterpret_cast(this)); TRACE_IF(flame != nullptr, "@%.3f #%d [thinkMethod: %d]", gpGlobals->curtime, ENTINDEX(flame), (int)thinkMethod); - DETOUR_MEMBER_CALL(CBaseEntity_PhysicsRunThink)(thinkMethod); + DETOUR_MEMBER_CALL(thinkMethod); } DETOUR_DECL_MEMBER(bool, CBaseEntity_PhysicsRunSpecificThink, int nContextIndex, BASEPTR thinkFunc) { auto flame = rtti_cast(reinterpret_cast(this)); TRACE_IF(flame != nullptr, "@%.3f #%d [nContextIndex: %d] [thinkFunc: %08x]", gpGlobals->curtime, ENTINDEX(flame), nContextIndex, *reinterpret_cast(&thinkFunc)); - auto result = DETOUR_MEMBER_CALL(CBaseEntity_PhysicsRunSpecificThink)(nContextIndex, thinkFunc); + auto result = DETOUR_MEMBER_CALL(nContextIndex, thinkFunc); TRACE_EXIT("%s", (result ? "TRUE" : "FALSE")); return result; } @@ -501,7 +501,7 @@ namespace Mod::Debug::Flamethrower_Mojo { auto flame = rtti_cast(reinterpret_cast(this)); TRACE_IF(flame != nullptr, "@%.3f #%d [thinkFunc: %08x]", gpGlobals->curtime, ENTINDEX(flame), *reinterpret_cast(&thinkFunc)); - DETOUR_MEMBER_CALL(CBaseEntity_PhysicsDispatchThink)(thinkFunc); + DETOUR_MEMBER_CALL(thinkFunc); } //////////////////////////////////////////////////////////////////////////// diff --git a/src/mod/debug/func_nav_cost_tags.cpp b/src/mod/debug/func_nav_cost_tags.cpp index 7f3fa4c9..d41fd50c 100644 --- a/src/mod/debug/func_nav_cost_tags.cpp +++ b/src/mod/debug/func_nav_cost_tags.cpp @@ -9,7 +9,7 @@ namespace Mod::Debug::Func_Nav_Cost_Tags { auto func = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CFuncNavCost_IsApplicableTo)(who); + auto result = DETOUR_MEMBER_CALL(who); Msg("\nCFuncNavCost::IsApplicableTo: %s #%d \"%s\"\n", func->GetClassname(), ENTINDEX(func), STRING(func->GetEntityName())); diff --git a/src/mod/debug/grenade_vphysics.cpp b/src/mod/debug/grenade_vphysics.cpp index 5279e688..dcdad263 100644 --- a/src/mod/debug/grenade_vphysics.cpp +++ b/src/mod/debug/grenade_vphysics.cpp @@ -177,7 +177,7 @@ namespace Mod::Debug::Grenade_VPhysics auto ent = reinterpret_cast(this); TRACE("[this: #%d \"%s\"] [solidType: %d] [nSolidFlags: %08x] [pSolid: %08x]", ENTINDEX(ent), ent->GetClassname(), solidType, nSolidFlags, (uintptr_t)pSolid); - auto result = DETOUR_MEMBER_CALL(CBaseEntity_VPhysicsInitNormal)(solidType, nSolidFlags, createAsleep, pSolid); + auto result = DETOUR_MEMBER_CALL(solidType, nSolidFlags, createAsleep, pSolid); TRACE_EXIT("[result: %08x]", (uintptr_t)result); return result; } @@ -186,7 +186,7 @@ namespace Mod::Debug::Grenade_VPhysics { TRACE("[pEntity: #%d \"%s\"] [modelIndex: %d] [pSolid: %08x]", ENTINDEX(pEntity), pEntity->GetClassname(), modelIndex, (uintptr_t)pSolid); - auto result = DETOUR_STATIC_CALL(PhysModelCreate)(pEntity, modelIndex, origin, angles, pSolid); + auto result = DETOUR_STATIC_CALL(pEntity, modelIndex, origin, angles, pSolid); TRACE_EXIT("[result: %08x]", (uintptr_t)result); return result; } @@ -214,7 +214,7 @@ namespace Mod::Debug::Grenade_VPhysics return value * 100; } - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_int)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } DETOUR_DECL_STATIC(float, CAttributeManager_AttribHookValue_float, float value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) @@ -232,7 +232,7 @@ namespace Mod::Debug::Grenade_VPhysics return value * 0.0f; } - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_float)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } @@ -266,7 +266,7 @@ namespace Mod::Debug::Grenade_VPhysics } } - return DETOUR_STATIC_CALL(CBaseEntity_CreateNoSpawn)(szName, vecOrigin, ref_angles, pOwner); + return DETOUR_STATIC_CALL(szName, vecOrigin, ref_angles, pOwner); } diff --git a/src/mod/debug/heal_debuff.cpp b/src/mod/debug/heal_debuff.cpp index db10d21f..4971c74a 100644 --- a/src/mod/debug/heal_debuff.cpp +++ b/src/mod/debug/heal_debuff.cpp @@ -13,7 +13,7 @@ namespace Mod::Debug::Heal_Debuff BACKTRACE(); } - return DETOUR_MEMBER_CALL(CTFPlayerShared_InCond)(cond); + return DETOUR_MEMBER_CALL(cond); } diff --git a/src/mod/debug/ispotentiallytraversable_trace.cpp b/src/mod/debug/ispotentiallytraversable_trace.cpp index 85904dee..e2c636f5 100644 --- a/src/mod/debug/ispotentiallytraversable_trace.cpp +++ b/src/mod/debug/ispotentiallytraversable_trace.cpp @@ -66,7 +66,7 @@ namespace Mod::Debug::IsPotentiallyTraversable_Trace { SCOPED_INCREMENT(rc_ILocomotion_IsPotentiallyTraversable); loco = reinterpret_cast(this); - return DETOUR_MEMBER_CALL(ILocomotion_IsPotentiallyTraversable)(from, to, when, pFraction); + return DETOUR_MEMBER_CALL(from, to, when, pFraction); } DETOUR_DECL_MEMBER(void, IEngineTrace_TraceRay, const Ray_t& ray, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace) @@ -88,7 +88,7 @@ namespace Mod::Debug::IsPotentiallyTraversable_Trace DevMsg("\n"); } - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); } diff --git a/src/mod/debug/known_entities.cpp b/src/mod/debug/known_entities.cpp index 36a005f8..faaa16fa 100644 --- a/src/mod/debug/known_entities.cpp +++ b/src/mod/debug/known_entities.cpp @@ -724,7 +724,7 @@ namespace Mod::Debug::Known_Entities DETOUR_DECL_MEMBER(void, INextBot_Update) { - DETOUR_MEMBER_CALL(INextBot_Update)(); + DETOUR_MEMBER_CALL(); INextBot *selected = TheNextBots().GetSelectedBot(); if (thebot != selected) { @@ -745,7 +745,7 @@ namespace Mod::Debug::Known_Entities DETOUR_DECL_MEMBER(void, IVision_Update) { - DETOUR_MEMBER_CALL(IVision_Update)(); + DETOUR_MEMBER_CALL(); INextBot *nextbot = reinterpret_cast(this)->GetBot(); if (nextbot != nullptr && nextbot == thebot) { @@ -767,7 +767,7 @@ namespace Mod::Debug::Known_Entities } } - DETOUR_MEMBER_CALL(IVision_AddKnownEntity)(ent); + DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(void, IVision_ForgetEntity, CBaseEntity *ent) @@ -783,7 +783,7 @@ namespace Mod::Debug::Known_Entities } } - DETOUR_MEMBER_CALL(IVision_ForgetEntity)(ent); + DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(void, IVision_ForgetAllKnownEntities) @@ -797,7 +797,7 @@ namespace Mod::Debug::Known_Entities } } - DETOUR_MEMBER_CALL(IVision_ForgetAllKnownEntities)(); + DETOUR_MEMBER_CALL(); } @@ -805,7 +805,7 @@ namespace Mod::Debug::Known_Entities { // caller: CTFBotVision::IsVisibleEntityNoticed - return DETOUR_MEMBER_CALL(CTFBot_IsSuspectedSpy)(spy); + return DETOUR_MEMBER_CALL(spy); } DETOUR_DECL_MEMBER(void, CTFBot_SuspectSpy, CTFPlayer *spy) { @@ -818,7 +818,7 @@ namespace Mod::Debug::Known_Entities // caller: CTFBot::Touch, while stealthed/disguised (MvM) - DETOUR_MEMBER_CALL(CTFBot_SuspectSpy)(spy); + DETOUR_MEMBER_CALL(spy); } DETOUR_DECL_MEMBER(void, CTFBot_StopSuspectingSpy, CTFPlayer *spy) { @@ -829,7 +829,7 @@ namespace Mod::Debug::Known_Entities ENTINDEX(bot), ENTINDEX(spy), (spy != nullptr ? spy->GetPlayerName() : "nullptr")); } - DETOUR_MEMBER_CALL(CTFBot_StopSuspectingSpy)(spy); + DETOUR_MEMBER_CALL(spy); } @@ -838,7 +838,7 @@ namespace Mod::Debug::Known_Entities // caller: CTFBotVision::IsIgnored // caller: CTFBotVision::IsVisibleEntityNoticed - return DETOUR_MEMBER_CALL(CTFBot_IsKnownSpy)(spy); + return DETOUR_MEMBER_CALL(spy); } DETOUR_DECL_MEMBER(void, CTFBot_RealizeSpy, CTFPlayer *spy) { @@ -854,7 +854,7 @@ namespace Mod::Debug::Known_Entities // caller: CTFBotVision::IsVisibleEntityNoticed, while disguising // caller: CTFBotVision::IsVisibleEntityNoticed, if burning/jarated/stealthblink/bleeding - DETOUR_MEMBER_CALL(CTFBot_RealizeSpy)(spy); + DETOUR_MEMBER_CALL(spy); } DETOUR_DECL_MEMBER(void, CTFBot_ForgetSpy, CTFPlayer *spy) { @@ -869,21 +869,21 @@ namespace Mod::Debug::Known_Entities // caller: CTFBotVision::IsVisibleEntityNoticed, if >75% stealthed // caller: CTFBotVision::Update, if not visible recently and disguising - DETOUR_MEMBER_CALL(CTFBot_ForgetSpy)(spy); + DETOUR_MEMBER_CALL(spy); } DETOUR_DECL_MEMBER(void, CTFBot_SuspectedSpyInfo_t_Suspect) { - DETOUR_MEMBER_CALL(CTFBot_SuspectedSpyInfo_t_Suspect)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFBot_SuspectedSpyInfo_t_IsCurrentlySuspected) { - return DETOUR_MEMBER_CALL(CTFBot_SuspectedSpyInfo_t_IsCurrentlySuspected)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFBot_SuspectedSpyInfo_t_TestForRealizing) { - return DETOUR_MEMBER_CALL(CTFBot_SuspectedSpyInfo_t_TestForRealizing)(); + return DETOUR_MEMBER_CALL(); } @@ -918,7 +918,7 @@ namespace Mod::Debug::Known_Entities // } } - DETOUR_MEMBER_CALL(CTFBot_DelayedThreatNotice)(ent, delay); + DETOUR_MEMBER_CALL(ent, delay); } @@ -945,7 +945,7 @@ namespace Mod::Debug::Known_Entities ENTINDEX(bot), ENTINDEX(who), str_who, ENTINDEX(weapon), str_weapon); } - DETOUR_MEMBER_CALL(CTFBot_OnWeaponFired)(who, weapon); + DETOUR_MEMBER_CALL(who, weapon); } @@ -956,7 +956,7 @@ namespace Mod::Debug::Known_Entities // ENTINDEX(actor), ENTINDEX(info.GetAttacker()), info.GetDamageType()); // } - return DETOUR_MEMBER_CALL(CTFBotMainAction_OnInjured)(actor, info); + return DETOUR_MEMBER_CALL(actor, info); } diff --git a/src/mod/debug/medigunshield_obstruction.cpp b/src/mod/debug/medigunshield_obstruction.cpp index 623cfcd4..a78c6ea7 100644 --- a/src/mod/debug/medigunshield_obstruction.cpp +++ b/src/mod/debug/medigunshield_obstruction.cpp @@ -69,7 +69,7 @@ namespace Mod::Debug::MedigunShield_Obstruction // NDebugOverlay::EntityTextAtPosition(end, 1, "end", 0.1f, 0xff, 0x00, 0x00, 0xff); SCOPED_INCREMENT(rc_ILocomotion_TraceHull); - DETOUR_MEMBER_CALL(ILocomotion_TraceHull)(start, end, mins, maxs, mask, filter, trace); + DETOUR_MEMBER_CALL(start, end, mins, maxs, mask, filter, trace); } @@ -77,7 +77,7 @@ namespace Mod::Debug::MedigunShield_Obstruction "Override NextBotTraversableTraceFilter::ShouldHitEntity"); DETOUR_DECL_MEMBER(bool, NextBotTraversableTraceFilter_ShouldHitEntity, IHandleEntity *pEntity, int contentsMask) { - auto result = DETOUR_MEMBER_CALL(NextBotTraversableTraceFilter_ShouldHitEntity)(pEntity, contentsMask); + auto result = DETOUR_MEMBER_CALL(pEntity, contentsMask); if (rc_ILocomotion_TraceHull > 0) { auto shield = rtti_cast(pEntity); @@ -102,7 +102,7 @@ namespace Mod::Debug::MedigunShield_Obstruction "Override CTFBotLocomotion::IsEntityTraversable"); DETOUR_DECL_MEMBER(bool, CTFBotLocomotion_IsEntityTraversable, CBaseEntity *ent, ILocomotion::TraverseWhenType ttype) { - auto result = DETOUR_MEMBER_CALL(CTFBotLocomotion_IsEntityTraversable)(ent, ttype); + auto result = DETOUR_MEMBER_CALL(ent, ttype); auto shield = rtti_cast(ent); if (shield != nullptr) { diff --git a/src/mod/debug/melee_trace.cpp b/src/mod/debug/melee_trace.cpp index 33a21e8c..1bf346b6 100644 --- a/src/mod/debug/melee_trace.cpp +++ b/src/mod/debug/melee_trace.cpp @@ -30,7 +30,7 @@ namespace Mod::Debug::Melee_Trace return weapon->DoSwingTraceInternal(trace, bCleaveAttack, pTraces); } - return DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(trace, bCleaveAttack, pTraces); + return DETOUR_MEMBER_CALL(trace, bCleaveAttack, pTraces); } diff --git a/src/mod/debug/multidetour.cpp b/src/mod/debug/multidetour.cpp index 74694bcc..ddba55c0 100644 --- a/src/mod/debug/multidetour.cpp +++ b/src/mod/debug/multidetour.cpp @@ -13,8 +13,8 @@ namespace Mod::Debug::MultiDetour DETOUR_DECL_STATIC(int, D1) { DevMsg("Detour1 PRE\n"); - // DevMsg("Trampoline: %08x\n", (uintptr_t)DETOUR_STATIC_CALL(D1)); - auto result = DETOUR_STATIC_CALL(D1)(); + // DevMsg("Trampoline: %08x\n", (uintptr_t)DETOUR_STATIC_CALL); + auto result = DETOUR_STATIC_CALL(); DevMsg("Detour1 POST (%d)\n", result); return result; } @@ -22,8 +22,8 @@ namespace Mod::Debug::MultiDetour DETOUR_DECL_STATIC(int, D2) { DevMsg("Detour2 PRE\n"); - // DevMsg("Trampoline: %08x\n", (uintptr_t)DETOUR_STATIC_CALL(D2)); - auto result = DETOUR_STATIC_CALL(D2)(); + // DevMsg("Trampoline: %08x\n", (uintptr_t)DETOUR_STATIC_CALL); + auto result = DETOUR_STATIC_CALL(); DevMsg("Detour2 POST (%d)\n", result); return result; } @@ -31,8 +31,8 @@ namespace Mod::Debug::MultiDetour DETOUR_DECL_STATIC(int, D3) { DevMsg("Detour3 PRE\n"); - // DevMsg("Trampoline: %08x\n", (uintptr_t)DETOUR_STATIC_CALL(D3)); - auto result = DETOUR_STATIC_CALL(D3)(); + // DevMsg("Trampoline: %08x\n", (uintptr_t)DETOUR_STATIC_CALL); + auto result = DETOUR_STATIC_CALL(); DevMsg("Detour3 POST (%d)\n", result); return result; } diff --git a/src/mod/debug/mvm_shield_fps.cpp b/src/mod/debug/mvm_shield_fps.cpp index c043f195..f3ae2df8 100644 --- a/src/mod/debug/mvm_shield_fps.cpp +++ b/src/mod/debug/mvm_shield_fps.cpp @@ -127,7 +127,7 @@ namespace Debug_MvM_Shield_FPS } } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } diff --git a/src/mod/debug/noknockback.cpp b/src/mod/debug/noknockback.cpp index 6060869a..e19e87df 100644 --- a/src/mod/debug/noknockback.cpp +++ b/src/mod/debug/noknockback.cpp @@ -15,7 +15,7 @@ namespace Mod::Debug::NoKnockback DETOUR_DECL_MEMBER(void, CTFPlayer_ApplyGenericPushbackImpulse, const Vector& impulse, CTFPlayer * inflictor) { if (!cvar_airblast.GetBool()) { - DETOUR_MEMBER_CALL(CTFPlayer_ApplyGenericPushbackImpulse)(impulse, inflictor); + DETOUR_MEMBER_CALL(impulse, inflictor); } } diff --git a/src/mod/debug/onkilled_before_mainaction_start.cpp b/src/mod/debug/onkilled_before_mainaction_start.cpp index d09df5ef..7744986b 100644 --- a/src/mod/debug/onkilled_before_mainaction_start.cpp +++ b/src/mod/debug/onkilled_before_mainaction_start.cpp @@ -68,7 +68,7 @@ namespace Mod::Debug::OnKilled_Before_MainAction_Start } } - return DETOUR_MEMBER_CALL(CTFBotMainAction_OnStart)(actor, action); + return DETOUR_MEMBER_CALL(actor, action); } ConVar cvar_fix_update("sig_debug_onkilled_before_mainaction_start_fix_update", "0", FCVAR_NOTIFY, @@ -89,7 +89,7 @@ namespace Mod::Debug::OnKilled_Before_MainAction_Start } } - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } @@ -107,7 +107,7 @@ namespace Mod::Debug::OnKilled_Before_MainAction_Start } } - return DETOUR_MEMBER_CALL(Action_CTFBot_OnKilled)(actor, info); + return DETOUR_MEMBER_CALL(actor, info); } #endif @@ -124,7 +124,7 @@ namespace Mod::Debug::OnKilled_Before_MainAction_Start DevMsg("\n\n\n"); } - return DETOUR_MEMBER_CALL(CTFBotFetchFlag_OnStart)(actor, action); + return DETOUR_MEMBER_CALL(actor, action); } DETOUR_DECL_MEMBER(ActionResult, CTFBotFetchFlag_Update, CTFBot *actor, float dt) @@ -139,7 +139,7 @@ namespace Mod::Debug::OnKilled_Before_MainAction_Start DevMsg("\n\n\n"); } - return DETOUR_MEMBER_CALL(CTFBotFetchFlag_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } diff --git a/src/mod/debug/override_step_sound_v1.cpp b/src/mod/debug/override_step_sound_v1.cpp index 5544e540..45957cfa 100644 --- a/src/mod/debug/override_step_sound_v1.cpp +++ b/src/mod/debug/override_step_sound_v1.cpp @@ -23,7 +23,7 @@ namespace Mod::Debug::Override_Step_Sound DETOUR_DECL_MEMBER(void, CBasePlayer_PlayStepSound, Vector& vecOrigin, surfacedata_t *psurface, float fvol, bool force) { SCOPED_INCREMENT(rc_PlayStepSound); - DETOUR_MEMBER_CALL(CBasePlayer_PlayStepSound)(vecOrigin, psurface, fvol, force); + DETOUR_MEMBER_CALL(vecOrigin, psurface, fvol, force); } DETOUR_DECL_MEMBER(void, CRecipientFilter_RemoveRecipientsByPVS, const Vector& origin) @@ -32,7 +32,7 @@ namespace Mod::Debug::Override_Step_Sound return; } - DETOUR_MEMBER_CALL(CRecipientFilter_RemoveRecipientsByPVS)(origin); + DETOUR_MEMBER_CALL(origin); } diff --git a/src/mod/debug/override_step_sound_v2.cpp b/src/mod/debug/override_step_sound_v2.cpp index 690ca4d0..1f80b7bd 100644 --- a/src/mod/debug/override_step_sound_v2.cpp +++ b/src/mod/debug/override_step_sound_v2.cpp @@ -30,7 +30,7 @@ namespace Mod::Debug::Override_Step_Sound DETOUR_DECL_MEMBER(void, CBasePlayer_PlayStepSound, Vector& vecOrigin, surfacedata_t *psurface, float fvol, bool force) { SCOPED_INCREMENT(rc_PlayStepSound); - DETOUR_MEMBER_CALL(CBasePlayer_PlayStepSound)(vecOrigin, psurface, fvol, force); + DETOUR_MEMBER_CALL(vecOrigin, psurface, fvol, force); } DETOUR_DECL_MEMBER(void, CRecipientFilter_RemoveRecipientsByPVS, const Vector& origin) @@ -39,7 +39,7 @@ namespace Mod::Debug::Override_Step_Sound return; } - DETOUR_MEMBER_CALL(CRecipientFilter_RemoveRecipientsByPVS)(origin); + DETOUR_MEMBER_CALL(origin); } diff --git a/src/mod/debug/parachute_warp.cpp b/src/mod/debug/parachute_warp.cpp index 7780004d..dd55bc08 100644 --- a/src/mod/debug/parachute_warp.cpp +++ b/src/mod/debug/parachute_warp.cpp @@ -38,7 +38,7 @@ namespace Mod::Debug::Parachute_Warp BACKTRACE(); SCOPED_INCREMENT(rc_INextBot_Update); - DETOUR_MEMBER_CALL(INextBot_Update)(); + DETOUR_MEMBER_CALL(); TRACE_EXIT("%s", PrintAbsOrigin(bot)); } @@ -49,7 +49,7 @@ namespace Mod::Debug::Parachute_Warp auto bot = rtti_cast(loco->GetBot()); TRACE("%s", PrintAbsOrigin(bot)); - DETOUR_MEMBER_CALL(PlayerLocomotion_Update)(); + DETOUR_MEMBER_CALL(); TRACE_EXIT("%s", PrintAbsOrigin(bot)); } @@ -59,7 +59,7 @@ namespace Mod::Debug::Parachute_Warp auto bot = rtti_cast(body->GetBot()); TRACE("%s", PrintAbsOrigin(bot)); - DETOUR_MEMBER_CALL(IBody_Update)(); + DETOUR_MEMBER_CALL(); TRACE_EXIT("%s", PrintAbsOrigin(bot)); } @@ -69,7 +69,7 @@ namespace Mod::Debug::Parachute_Warp auto bot = rtti_cast(intent->GetBot()); TRACE("%s", PrintAbsOrigin(bot)); - DETOUR_MEMBER_CALL(CTFBot_CTFBotIntention_Update)(); + DETOUR_MEMBER_CALL(); TRACE_EXIT("%s", PrintAbsOrigin(bot)); } @@ -79,7 +79,7 @@ namespace Mod::Debug::Parachute_Warp auto bot = rtti_cast(vision->GetBot()); TRACE("%s", PrintAbsOrigin(bot)); - DETOUR_MEMBER_CALL(CTFBotVision_Update)(); + DETOUR_MEMBER_CALL(); TRACE_EXIT("%s", PrintAbsOrigin(bot)); } @@ -90,7 +90,7 @@ namespace Mod::Debug::Parachute_Warp SCOPED_INCREMENT(rc_CTFBotMainAction_Update); TRACE("%s", PrintAbsOrigin(actor)); - auto result = DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); TRACE_EXIT("%s", PrintAbsOrigin(actor)); return result; } @@ -98,7 +98,7 @@ namespace Mod::Debug::Parachute_Warp DETOUR_DECL_MEMBER(ActionResult, CTFBotTacticalMonitor_Update, CTFBot *actor, float dt) { TRACE("%s", PrintAbsOrigin(actor)); - auto result = DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); TRACE_EXIT("%s", PrintAbsOrigin(actor)); return result; } @@ -106,7 +106,7 @@ namespace Mod::Debug::Parachute_Warp DETOUR_DECL_MEMBER(ActionResult, CTFBotScenarioMonitor_Update, CTFBot *actor, float dt) { TRACE("%s", PrintAbsOrigin(actor)); - auto result = DETOUR_MEMBER_CALL(CTFBotScenarioMonitor_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); TRACE_EXIT("%s", PrintAbsOrigin(actor)); return result; } @@ -114,7 +114,7 @@ namespace Mod::Debug::Parachute_Warp DETOUR_DECL_MEMBER(ActionResult, CTFBotFetchFlag_Update, CTFBot *actor, float dt) { TRACE("%s", PrintAbsOrigin(actor)); - auto result = DETOUR_MEMBER_CALL(CTFBotFetchFlag_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); TRACE_EXIT("%s", PrintAbsOrigin(actor)); return result; } @@ -122,7 +122,7 @@ namespace Mod::Debug::Parachute_Warp DETOUR_DECL_MEMBER(ActionResult, CTFBotAttackFlagDefenders_Update, CTFBot *actor, float dt) { TRACE("%s", PrintAbsOrigin(actor)); - auto result = DETOUR_MEMBER_CALL(CTFBotAttackFlagDefenders_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); TRACE_EXIT("%s", PrintAbsOrigin(actor)); return result; } @@ -130,7 +130,7 @@ namespace Mod::Debug::Parachute_Warp DETOUR_DECL_MEMBER(ActionResult, CTFBotDeliverFlag_Update, CTFBot *actor, float dt) { TRACE("%s", PrintAbsOrigin(actor)); - auto result = DETOUR_MEMBER_CALL(CTFBotDeliverFlag_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); TRACE_EXIT("%s", PrintAbsOrigin(actor)); return result; } @@ -144,7 +144,7 @@ namespace Mod::Debug::Parachute_Warp BACKTRACE(); } - DETOUR_MEMBER_CALL(CBaseEntity_SetAbsOrigin)(absOrigin); + DETOUR_MEMBER_CALL(absOrigin); } diff --git a/src/mod/debug/penetration.cpp b/src/mod/debug/penetration.cpp index 6f26716f..5760a6fc 100644 --- a/src/mod/debug/penetration.cpp +++ b/src/mod/debug/penetration.cpp @@ -42,7 +42,7 @@ namespace Mod::Debug::Penetration DevMsg(" has_pen = %s\n", (has_pen ? "true" : "false")); SCOPED_INCREMENT(rc_CTFPlayer_FireBullet); - DETOUR_MEMBER_CALL(CTFPlayer_FireBullet)(weapon, info, bDoEffects, nDamageType, nCustomDamageType); + DETOUR_MEMBER_CALL(weapon, info, bDoEffects, nDamageType, nCustomDamageType); DevMsg("CTFPlayer::FireBullet END\n"); } @@ -53,7 +53,7 @@ namespace Mod::Debug::Penetration DevMsg(" IEngineTrace::EnumerateEntities BEGIN\n"); SCOPED_INCREMENT(rc_IEngineTrace_EnumerateEntities); - DETOUR_MEMBER_CALL(IEngineTrace_EnumerateEntities_ray)(ray, triggers, pEnumerator); + DETOUR_MEMBER_CALL(ray, triggers, pEnumerator); auto pen = reinterpret_cast(pEnumerator); FOR_EACH_VEC(pen->vec, i) { @@ -72,7 +72,7 @@ namespace Mod::Debug::Penetration int count_before = pen->vec.Count(); - bool result = DETOUR_MEMBER_CALL(CBulletPenetrateEnum_EnumEntity)(pHandleEntity); + bool result = DETOUR_MEMBER_CALL(pHandleEntity); if (rc_CTFPlayer_FireBullet > 0 && rc_IEngineTrace_EnumerateEntities > 0) { bool was_added = (pen->vec.Count() != count_before); @@ -99,7 +99,7 @@ namespace Mod::Debug::Penetration ENTINDEX(ent), info.GetPlayerPenetrationCount()); } - DETOUR_MEMBER_CALL(CBaseEntity_DispatchTraceAttack)(info, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(info, vecDir, ptr, pAccumulator); } diff --git a/src/mod/debug/popmgr_exploit.cpp b/src/mod/debug/popmgr_exploit.cpp index 2c9d988f..7adc22db 100644 --- a/src/mod/debug/popmgr_exploit.cpp +++ b/src/mod/debug/popmgr_exploit.cpp @@ -193,7 +193,7 @@ namespace Mod::Debug::PopMgr_Exploit DETOUR_DECL_MEMBER(UNKNOWN_0x24, CPackedStore_OpenFile, const char *path) { ConColorMsg(Color(0xff, 0x00, 0xff, 0xff), "CPackedStore::OpenFile: \"%s\"\n", path); - return DETOUR_MEMBER_CALL(CPackedStore_OpenFile)(path); + return DETOUR_MEMBER_CALL(path); } @@ -352,7 +352,7 @@ namespace Mod::Debug::PopMgr_Exploit DevMsg("CTFGameRules::SetNextMvMPopfile PRE \"%s\"\n", MakePrintable(popfile)); DumpMem(); - DETOUR_MEMBER_CALL(CTFGameRules_SetNextMvMPopfile)(popfile); + DETOUR_MEMBER_CALL(popfile); DevMsg("CTFGameRules::SetNextMvMPopfile POST \"%s\"\n", MakePrintable(popfile)); DumpMem(); @@ -365,7 +365,7 @@ namespace Mod::Debug::PopMgr_Exploit SCOPED_INCREMENT(rc_LoadMvMMission); DevMsg("CPopulationManager::LoadMvMMission PRE\n"); - auto result = DETOUR_MEMBER_CALL(CPopulationManager_LoadMvMMission)(kv); + auto result = DETOUR_MEMBER_CALL(kv); DevMsg("CPopulationManager::LoadMvMMission POST: %s\n", (result ? "TRUE" : "FALSE")); if (!result) { @@ -391,7 +391,7 @@ namespace Mod::Debug::PopMgr_Exploit DETOUR_DECL_MEMBER(bool, CBaseFileSystem_FileExists, const char *pFileName, const char *pPathID) { - auto result = DETOUR_MEMBER_CALL(CBaseFileSystem_FileExists)(pFileName, pPathID); + auto result = DETOUR_MEMBER_CALL(pFileName, pPathID); if (rc_LoadMvMMission > 0) { DevMsg("CBaseFileSystem::FileExists(\"%s\", \"%s\") = %s\n", MakePrintable(pFileName), pPathID, diff --git a/src/mod/debug/proj_energy_ball.cpp b/src/mod/debug/proj_energy_ball.cpp index 3e2c3b85..a9ec49de 100644 --- a/src/mod/debug/proj_energy_ball.cpp +++ b/src/mod/debug/proj_energy_ball.cpp @@ -165,7 +165,7 @@ namespace Mod::Debug::Proj_Energy_Ball radiusinfo = &info; SCOPED_INCREMENT(rc_CTFGameRules_RadiusDamage); - DETOUR_MEMBER_CALL(CTFGameRules_RadiusDamage)(info); + DETOUR_MEMBER_CALL(info); } ConVar cvar_spheretext("sig_visualize_blast_radius_spheretext", "1", FCVAR_NOTIFY, @@ -249,14 +249,14 @@ namespace Mod::Debug::Proj_Energy_Ball //NDebugOverlay::EntityTextAtPosition(radiusinfo->m_vecOrigin, 1, buf, cvar_duration_sphere.GetFloat(), 0xff, 0xff, 0xff, 0xff); } - DETOUR_MEMBER_CALL(CEntitySphereQuery_ctor)(center, radius, flagMask); + DETOUR_MEMBER_CALL(center, radius, flagMask); } RefCount rc_CTFRadiusDamageInfo_ApplyToEntity; DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, int, CTFRadiusDamageInfo_ApplyToEntity, CBaseEntity *ent) { if (rc_CTFGameRules_RadiusDamage > 0) ++rc_CTFRadiusDamageInfo_ApplyToEntity; - auto result = DETOUR_MEMBER_CALL(CTFRadiusDamageInfo_ApplyToEntity)(ent); + auto result = DETOUR_MEMBER_CALL(ent); if (rc_CTFGameRules_RadiusDamage > 0) --rc_CTFRadiusDamageInfo_ApplyToEntity; return result; } @@ -316,7 +316,7 @@ namespace Mod::Debug::Proj_Energy_Ball } } - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } #endif diff --git a/src/mod/debug/rage.cpp b/src/mod/debug/rage.cpp index 846a8777..ad187b25 100644 --- a/src/mod/debug/rage.cpp +++ b/src/mod/debug/rage.cpp @@ -20,7 +20,7 @@ namespace Mod::Debug::Rage auto shared = reinterpret_cast(this); float rage_pre = shared->m_flRageMeter; - DETOUR_MEMBER_CALL(CTFPlayerShared_ModifyRage)(delta); + DETOUR_MEMBER_CALL(delta); float rage_post = shared->m_flRageMeter; CTFPlayer *player = shared->GetOuter(); diff --git a/src/mod/debug/revive_exploit.cpp b/src/mod/debug/revive_exploit.cpp index bb4f37de..7b615e7a 100644 --- a/src/mod/debug/revive_exploit.cpp +++ b/src/mod/debug/revive_exploit.cpp @@ -77,7 +77,7 @@ namespace Mod::Debug::Revive_Exploit return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_ClientCommand)(args); + return DETOUR_MEMBER_CALL(args); } diff --git a/src/mod/debug/revive_fast.cpp b/src/mod/debug/revive_fast.cpp index 36b792d2..9c058638 100644 --- a/src/mod/debug/revive_fast.cpp +++ b/src/mod/debug/revive_fast.cpp @@ -6,7 +6,7 @@ namespace Mod::Debug::Revive_Fast { DETOUR_DECL_MEMBER(CTFReviveMarker *, CTFReviveMarker_Create) { - CTFReviveMarker *marker = DETOUR_MEMBER_CALL(CTFReviveMarker_Create)(); + CTFReviveMarker *marker = DETOUR_MEMBER_CALL(); if (marker != nullptr) { DevMsg("[%8.3f] CTFReviveMarker::Create\n" @@ -28,12 +28,12 @@ namespace Mod::Debug::Revive_Fast gpGlobals->curtime, amount, marker->GetHealth(), marker->GetMaxHealth()); } - DETOUR_MEMBER_CALL(CTFReviveMarker_AddMarkerHealth)(amount); + DETOUR_MEMBER_CALL(amount); } DETOUR_DECL_MEMBER(void, CTFReviveMarker_ReviveThink) { - DETOUR_MEMBER_CALL(CTFReviveMarker_ReviveThink)(); + DETOUR_MEMBER_CALL(); auto marker = reinterpret_cast(this); if (marker != nullptr) { diff --git a/src/mod/debug/sentrybuster_mannhattan.cpp b/src/mod/debug/sentrybuster_mannhattan.cpp index a8c6faef..1af643d7 100644 --- a/src/mod/debug/sentrybuster_mannhattan.cpp +++ b/src/mod/debug/sentrybuster_mannhattan.cpp @@ -15,7 +15,7 @@ namespace Mod::Debug::SentryBuster_Mannhattan messages.clear(); SCOPED_INCREMENT(rc_CTFBotTacticalMonitor_OnNavAreaChanged); - auto result = DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_OnNavAreaChanged)(actor, area1, area2); + auto result = DETOUR_MEMBER_CALL(actor, area1, area2); if (result.transition == ActionTransition::SUSPEND_FOR) { DevMsg("CTFBotTacticalMonitor::OnNavAreaChanged\n"); @@ -32,7 +32,7 @@ namespace Mod::Debug::SentryBuster_Mannhattan { auto trigger = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CBaseTrigger_PassesTriggerFilters)(pOther); + auto result = DETOUR_MEMBER_CALL(pOther); if (rc_CTFBotTacticalMonitor_OnNavAreaChanged > 0) { diff --git a/src/mod/debug/shortcircuit_rubberband.cpp b/src/mod/debug/shortcircuit_rubberband.cpp index 2810b3f2..5e0b80dc 100644 --- a/src/mod/debug/shortcircuit_rubberband.cpp +++ b/src/mod/debug/shortcircuit_rubberband.cpp @@ -49,12 +49,12 @@ namespace Mod::Debug::ShortCircuit_RubberBand { // lagcomp_currentplayer = player; ClientMsgAllTick("- lagcompensation->StartLagCompensation\n"); - DETOUR_MEMBER_CALL(CLagCompensationManager_StartLagCompensation)(player, cmd); + DETOUR_MEMBER_CALL(player, cmd); } DETOUR_DECL_MEMBER(void, CLagCompensationManager_FinishLagCompensation, CBasePlayer *player) { - DETOUR_MEMBER_CALL(CLagCompensationManager_FinishLagCompensation)(player); + DETOUR_MEMBER_CALL(player); ClientMsgAllTick("- lagcompensation->FinishLagCompensation\n"); // lagcomp_currentplayer = nullptr; } @@ -66,7 +66,7 @@ namespace Mod::Debug::ShortCircuit_RubberBand DETOUR_DECL_MEMBER(bool, CTFMechanicalArm_ShockAttack) { ClientMsgAllTick("CTFMechanicalArm::ShockAttack BEGIN\n"); - auto result = DETOUR_MEMBER_CALL(CTFMechanicalArm_ShockAttack)(); + auto result = DETOUR_MEMBER_CALL(); ClientMsgAllTick("CTFMechanicalArm::ShockAttack END\n"); if (lagcompensation->IsCurrentlyDoingLagCompensation()) { diff --git a/src/mod/debug/sound_leak.cpp b/src/mod/debug/sound_leak.cpp index 4862deaa..aa8129af 100644 --- a/src/mod/debug/sound_leak.cpp +++ b/src/mod/debug/sound_leak.cpp @@ -80,7 +80,7 @@ namespace Mod::Debug::Sound_Leak LOGMEM("[%12.7f] BEGIN S_Play\n", Plat_FloatTime()); { SCOPED_INCREMENT(rc_S_Play); - DETOUR_STATIC_CALL(S_Play)(pszName, flush); + DETOUR_STATIC_CALL(pszName, flush); } LOGMEM("[%12.7f] END S_Play\n\n", Plat_FloatTime()); } @@ -93,7 +93,7 @@ namespace Mod::Debug::Sound_Leak std::lock_guard lock(m_Alloc); SCOPED_INCREMENT(rc_Alloc); - auto result = DETOUR_MEMBER_CALL(IMemAlloc_Alloc)(nSize); + auto result = DETOUR_MEMBER_CALL(nSize); if (mem_tracking && rc_Alloc <= 1 && nSize >= (size_t)cvar_minimum.GetInt()) { if (mems.find(result) == mems.end()) { @@ -118,7 +118,7 @@ namespace Mod::Debug::Sound_Leak std::lock_guard lock(m_Realloc); SCOPED_INCREMENT(rc_Realloc); - auto result = DETOUR_MEMBER_CALL(IMemAlloc_Realloc)(pMem, nSize); + auto result = DETOUR_MEMBER_CALL(pMem, nSize); if (mem_tracking && rc_Realloc <= 1 && nSize >= (size_t)cvar_minimum.GetInt()) { auto it = mems.find(pMem); @@ -166,7 +166,7 @@ namespace Mod::Debug::Sound_Leak // } } - DETOUR_MEMBER_CALL(IMemAlloc_Free)(pMem); + DETOUR_MEMBER_CALL(pMem); } @@ -179,7 +179,7 @@ namespace Mod::Debug::Sound_Leak ++num_CAudioMixerWaveMP3; LOGMEM("+++ CAudioMixerWaveMP3 @ 0x%08x [total: %d]\n", (uintptr_t)this, num_CAudioMixerWaveMP3); - DETOUR_MEMBER_CALL(CAudioMixerWaveMP3_ctor)(i1); + DETOUR_MEMBER_CALL(i1); } DETOUR_DECL_MEMBER(void, CAudioMixerWaveMP3_dtor, uint32_t i1) @@ -188,7 +188,7 @@ namespace Mod::Debug::Sound_Leak --num_CAudioMixerWaveMP3; LOGMEM("--- CAudioMixerWaveMP3 @ 0x%08x [total: %d]\n", (uintptr_t)this, num_CAudioMixerWaveMP3); - DETOUR_MEMBER_CALL(CAudioMixerWaveMP3_dtor)(i1); + DETOUR_MEMBER_CALL(i1); } @@ -201,7 +201,7 @@ namespace Mod::Debug::Sound_Leak ++num_CWaveDataStreamAsync; LOGMEM("+++ CWaveDataStreamAsync @ 0x%08x [total: %d]\n", (uintptr_t)this, num_CWaveDataStreamAsync); - DETOUR_MEMBER_CALL(CWaveDataStreamAsync_ctor)(r1, p1, s1, i1, i2, p2, i3); + DETOUR_MEMBER_CALL(r1, p1, s1, i1, i2, p2, i3); } DETOUR_DECL_MEMBER(void, CWaveDataStreamAsync_dtor, uint32_t i1) @@ -210,7 +210,7 @@ namespace Mod::Debug::Sound_Leak --num_CWaveDataStreamAsync; LOGMEM("--- CWaveDataStreamAsync @ 0x%08x [total: %d]\n", (uintptr_t)this, num_CWaveDataStreamAsync); - DETOUR_MEMBER_CALL(CWaveDataStreamAsync_dtor)(i1); + DETOUR_MEMBER_CALL(i1); } diff --git a/src/mod/debug/sticky_detonation_delay.cpp b/src/mod/debug/sticky_detonation_delay.cpp index cd63dad8..579e7870 100644 --- a/src/mod/debug/sticky_detonation_delay.cpp +++ b/src/mod/debug/sticky_detonation_delay.cpp @@ -15,7 +15,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay { auto player = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFPlayer_DoClassSpecialSkill)(); + auto result = DETOUR_MEMBER_CALL(); ClientMsgAll("[%8.3f] CTFPlayer[#%d]::DoClassSpecialSkill() = %s\n", gpGlobals->curtime, ENTINDEX(player), (result ? "TRUE" : "FALSE")); @@ -31,7 +31,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay ClientMsgAll("[%8.3f] CTFGrenadeLauncher[#%d]::SecondaryAttack()\n", gpGlobals->curtime, ENTINDEX(weapon)); - DETOUR_MEMBER_CALL(CTFGrenadeLauncher_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPipebombLauncher_SecondaryAttack) @@ -41,7 +41,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay ClientMsgAll("[%8.3f] CTFPipebombLauncher[#%d]::SecondaryAttack()\n", gpGlobals->curtime, ENTINDEX(weapon)); - DETOUR_MEMBER_CALL(CTFPipebombLauncher_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseMelee_SecondaryAttack) @@ -51,7 +51,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay ClientMsgAll("[%8.3f] CTFWeaponBaseMelee[#%d]::SecondaryAttack()\n", gpGlobals->curtime, ENTINDEX(weapon)); - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); } @@ -61,7 +61,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay { auto player = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFPlayer_CanAttack)(flags); + auto result = DETOUR_MEMBER_CALL(flags); ClientMsgAll("[%8.3f] CTFPlayer[#%d]::CanAttack(%08x) = %s\n", gpGlobals->curtime, ENTINDEX(player), flags, (result ? "TRUE" : "FALSE")); @@ -76,7 +76,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay { auto weapon = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_CanPerformSecondaryAttack)(); + auto result = DETOUR_MEMBER_CALL(); ClientMsgAll("[%8.3f] CTFWeaponBase[#%d '%s']::CanPerformSecondaryAttack() = %s\n", gpGlobals->curtime, ENTINDEX(weapon), weapon->GetClassname(), (result ? "TRUE" : "FALSE")); @@ -126,7 +126,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay } } - DETOUR_MEMBER_CALL(CTFWeaponBase_ItemPostFrame)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFWeaponBase_ItemBusyFrame) @@ -150,7 +150,7 @@ namespace Mod::Debug::Sticky_Detonation_Delay } } - DETOUR_MEMBER_CALL(CTFWeaponBase_ItemBusyFrame)(); + DETOUR_MEMBER_CALL(); } diff --git a/src/mod/debug/sticky_detonation_order.cpp b/src/mod/debug/sticky_detonation_order.cpp index 01b690f6..7302d246 100644 --- a/src/mod/debug/sticky_detonation_order.cpp +++ b/src/mod/debug/sticky_detonation_order.cpp @@ -27,7 +27,7 @@ namespace Mod::Debug::Sticky_Detonation_Order ClientMsgAllIndent("CBaseEntity::TakeDamage\n"); ++indent; - auto result = DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(inputInfo); + auto result = DETOUR_MEMBER_CALL(inputInfo); --indent; return result; @@ -39,7 +39,7 @@ namespace Mod::Debug::Sticky_Detonation_Order ClientMsgAllIndent("BEGIN CTFWeaponBaseGrenadeProj::Explode\n"); ++indent; - DETOUR_MEMBER_CALL(CTFWeaponBaseGrenadeProj_Explode)(pTrace, bitsDamageType); + DETOUR_MEMBER_CALL(pTrace, bitsDamageType); --indent; ClientMsgAllIndent("END CTFWeaponBaseGrenadeProj::Explode\n"); @@ -52,7 +52,7 @@ namespace Mod::Debug::Sticky_Detonation_Order (bFizzle ? "true" : "false")); ++indent; - auto result = DETOUR_MEMBER_CALL(CTFPipebombLauncher_DetonateRemotePipebombs)(bFizzle); + auto result = DETOUR_MEMBER_CALL(bFizzle); --indent; ClientMsgAllIndent("END CTFPipebombLauncher::DetonateRemotePipebombs [%s]\n", diff --git a/src/mod/debug/suicide_bomber.cpp b/src/mod/debug/suicide_bomber.cpp index 56852835..357d1524 100644 --- a/src/mod/debug/suicide_bomber.cpp +++ b/src/mod/debug/suicide_bomber.cpp @@ -197,7 +197,7 @@ namespace Mod::Debug::Suicide_Bomber auto me = reinterpret_cast(this); DevMsg("\n[OnStart] <== %s\n", (action != nullptr ? action->GetName() : "NULL")); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_OnStart)(actor, action); + auto result = DETOUR_MEMBER_CALL(actor, action); if (me != nullptr && actor != nullptr) { DrawOverlays(me, actor); @@ -215,7 +215,7 @@ namespace Mod::Debug::Suicide_Bomber SCOPED_INCREMENT(rc_CTFBotMissionSuicideBomber_Update); DevMsg("\n[Update]\n"); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (me != nullptr && actor != nullptr) { DrawOverlays(me, actor); @@ -229,14 +229,14 @@ namespace Mod::Debug::Suicide_Bomber // DETOUR_DECL_MEMBER(void, CTFBotMissionSuicideBomber_OnEnd, CTFBot *actor, Action *action) // { // DevMsg("\n[OnEnd] ==> %s\n", (action != nullptr ? action->GetName() : "NULL")); -// DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_OnEnd)(actor, action); +// DETOUR_MEMBER_CALL(actor, action); // } DETOUR_DECL_MEMBER(EventDesiredResult, CTFBotMissionSuicideBomber_OnStuck, CTFBot *actor) { DevMsg("\n[OnStuck]\n"); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_OnStuck)(actor); + auto result = DETOUR_MEMBER_CALL(actor); DevMsg(" result: %s\n", ActionResult_ToString(result)); return result; @@ -245,7 +245,7 @@ namespace Mod::Debug::Suicide_Bomber DETOUR_DECL_MEMBER(EventDesiredResult, CTFBotMissionSuicideBomber_OnKilled, CTFBot *actor, const CTakeDamageInfo& info) { DevMsg("\n[OnKilled]\n"); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_OnKilled)(actor, info); + auto result = DETOUR_MEMBER_CALL(actor, info); DevMsg(" result: %s\n", ActionResult_ToString(result)); return result; @@ -257,19 +257,19 @@ namespace Mod::Debug::Suicide_Bomber DevMsg(" StartDetonate(reached_goal:%s lost_all_health:%s)\n", (reached_goal ? "YES" : "NO"), (lost_all_health ? "YES" : "NO")); - DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_StartDetonate)(actor, reached_goal, lost_all_health); + DETOUR_MEMBER_CALL(actor, reached_goal, lost_all_health); } DETOUR_DECL_MEMBER(void, CTFBotMissionSuicideBomber_Detonate, CTFBot *actor) { DevMsg(" Detonate()\n"); - DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_Detonate)(actor); + DETOUR_MEMBER_CALL(actor); } DETOUR_DECL_MEMBER(bool, Path_Compute_vec_CTFBotPathCost, INextBot *nextbot, const Vector& vec, CTFBotPathCost& cost_func, float maxPathLength, bool b1) { - auto result = DETOUR_MEMBER_CALL(Path_Compute_vec_CTFBotPathCost)(nextbot, vec, cost_func, maxPathLength, b1); + auto result = DETOUR_MEMBER_CALL(nextbot, vec, cost_func, maxPathLength, b1); if (rc_CTFBotMissionSuicideBomber_Update > 0) { DevMsg(" Path::Compute: %s\n", (result ? "SUCCESS" : "FAIL")); diff --git a/src/mod/debug/tank_destroy_animation.cpp b/src/mod/debug/tank_destroy_animation.cpp index 933e9e66..569942e2 100644 --- a/src/mod/debug/tank_destroy_animation.cpp +++ b/src/mod/debug/tank_destroy_animation.cpp @@ -13,17 +13,17 @@ namespace Mod::Debug::Tank_Destroy_Animation DETOUR_DECL_MEMBER(void, CTFTankDestruction_Spawn) { SCOPED_INCREMENT(rc_CTFTankDestruction_Spawn); - DETOUR_MEMBER_CALL(CTFTankDestruction_Spawn)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CBaseAnimating_LookupSequence, const char *label) { if (rc_CTFTankDestruction_Spawn > 0) { - return DETOUR_MEMBER_CALL(CBaseAnimating_LookupSequence)(cvar_override.GetString()); + return DETOUR_MEMBER_CALL(cvar_override.GetString()); } - return DETOUR_MEMBER_CALL(CBaseAnimating_LookupSequence)(label); + return DETOUR_MEMBER_CALL(label); } diff --git a/src/mod/debug/tele_autodetonate.cpp b/src/mod/debug/tele_autodetonate.cpp index e6eaa832..61c78883 100644 --- a/src/mod/debug/tele_autodetonate.cpp +++ b/src/mod/debug/tele_autodetonate.cpp @@ -22,12 +22,12 @@ namespace Mod::Debug::Tele_AutoDetonate NDebugOverlay::Clear(); SCOPED_INCREMENT(rc_CObjectTeleporter_RecieveTeleportingPlayer); - DETOUR_MEMBER_CALL(CObjectTeleporter_RecieveTeleportingPlayer)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, ISpatialPartition_EnumerateElementsInBox, SpatialPartitionListMask_t listMask, const Vector& mins, const Vector& maxs, bool coarseTest, IPartitionEnumerator *pIterator) { - DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInBox)(listMask, mins, maxs, coarseTest, pIterator); + DETOUR_MEMBER_CALL(listMask, mins, maxs, coarseTest, pIterator); if (rc_CObjectTeleporter_RecieveTeleportingPlayer > 0) { NDebugOverlay::Box(mins, vec3_origin, maxs - mins, 0xff, 0xff, 0xff, 0x10, 3600.0f); diff --git a/src/mod/debug/tele_sapper.cpp b/src/mod/debug/tele_sapper.cpp index 888de37f..edcb466c 100644 --- a/src/mod/debug/tele_sapper.cpp +++ b/src/mod/debug/tele_sapper.cpp @@ -146,7 +146,7 @@ namespace Mod::Debug::Tele_Sapper } } - return DETOUR_MEMBER_CALL(Action_CTFBot_OnCommandString)(actor, cmd); + return DETOUR_MEMBER_CALL(actor, cmd); } @@ -161,7 +161,7 @@ namespace Mod::Debug::Tele_Sapper return *CBaseObject_m_bHasSapper(reinterpret_cast(this)); } - return DETOUR_MEMBER_CALL(CBaseObject_HasSapper)(); + return DETOUR_MEMBER_CALL(); } @@ -178,7 +178,7 @@ namespace Mod::Debug::Tele_Sapper DevMsg("CBaseObject::SetPlasmaDisabled(#%d, %.1f)\n", ENTINDEX(obj), duration); - DETOUR_MEMBER_CALL(CBaseObject_SetPlasmaDisabled)(duration); + DETOUR_MEMBER_CALL(duration); } diff --git a/src/mod/debug/upgrade_tiers.cpp b/src/mod/debug/upgrade_tiers.cpp index c97e972d..860bb8c7 100644 --- a/src/mod/debug/upgrade_tiers.cpp +++ b/src/mod/debug/upgrade_tiers.cpp @@ -25,7 +25,7 @@ namespace Mod::Debug::Upgrade_Tiers { - auto result = DETOUR_STATIC_CALL(GetUpgradeStepData)(player, slot, tier, count, b1); + auto result = DETOUR_STATIC_CALL(player, slot, tier, count, b1); diff --git a/src/mod/debug/useitem_broken.cpp b/src/mod/debug/useitem_broken.cpp index 854b4bbc..07eeaea4 100644 --- a/src/mod/debug/useitem_broken.cpp +++ b/src/mod/debug/useitem_broken.cpp @@ -203,7 +203,7 @@ namespace Mod::Debug::UseItem_Broken ClientMsgAll(" \n[%8.3f] CTFBotUseItem::OnStart(#%d)\n", gpGlobals->curtime, ENTINDEX(actor)); SCOPED_INCREMENT(rc_CTFBotUseItem_OnStart); - auto result = DETOUR_MEMBER_CALL(CTFBotUseItem_OnStart)(actor, action); + auto result = DETOUR_MEMBER_CALL(actor, action); ClientMsgAll("%*sItem's m_flNextPrimaryAttack @ %.3f\n", 13, " ", (float)useitem->m_hItem->m_flNextPrimaryAttack); ClientMsgAll("%*sInitial delay timer set to %.3f sec duration; will elapse @ %.3f\n", 13, " ", useitem->m_ctInitialDelay.GetCountdownDuration(), gpGlobals->curtime + useitem->m_ctInitialDelay.GetRemainingTime()); ClientMsgAll("%*s%s\n", 13, " ", ActionResult_ToString(result)); @@ -232,7 +232,7 @@ namespace Mod::Debug::UseItem_Broken } SCOPED_INCREMENT(rc_CTFBotUseItem_Update); - auto result = DETOUR_MEMBER_CALL(CTFBotUseItem_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); ClientMsgAll("%*s%s\n", 13, " ", ActionResult_ToString(result)); return result; } @@ -243,7 +243,7 @@ namespace Mod::Debug::UseItem_Broken ClientMsgAll(" \n[%8.3f] CTFBotUseItem::OnEnd(#%d)\n", gpGlobals->curtime, ENTINDEX(actor)); SCOPED_INCREMENT(rc_CTFBotUseItem_OnEnd); - DETOUR_MEMBER_CALL(CTFBotUseItem_OnEnd)(actor, action); + DETOUR_MEMBER_CALL(actor, action); ClientMsgAll(" \n================================================================================\n"); } @@ -257,7 +257,7 @@ namespace Mod::Debug::UseItem_Broken constexpr int OFF_m_RequiredWeapons = 0x25c4; auto m_RequiredWeapons = reinterpret_cast> *>((uintptr_t)bot + OFF_m_RequiredWeapons); - DETOUR_MEMBER_CALL(CTFBot_PushRequiredWeapon)(weapon); + DETOUR_MEMBER_CALL(weapon); if (rc_CTFBotUseItem_OnStart > 0) { ClientMsgAll("%*sCTFBot::PushRequiredWeapon: stack:", 13, " "); FOR_EACH_VEC((*m_RequiredWeapons), i) { @@ -280,7 +280,7 @@ namespace Mod::Debug::UseItem_Broken constexpr int OFF_m_RequiredWeapons = 0x25c4; auto m_RequiredWeapons = reinterpret_cast> *>((uintptr_t)bot + OFF_m_RequiredWeapons); - DETOUR_MEMBER_CALL(CTFBot_PopRequiredWeapon)(); + DETOUR_MEMBER_CALL(); if (rc_CTFBotUseItem_OnEnd > 0) { ClientMsgAll("%*sCTFBot::PopRequiredWeapon: stack:", 13, " "); FOR_EACH_VEC((*m_RequiredWeapons), i) { @@ -301,7 +301,7 @@ namespace Mod::Debug::UseItem_Broken auto bot = reinterpret_cast(this); const char *before = (bot->GetActiveTFWeapon() != nullptr ? WeaponID_ToString(bot->GetActiveTFWeapon()->GetWeaponID()) : "nullptr"); - auto result = DETOUR_MEMBER_CALL(CTFBot_EquipRequiredWeapon)(); + auto result = DETOUR_MEMBER_CALL(); const char *after = (bot->GetActiveTFWeapon() != nullptr ? WeaponID_ToString(bot->GetActiveTFWeapon()->GetWeaponID()) : "nullptr"); if (strcmp(before, after) != 0) { diff --git a/src/mod/debug/usermsg_overflow.cpp b/src/mod/debug/usermsg_overflow.cpp index 7616c99d..28d350e7 100644 --- a/src/mod/debug/usermsg_overflow.cpp +++ b/src/mod/debug/usermsg_overflow.cpp @@ -36,7 +36,7 @@ namespace Mod::Debug::UserMsg_Overflow DevMsg(" len %d\n", usermsg->m_nLength); } - DETOUR_MEMBER_CALL(CBaseServer_BroadcastMessage1)(msg, onlyActive, reliable); + DETOUR_MEMBER_CALL(msg, onlyActive, reliable); } DETOUR_DECL_MEMBER(void, CBaseServer_BroadcastMessage2, INetMessage& msg, IRecipientFilter& filter) @@ -53,14 +53,14 @@ namespace Mod::Debug::UserMsg_Overflow DevMsg(" m_DataOut.GetNumBitsWritten() = %d\n", usermsg->m_DataOut.GetNumBitsWritten()); } - DETOUR_MEMBER_CALL(CBaseServer_BroadcastMessage2)(msg, filter); + DETOUR_MEMBER_CALL(msg, filter); } DETOUR_DECL_MEMBER(bool, SVC_UserMessage_WriteToBuffer, bf_write& buffer) { int bits_before = buffer.GetNumBitsWritten(); - auto result = DETOUR_MEMBER_CALL(SVC_UserMessage_WriteToBuffer)(buffer); + auto result = DETOUR_MEMBER_CALL(buffer); int bits_after = buffer.GetNumBitsWritten(); auto usermsg = reinterpret_cast(this); @@ -75,7 +75,7 @@ namespace Mod::Debug::UserMsg_Overflow DETOUR_DECL_MEMBER(bool, SVC_UserMessage_ReadFromBuffer, bf_read& buffer) { int bits_before = buffer.GetNumBitsRead() - 6; - auto result = DETOUR_MEMBER_CALL(SVC_UserMessage_ReadFromBuffer)(buffer); + auto result = DETOUR_MEMBER_CALL(buffer); int bits_after = buffer.GetNumBitsRead(); auto usermsg = reinterpret_cast(this); @@ -91,14 +91,14 @@ namespace Mod::Debug::UserMsg_Overflow { DevMsg("UserMessage %s\n",name); //BACKTRACE(); - DETOUR_STATIC_CALL(UserMessageBegin)(filter,name); + DETOUR_STATIC_CALL(filter,name); } DETOUR_DECL_MEMBER(void, CMannVsMachineStats_SendUpgradesToPlayer, CTFPlayer *player, CUtlVector *upgrades) { DevMsg("CMannVsMachineStats::SendUpgradesToPlayer BEGIN\n"); BACKTRACE(); - DETOUR_MEMBER_CALL(CMannVsMachineStats_SendUpgradesToPlayer)(player, upgrades); + DETOUR_MEMBER_CALL(player, upgrades); DevMsg("CMannVsMachineStats::SendUpgradesToPlayer END\n"); } diff --git a/src/mod/debug/usermsg_overflow_v2.cpp b/src/mod/debug/usermsg_overflow_v2.cpp index 25fcdb65..1db2a48b 100644 --- a/src/mod/debug/usermsg_overflow_v2.cpp +++ b/src/mod/debug/usermsg_overflow_v2.cpp @@ -77,7 +77,7 @@ namespace Mod::Debug::UserMsg_Overflow_v2 // bf_write& m_StreamReliable = CNetChan_GetReliableStream(chan); int bits_before = chan->GetNumBitsWritten(true); - auto result = DETOUR_MEMBER_CALL(CNetChan_SendNetMsg)(msg, bForceReliable, bVoice); + auto result = DETOUR_MEMBER_CALL(msg, bForceReliable, bVoice); int bits_after = chan->GetNumBitsWritten(true); int bits_delta = (bits_after - bits_before); @@ -97,7 +97,7 @@ namespace Mod::Debug::UserMsg_Overflow_v2 DETOUR_DECL_MEMBER(float, CTFPlayer_PlayTauntRemapInputScene) { - auto result = DETOUR_MEMBER_CALL(CTFPlayer_PlayTauntRemapInputScene)(); + auto result = DETOUR_MEMBER_CALL(); DevMsg("CTFPlayer::PlayTauntRemapInputScene returns %f\n", result); return result; } @@ -107,7 +107,7 @@ namespace Mod::Debug::UserMsg_Overflow_v2 { DevMsg("[TICK %7d] CBaseFlex::AddSceneEvent [type: %s] [name: %s]\n", gpGlobals->tickcount, CChoreoEvent::NameForType(event->GetType()), event->GetName()); - DETOUR_MEMBER_CALL(CBaseFlex_AddSceneEvent)(scene, event, pTarget); + DETOUR_MEMBER_CALL(scene, event, pTarget); } diff --git a/src/mod/debug/vaccinator.cpp b/src/mod/debug/vaccinator.cpp index 66248d6f..f2b9545c 100644 --- a/src/mod/debug/vaccinator.cpp +++ b/src/mod/debug/vaccinator.cpp @@ -8,7 +8,7 @@ namespace Mod::Debug::Vaccinator DETOUR_DECL_STATIC_CALL_CONVENTION(__gcc_regcall, bool, CheckMedicResist, ETFCond iCondUber, ETFCond iCondPassive, CTFPlayer *pPlayer, float& f1, bool bCrit, float& f2) { // TODO - return DETOUR_STATIC_CALL(CheckMedicResist)(iCondUber, iCondPassive, pPlayer, f1, bCrit, f2); + return DETOUR_STATIC_CALL(iCondUber, iCondPassive, pPlayer, f1, bCrit, f2); } diff --git a/src/mod/debug/vprof_record.cpp b/src/mod/debug/vprof_record.cpp index 08d756df..ab1cb0b0 100644 --- a/src/mod/debug/vprof_record.cpp +++ b/src/mod/debug/vprof_record.cpp @@ -21,13 +21,13 @@ namespace Mod::Debug::VProf_Record DETOUR_DECL_MEMBER(void, CVProfRecorder_Record_WriteTimings_R, CVProfNode *pIn) { CVProfRecorder::DumpNode("record ", pIn); - DETOUR_MEMBER_CALL(CVProfRecorder_Record_WriteTimings_R)(pIn); + DETOUR_MEMBER_CALL(pIn); } DETOUR_DECL_MEMBER(void, CVProfNode_MarkFrame) { CVProfRecorder::DumpNode("mark PRE ", reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CVProfNode_MarkFrame)(); + DETOUR_MEMBER_CALL(); CVProfRecorder::DumpNode("mark POST", reinterpret_cast(this)); } @@ -38,8 +38,8 @@ namespace Mod::Debug::VProf_Record } DETOUR_DECL_STATIC(void, VProfRecord_StartOrStop) { - DETOUR_STATIC_CALL(VProfRecord_StartOrStop)(); - DETOUR_STATIC_CALL(VProfRecord_Snapshot)(); + DETOUR_STATIC_CALL(); + DETOUR_STATIC_CALL(); } diff --git a/src/mod/demo/stringtable_limit.cpp b/src/mod/demo/stringtable_limit.cpp index 3a2d4b9e..7007c0df 100644 --- a/src/mod/demo/stringtable_limit.cpp +++ b/src/mod/demo/stringtable_limit.cpp @@ -29,35 +29,35 @@ namespace Mod::Demo::StringTable_Limit DETOUR_DECL_MEMBER(netpacket_t *, CDemoPlayer_ReadPacket) { SCOPED_INCREMENT(rc_CDemoPlayer_ReadPacket); - return DETOUR_MEMBER_CALL(CDemoPlayer_ReadPacket)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_CHLTVServer_ReadCompeleteDemoFile; DETOUR_DECL_MEMBER(void, CHLTVServer_ReadCompeleteDemoFile) { SCOPED_INCREMENT(rc_CHLTVServer_ReadCompeleteDemoFile); - DETOUR_MEMBER_CALL(CHLTVServer_ReadCompeleteDemoFile)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CDemoRecorder_RecordStringTables; DETOUR_DECL_MEMBER(void, CDemoRecorder_RecordStringTables) { SCOPED_INCREMENT(rc_CDemoRecorder_RecordStringTables); - DETOUR_MEMBER_CALL(CDemoRecorder_RecordStringTables)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CHLTVDemoRecorder_RecordStringTables; DETOUR_DECL_MEMBER(void, CHLTVDemoRecorder_RecordStringTables) { SCOPED_INCREMENT(rc_CHLTVDemoRecorder_RecordStringTables); - DETOUR_MEMBER_CALL(CHLTVDemoRecorder_RecordStringTables)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CReplayDemoRecorder_RecordStringTables; DETOUR_DECL_MEMBER(void, CReplayDemoRecorder_RecordStringTables) { SCOPED_INCREMENT(rc_CReplayDemoRecorder_RecordStringTables); - DETOUR_MEMBER_CALL(CReplayDemoRecorder_RecordStringTables)(); + DETOUR_MEMBER_CALL(); } @@ -79,7 +79,7 @@ namespace Mod::Demo::StringTable_Limit } } - return DETOUR_MEMBER_CALL(CStdMemAlloc_Alloc)(nSize); + return DETOUR_MEMBER_CALL(nSize); } DETOUR_DECL_MEMBER(void, CUtlBuffer_EnsureCapacity, int num) @@ -91,7 +91,7 @@ namespace Mod::Demo::StringTable_Limit } } - DETOUR_MEMBER_CALL(CUtlBuffer_EnsureCapacity)(num); + DETOUR_MEMBER_CALL(num); } DETOUR_DECL_MEMBER(void, bf_read_ctor, const char *pDebugName, const void *pData, int nBytes, int nBits) @@ -106,7 +106,7 @@ namespace Mod::Demo::StringTable_Limit } } - DETOUR_MEMBER_CALL(bf_read_ctor)(pDebugName, pData, nBytes, nBits); + DETOUR_MEMBER_CALL(pDebugName, pData, nBytes, nBits); } DETOUR_DECL_MEMBER(void, bf_write_ctor, void *pData, int nBytes, int nMaxBits) @@ -124,7 +124,7 @@ namespace Mod::Demo::StringTable_Limit } } - DETOUR_MEMBER_CALL(bf_write_ctor)(pData, nBytes, nMaxBits); + DETOUR_MEMBER_CALL(pData, nBytes, nMaxBits); } diff --git a/src/mod/etc/allow_civilian_class.cpp b/src/mod/etc/allow_civilian_class.cpp index 6752f470..0869e85e 100644 --- a/src/mod/etc/allow_civilian_class.cpp +++ b/src/mod/etc/allow_civilian_class.cpp @@ -49,7 +49,7 @@ namespace Mod::Etc::Allow_Civilian_Class } bool prevClassCivilian = player->m_Shared->m_iDesiredPlayerClass == TF_CLASS_CIVILIAN || player->GetPlayerClass()->GetClassIndex() == TF_CLASS_CIVILIAN; - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinClass)(pClassName, b1); + DETOUR_MEMBER_CALL(pClassName, b1); if (player->m_Shared->m_iDesiredPlayerClass == TF_CLASS_CIVILIAN) { auto mod = player->GetOrCreateEntityModule("fakeprop"); @@ -65,7 +65,7 @@ namespace Mod::Etc::Allow_Civilian_Class DETOUR_DECL_MEMBER(CEconItemView *, CTFPlayerInventory_GetItemInLoadout, int pclass, int slot) { - auto result = DETOUR_MEMBER_CALL(CTFPlayerInventory_GetItemInLoadout)(pclass, slot); + auto result = DETOUR_MEMBER_CALL(pclass, slot); if (pclass == TF_CLASS_CIVILIAN && result == nullptr) { return TFInventoryManager()->GetBaseItemForClass(TF_CLASS_CIVILIAN, 999); } @@ -89,7 +89,7 @@ namespace Mod::Etc::Allow_Civilian_Class } } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } class CMod : public IMod diff --git a/src/mod/etc/crash_fixes.cpp b/src/mod/etc/crash_fixes.cpp index 3d0ee2cb..9b101414 100644 --- a/src/mod/etc/crash_fixes.cpp +++ b/src/mod/etc/crash_fixes.cpp @@ -20,7 +20,7 @@ namespace Mod::Etc::Crash_Fixes DETOUR_DECL_MEMBER(CBaseEntity *, CTFPipebombLauncher_FireProjectile, CTFPlayer *player) { - auto proj = DETOUR_MEMBER_CALL(CTFPipebombLauncher_FireProjectile)(player); + auto proj = DETOUR_MEMBER_CALL(player); auto weapon = reinterpret_cast(this); if (rtti_cast(proj) == nullptr) { weapon->m_Pipebombs->RemoveAll(); @@ -33,7 +33,7 @@ namespace Mod::Etc::Crash_Fixes { auto entity = reinterpret_cast(this); CBaseEntity::PrecacheModel(STRING(entity->GetModelName())); - DETOUR_MEMBER_CALL(CFuncIllusionary_Spawn)(); + DETOUR_MEMBER_CALL(); } StaticFuncThunk ft_GetCurrentSkyCamera("GetCurrentSkyCamera"); @@ -43,7 +43,7 @@ namespace Mod::Etc::Crash_Fixes pl->m_Local->m_skybox3darea = 255; return; } - DETOUR_STATIC_CALL(ClientData_Update)(pl); + DETOUR_STATIC_CALL(pl); } class CMod : public IMod diff --git a/src/mod/etc/debug_mission_change_crash.cpp b/src/mod/etc/debug_mission_change_crash.cpp index b4713151..8404ebd8 100644 --- a/src/mod/etc/debug_mission_change_crash.cpp +++ b/src/mod/etc/debug_mission_change_crash.cpp @@ -48,7 +48,7 @@ namespace Mod::Etc::Debug_Mission_Change_Crash Msg("[CBaseEntity::SetNextThink(index)] ENTER: vtptr == nullptr (ent @ 0x%08x, ent #%d, ctx %d, next @ %.3f, reltime %.3f)\n", (uintptr_t)ent, GetEntityIndexOfPtr(ent), nContextIndex, thinkTime, thinkTime - gpGlobals->curtime); } - DETOUR_MEMBER_CALL(CBaseEntity_SetNextThink_index)(nContextIndex, thinkTime); + DETOUR_MEMBER_CALL(nContextIndex, thinkTime); if (ent == nullptr || *reinterpret_cast(ent) == nullptr) { BACKTRACE(); @@ -71,7 +71,7 @@ namespace Mod::Etc::Debug_Mission_Change_Crash BACKTRACE(); } - DETOUR_MEMBER_CALL(CBaseEntity_SetNextThink_name)(nextThinkTime, szContext); + DETOUR_MEMBER_CALL(nextThinkTime, szContext); if (ent == nullptr || *reinterpret_cast(ent) == nullptr) { BACKTRACE(); diff --git a/src/mod/etc/deflect_rocket_spew.cpp b/src/mod/etc/deflect_rocket_spew.cpp index 60fb6968..a70979ff 100644 --- a/src/mod/etc/deflect_rocket_spew.cpp +++ b/src/mod/etc/deflect_rocket_spew.cpp @@ -35,7 +35,7 @@ namespace Mod::Etc::Deflect_Rocket_Spew bDud = false; } - DETOUR_MEMBER_CALL(CTFBaseRocket_Destroy)(bGlow, bDud); + DETOUR_MEMBER_CALL(bGlow, bDud); } diff --git a/src/mod/etc/entity_limit_manager.cpp b/src/mod/etc/entity_limit_manager.cpp index bc449bef..df54dfa5 100644 --- a/src/mod/etc/entity_limit_manager.cpp +++ b/src/mod/etc/entity_limit_manager.cpp @@ -36,7 +36,7 @@ namespace Mod::Etc::Entity_Limit_Manager { CTFPlayer *player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Spawn)(); + DETOUR_MEMBER_CALL(); // Remove unused offhand viewmodel for other classes than spy if (sig_etc_entity_limit_manager_viewmodel.GetBool() && !player->IsPlayerClass(TF_CLASS_SPY) && player->GetViewModel(1) != nullptr) { player->GetViewModel(1)->Remove(); @@ -46,7 +46,7 @@ namespace Mod::Etc::Entity_Limit_Manager DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_Equip, CBaseCombatCharacter *owner) { auto ent = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseCombatWeapon_Equip)(owner); + DETOUR_MEMBER_CALL(owner); // Restore unused offhand viewmodel for other classes than spy auto playerOwner = ToTFPlayer(owner); @@ -65,7 +65,7 @@ namespace Mod::Etc::Entity_Limit_Manager player->CreateViewModel(1); } } - DETOUR_MEMBER_CALL(CBaseCombatWeapon_SetViewModelIndex)(index); + DETOUR_MEMBER_CALL(index); } RefCount rc_CTFPlayer_UpdateExpression; @@ -73,7 +73,7 @@ namespace Mod::Etc::Entity_Limit_Manager { auto player = reinterpret_cast(this); SCOPED_INCREMENT_IF(rc_CTFPlayer_UpdateExpression, sig_etc_entity_limit_manager_remove_expressions.GetBool() && player->IsBot()); - DETOUR_MEMBER_CALL(CTFPlayer_UpdateExpression)(); + DETOUR_MEMBER_CALL(); } CTFPlayer *disguise_weapon_player = nullptr; @@ -82,7 +82,7 @@ namespace Mod::Etc::Entity_Limit_Manager auto shared = reinterpret_cast(this); disguise_weapon_player = shared->GetOuter(); EHANDLE prevDisguiseWeapon = shared->m_hDisguiseWeapon.Get(); - DETOUR_MEMBER_CALL(CTFPlayerShared_DetermineDisguiseWeapon)(forcePrimary); + DETOUR_MEMBER_CALL(forcePrimary); if (prevDisguiseWeapon != shared->m_hDisguiseWeapon && prevDisguiseWeapon != nullptr) { prevDisguiseWeapon->Remove(); } @@ -93,14 +93,14 @@ namespace Mod::Etc::Entity_Limit_Manager DETOUR_DECL_MEMBER(void, CTFPlayerShared_DetermineDisguiseWearables) { disguise_wearables_player = reinterpret_cast(this)->GetOuter(); - DETOUR_MEMBER_CALL(CTFPlayerShared_DetermineDisguiseWearables)(); + DETOUR_MEMBER_CALL(); disguise_wearables_player = nullptr; } DETOUR_DECL_MEMBER(void, CTFPlayer_CreateDisguiseWeaponList, CTFPlayer *target) { disguise_weapon_player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_CreateDisguiseWeaponList)(target); + DETOUR_MEMBER_CALL(target); disguise_weapon_player = nullptr; } @@ -120,7 +120,7 @@ namespace Mod::Etc::Entity_Limit_Manager if (rc_CTFPlayer_UpdateExpression) return 10; //auto oldSceneEnt = *phSceneEnt; - auto ret = DETOUR_STATIC_CALL(InstancedScriptedScene)(pActor, pszScene, phSceneEnt, flPostDelay, bIsBackground, response, bMultiplayer, filter); + auto ret = DETOUR_STATIC_CALL(pActor, pszScene, phSceneEnt, flPostDelay, bIsBackground, response, bMultiplayer, filter); //if (remove_this_scene_entity != nullptr) { // remove_this_scene_entity->Remove(); // *phSceneEnt = oldSceneEnt; @@ -373,7 +373,7 @@ namespace Mod::Etc::Entity_Limit_Manager edict->freetime = 0; } } - return DETOUR_STATIC_CALL(CreateEntityByName)(className, iForceEdictIndex); + return DETOUR_STATIC_CALL(className, iForceEdictIndex); } DETOUR_DECL_STATIC(void , Physics_SimulateEntity, CBaseEntity * entity) @@ -383,7 +383,7 @@ namespace Mod::Etc::Entity_Limit_Manager return; } simulated_entity = entity; - DETOUR_STATIC_CALL(Physics_SimulateEntity)(entity); + DETOUR_STATIC_CALL(entity); simulated_entity = nullptr; } @@ -432,7 +432,7 @@ namespace Mod::Etc::Entity_Limit_Manager DETOUR_DECL_MEMBER(IServerNetworkable *, CEntityFactory_CPathTrack_Create, const char *classname) { SCOPED_INCREMENT_IF(rc_ServerOnly, cvar_path_track_is_server_entity.GetBool()); - return DETOUR_MEMBER_CALL(CEntityFactory_CPathTrack_Create)(classname); + return DETOUR_MEMBER_CALL(classname); } @@ -473,7 +473,7 @@ namespace Mod::Etc::Entity_Limit_Manager placeholder->SetAbsAngles(parent->GetAbsAngles()); parent = placeholder; } - DETOUR_MEMBER_CALL(CBaseEntity_SetParent)(parent, iAttachment); + DETOUR_MEMBER_CALL(parent, iAttachment); } DETOUR_DECL_MEMBER(void, CBaseAnimating_SetLightingOrigin, CBaseEntity *entity) @@ -491,12 +491,12 @@ namespace Mod::Etc::Entity_Limit_Manager THINK_FUNC_SET(placeholder, PlaceholderThink, gpGlobals->curtime+0.01f); entity = placeholder; } - DETOUR_MEMBER_CALL(CBaseAnimating_SetLightingOrigin)(entity); + DETOUR_MEMBER_CALL(entity); } DETOUR_DECL_MEMBER(void, CBaseEntity_CBaseEntity, bool serverOnly) { - DETOUR_MEMBER_CALL(CBaseEntity_CBaseEntity)(rc_ServerOnly || serverOnly); + DETOUR_MEMBER_CALL(rc_ServerOnly || serverOnly); if (rc_ServerOnly) { auto entity = reinterpret_cast(this); entity->AddEFlags(65536); //EFL_FORCE_ALLOW_MOVEPARENT @@ -514,7 +514,7 @@ namespace Mod::Etc::Entity_Limit_Manager DETOUR_DECL_MEMBER(IServerNetworkable *, name, const char *classname) \ {\ SCOPED_INCREMENT(rc_ServerOnly);\ - return DETOUR_MEMBER_CALL(name)(classname);\ + return DETOUR_MEMBER_CALL(classname);\ }\ MAKE_ENTITY_SERVERSIDE(CEntityFactory_CTFBotHintSentrygun_Create); diff --git a/src/mod/etc/extra_player_slots.cpp b/src/mod/etc/extra_player_slots.cpp index 9ca6ab0e..4b11fdcf 100644 --- a/src/mod/etc/extra_player_slots.cpp +++ b/src/mod/etc/extra_player_slots.cpp @@ -165,7 +165,7 @@ namespace Mod::Etc::Extra_Player_Slots //ForEachEntity([](CBaseEntity *ent){ // Msg("Entity %d %s\n", ent->entindex(), ent->GetClassname()); // }); - return DETOUR_MEMBER_CALL(CBaseServer_CreateFakeClient)(name); + return DETOUR_MEMBER_CALL(name); } inline int GetHLTVSlot() @@ -186,7 +186,7 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_MEMBER(CBaseClient *, CBaseServer_GetFreeClient, netadr_t &adr) { auto server = reinterpret_cast(this); - if (server == hltv || ((!ExtraSlotsEnabled() || gpGlobals->maxClients < DEFAULT_MAX_PLAYERS + 1) && force_create_at_slot == -1)) return DETOUR_MEMBER_CALL(CBaseServer_GetFreeClient)(adr); + if (server == hltv || ((!ExtraSlotsEnabled() || gpGlobals->maxClients < DEFAULT_MAX_PLAYERS + 1) && force_create_at_slot == -1)) return DETOUR_MEMBER_CALL(adr); if (DebugForcePlayersUseExtraSlots() || rc_CBaseServer_CreateFakeClient || force_create_at_slot != -1) { static ConVarRef tv_enable("tv_enable"); @@ -205,7 +205,7 @@ namespace Mod::Etc::Extra_Player_Slots // Create clients to fill all slots while (server->GetClientCount() != server->GetMaxClients()) { - CBaseClient *lastClient = DETOUR_MEMBER_CALL(CBaseServer_GetFreeClient)(adr); + CBaseClient *lastClient = DETOUR_MEMBER_CALL(adr); if (lastClient != nullptr) { clientList.push_back(lastClient); lastClient->m_bFakePlayer = true; @@ -253,7 +253,7 @@ namespace Mod::Etc::Extra_Player_Slots return nullptr; } - auto client = DETOUR_MEMBER_CALL(CBaseServer_GetFreeClient)(adr); + auto client = DETOUR_MEMBER_CALL(adr); if (client != nullptr) { if ( !((sig_etc_extra_player_slots_allow_bots.GetBool() && rc_CBaseServer_CreateFakeClient) || (sig_etc_extra_player_slots_allow_players.GetBool() && !rc_CBaseServer_CreateFakeClient)) && !rc_CBaseServer_CreateFakeClient_HLTV && client->GetPlayerSlot() > DEFAULT_MAX_PLAYERS - 1) { return nullptr; @@ -271,7 +271,7 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_MEMBER(void, CServerGameClients_GetPlayerLimits, int &minplayers, int &maxplayers, int &defaultplayers) { - DETOUR_MEMBER_CALL(CServerGameClients_GetPlayerLimits)(minplayers,maxplayers,defaultplayers); + DETOUR_MEMBER_CALL(minplayers,maxplayers,defaultplayers); if (ExtraSlotsEnabled()) maxplayers = sig_etc_extra_player_slots_count.GetInt(); } @@ -291,13 +291,12 @@ namespace Mod::Etc::Extra_Player_Slots for (int i = 1; i < (preMaxPlayers + DEFAULT_MAX_PLAYERS - 1) / DEFAULT_MAX_PLAYERS; i++) { int slotsCopy = Min(preMaxPlayers - i * DEFAULT_MAX_PLAYERS, DEFAULT_MAX_PLAYERS); memcpy(world_edict+1, world_edict+1 + DEFAULT_MAX_PLAYERS * i, sizeof(edict_t) * slotsCopy); - gpGlobals->maxClients = slotsCopy; - (reinterpret_cast(lag_compensation_copies[i - 1])->*Actual)(); + (Detour_CLagCompensationManager_FrameUpdatePostEntityThink::Actual)(reinterpret_cast(lag_compensation_copies[i - 1])); } memcpy(world_edict+1, originalEdicts, sizeof(edict_t) * DEFAULT_MAX_PLAYERS); gpGlobals->maxClients = DEFAULT_MAX_PLAYERS; } - DETOUR_MEMBER_CALL(CLagCompensationManager_FrameUpdatePostEntityThink)(); + DETOUR_MEMBER_CALL(); gpGlobals->maxClients = preMaxPlayers; } @@ -308,9 +307,9 @@ namespace Mod::Etc::Extra_Player_Slots if (preMaxPlayers > DEFAULT_MAX_PLAYERS) { if (!player->IsRealPlayer() || player->GetObserverMode() != OBS_MODE_NONE) { for (int i = 1; i < (gpGlobals->maxClients + DEFAULT_MAX_PLAYERS - 1) / DEFAULT_MAX_PLAYERS; i++) { - (reinterpret_cast(lag_compensation_copies[i - 1])->*Actual)(player, cmd); + (Detour_CLagCompensationManager_StartLagCompensation::Actual)(reinterpret_cast(lag_compensation_copies[i - 1]),player, cmd); } - DETOUR_MEMBER_CALL(CLagCompensationManager_StartLagCompensation)(player, cmd); + DETOUR_MEMBER_CALL(player, cmd); return; } edict_t originalEdicts[DEFAULT_MAX_PLAYERS]; @@ -324,20 +323,20 @@ namespace Mod::Etc::Extra_Player_Slots } gpGlobals->maxClients = slotsCopy; player_move_entindex = -i * DEFAULT_MAX_PLAYERS; - (reinterpret_cast(lag_compensation_copies[i - 1])->*Actual)(player, cmd); + (Detour_CLagCompensationManager_StartLagCompensation::Actual)(reinterpret_cast(lag_compensation_copies[i - 1]),player, cmd); } player_move_entindex = 0; memcpy(world_edict+1, originalEdicts, sizeof(edict_t) * DEFAULT_MAX_PLAYERS); gpGlobals->maxClients = DEFAULT_MAX_PLAYERS; } - DETOUR_MEMBER_CALL(CLagCompensationManager_StartLagCompensation)(player, cmd); + DETOUR_MEMBER_CALL(player, cmd); gpGlobals->maxClients = preMaxPlayers; } DETOUR_DECL_MEMBER(void, CLagCompensationManager_BacktrackPlayer, CBasePlayer *player, float flTargetTime) { player->NetworkProp()->GetProp()->m_EdictIndex+=player_move_entindex; - DETOUR_MEMBER_CALL(CLagCompensationManager_BacktrackPlayer)(player, flTargetTime); + DETOUR_MEMBER_CALL(player, flTargetTime); player->NetworkProp()->GetProp()->m_EdictIndex-=player_move_entindex; } @@ -353,19 +352,19 @@ namespace Mod::Etc::Extra_Player_Slots int slotsCopy = Min(preMaxPlayers - i * DEFAULT_MAX_PLAYERS, DEFAULT_MAX_PLAYERS); memcpy(world_edict+1, world_edict+1 + DEFAULT_MAX_PLAYERS * i, sizeof(edict_t) * slotsCopy); gpGlobals->maxClients = slotsCopy; - (reinterpret_cast(lag_compensation_copies[i - 1])->*Actual)(player); + (Detour_CLagCompensationManager_FinishLagCompensation::Actual)(reinterpret_cast(lag_compensation_copies[i - 1]), player); } memcpy(world_edict+1, originalEdicts, sizeof(edict_t) * DEFAULT_MAX_PLAYERS); gpGlobals->maxClients = DEFAULT_MAX_PLAYERS; } - DETOUR_MEMBER_CALL(CLagCompensationManager_FinishLagCompensation)(player); + DETOUR_MEMBER_CALL(player); gpGlobals->maxClients = preMaxPlayers; } int playerListOffset = 0; DETOUR_DECL_STATIC(void, SendProxy_PlayerList, const void *pProp, const void *pStruct, const void *pData, void *pOut, int iElement, int objectID) { - if (!ExtraSlotsEnabled()) return DETOUR_STATIC_CALL(SendProxy_PlayerList)(pProp, pStruct, pData, pOut, iElement, objectID); + if (!ExtraSlotsEnabled()) return DETOUR_STATIC_CALL(pProp, pStruct, pData, pOut, iElement, objectID); if (iElement == 0) { playerListOffset = 0; } @@ -375,11 +374,11 @@ namespace Mod::Etc::Extra_Player_Slots playerListOffset += 1; } //Msg("Element %d offset %d\n", iElement, playerListOffset); - return DETOUR_STATIC_CALL(SendProxy_PlayerList)(pProp, pStruct, pData, pOut, iElement + playerListOffset, objectID); + return DETOUR_STATIC_CALL(pProp, pStruct, pData, pOut, iElement + playerListOffset, objectID); } DETOUR_DECL_STATIC(int, SendProxyArrayLength_PlayerArray, const void *pStruct, int objectID) { - int count = DETOUR_STATIC_CALL(SendProxyArrayLength_PlayerArray)(pStruct, objectID); + int count = DETOUR_STATIC_CALL(pStruct, objectID); int countpre = count; if (ExtraSlotsEnabled()) { auto team = (CTeam *)(pStruct); @@ -411,7 +410,7 @@ namespace Mod::Etc::Extra_Player_Slots team->NetworkStateChanged(); return; } - DETOUR_MEMBER_CALL(CTeam_AddPlayer)(player); + DETOUR_MEMBER_CALL(player); // team->m_aPlayers->Sort([](CBasePlayer * const *l, CBasePlayer * const *r){ // return ENTINDEX(*l) - ENTINDEX(*r); @@ -427,7 +426,7 @@ namespace Mod::Etc::Extra_Player_Slots // team->m_hLeader = nullptr; // return; //} - DETOUR_MEMBER_CALL(CTFTeam_SetTeamLeader)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CTeam_RemovePlayer, CBasePlayer *player) @@ -437,13 +436,13 @@ namespace Mod::Etc::Extra_Player_Slots //if (team->m_hLeader == player) { // team->m_hLeader = nullptr; //} - DETOUR_MEMBER_CALL(CTeam_RemovePlayer)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CTFPlayer_UpdateOnRemove) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); //Msg("Delete player %d %d\n", player->GetTeamNumber(), player); } @@ -456,7 +455,7 @@ namespace Mod::Etc::Extra_Player_Slots movement->player->edict()->m_EdictIndex = DEFAULT_MAX_PLAYERS - 1; //return enginetrace->GetPointContents(point); } - auto ret = DETOUR_MEMBER_CALL(CGameMovement_GetPointContentsCached)(point, slot); + auto ret = DETOUR_MEMBER_CALL(point, slot); if (oldIndex != -1) { movement->player->edict()->m_EdictIndex = oldIndex; } @@ -471,29 +470,29 @@ namespace Mod::Etc::Extra_Player_Slots oldIndex = ENTINDEX(movement->player); movement->player->edict()->m_EdictIndex = 0; } - auto ret = DETOUR_MEMBER_CALL(CGameMovement_CheckStuck)(); + auto ret = DETOUR_MEMBER_CALL(); if (oldIndex != -1) { movement->player->edict()->m_EdictIndex = oldIndex; } return ret; } - DETOUR_DECL_MEMBER(void, CTFGameStats_ResetPlayerStats, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_ResetPlayerStats)(player);} - DETOUR_DECL_MEMBER(void, CTFGameStats_ResetKillHistory, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_ResetKillHistory)(player);} - DETOUR_DECL_MEMBER(void, CTFGameStats_IncrementStat, CTFPlayer* player, int statType, int value) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_IncrementStat)(player, statType, value);} - DETOUR_DECL_MEMBER(void, CTFGameStats_SendStatsToPlayer, CTFPlayer* player, bool isAlive) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_SendStatsToPlayer)(player, isAlive);} - DETOUR_DECL_MEMBER(void, CTFGameStats_AccumulateAndResetPerLifeStats, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_AccumulateAndResetPerLifeStats)(player);} - DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerConnected, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_Event_PlayerConnected)(player);} - DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerDisconnectedTF, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_Event_PlayerDisconnectedTF)(player);} - DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerLeachedHealth, CTFPlayer* player, bool dispenser, float amount) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_Event_PlayerLeachedHealth)(player, dispenser, amount);} - DETOUR_DECL_MEMBER(void, CTFGameStats_TrackKillStats, CTFPlayer* attacker, CTFPlayer* victim) { if (ENTINDEX(attacker) > DEFAULT_MAX_PLAYERS || ENTINDEX(victim) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_TrackKillStats)(attacker, victim);} - DETOUR_DECL_MEMBER(void *, CTFGameStats_FindPlayerStats, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return nullptr; return DETOUR_MEMBER_CALL(CTFGameStats_FindPlayerStats)(player);} - DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerEarnedKillStreak, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFGameStats_Event_PlayerEarnedKillStreak)(player);} - - DETOUR_DECL_MEMBER(bool, CTFPlayerShared_IsPlayerDominated, int index) { if (index > DEFAULT_MAX_PLAYERS) return false; return DETOUR_MEMBER_CALL(CTFPlayerShared_IsPlayerDominated)(index);} - DETOUR_DECL_MEMBER(bool, CTFPlayerShared_IsPlayerDominatingMe, int index) { if (index > DEFAULT_MAX_PLAYERS) return false; return DETOUR_MEMBER_CALL(CTFPlayerShared_IsPlayerDominatingMe)(index);} - DETOUR_DECL_MEMBER(void, CTFPlayerShared_SetPlayerDominated, CTFPlayer * player, bool dominated) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFPlayerShared_SetPlayerDominated)(player, dominated);} - DETOUR_DECL_MEMBER(void, CTFPlayerShared_SetPlayerDominatingMe, CTFPlayer * player, bool dominated) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(CTFPlayerShared_SetPlayerDominatingMe)(player, dominated);} + DETOUR_DECL_MEMBER(void, CTFGameStats_ResetPlayerStats, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player);} + DETOUR_DECL_MEMBER(void, CTFGameStats_ResetKillHistory, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player);} + DETOUR_DECL_MEMBER(void, CTFGameStats_IncrementStat, CTFPlayer* player, int statType, int value) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player, statType, value);} + DETOUR_DECL_MEMBER(void, CTFGameStats_SendStatsToPlayer, CTFPlayer* player, bool isAlive) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player, isAlive);} + DETOUR_DECL_MEMBER(void, CTFGameStats_AccumulateAndResetPerLifeStats, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player);} + DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerConnected, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player);} + DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerDisconnectedTF, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player);} + DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerLeachedHealth, CTFPlayer* player, bool dispenser, float amount) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player, dispenser, amount);} + DETOUR_DECL_MEMBER(void, CTFGameStats_TrackKillStats, CTFPlayer* attacker, CTFPlayer* victim) { if (ENTINDEX(attacker) > DEFAULT_MAX_PLAYERS || ENTINDEX(victim) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(attacker, victim);} + DETOUR_DECL_MEMBER(void *, CTFGameStats_FindPlayerStats, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return nullptr; return DETOUR_MEMBER_CALL(player);} + DETOUR_DECL_MEMBER(void, CTFGameStats_Event_PlayerEarnedKillStreak, CTFPlayer* player) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player);} + + DETOUR_DECL_MEMBER(bool, CTFPlayerShared_IsPlayerDominated, int index) { if (index > DEFAULT_MAX_PLAYERS) return false; return DETOUR_MEMBER_CALL(index);} + DETOUR_DECL_MEMBER(bool, CTFPlayerShared_IsPlayerDominatingMe, int index) { if (index > DEFAULT_MAX_PLAYERS) return false; return DETOUR_MEMBER_CALL(index);} + DETOUR_DECL_MEMBER(void, CTFPlayerShared_SetPlayerDominated, CTFPlayer * player, bool dominated) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player, dominated);} + DETOUR_DECL_MEMBER(void, CTFPlayerShared_SetPlayerDominatingMe, CTFPlayer * player, bool dominated) { if (ENTINDEX(player) > DEFAULT_MAX_PLAYERS) return; DETOUR_MEMBER_CALL(player, dominated);} DETOUR_DECL_MEMBER(void, CTFPlayerResource_SetPlayerClassWhenKilled, int iIndex, int iClass ) @@ -501,14 +500,14 @@ namespace Mod::Etc::Extra_Player_Slots if (iIndex > DEFAULT_MAX_PLAYERS) { return; } - DETOUR_MEMBER_CALL(CTFPlayerResource_SetPlayerClassWhenKilled)(iIndex, iClass); + DETOUR_MEMBER_CALL(iIndex, iClass); } DETOUR_DECL_MEMBER(void, CBasePlayer_UpdatePlayerSound) { auto player = reinterpret_cast(this); if (player->entindex() > 96) return; - DETOUR_MEMBER_CALL(CBasePlayer_UpdatePlayerSound)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CSoundEnt_Initialize) @@ -517,7 +516,7 @@ namespace Mod::Etc::Extra_Player_Slots if (gpGlobals->maxClients > 96) { gpGlobals->maxClients = 96; } - DETOUR_MEMBER_CALL(CSoundEnt_Initialize)(); + DETOUR_MEMBER_CALL(); gpGlobals->maxClients = oldMaxClients; } @@ -527,7 +526,7 @@ namespace Mod::Etc::Extra_Player_Slots { if (ENTINDEX(edict) > DEFAULT_MAX_PLAYERS) return; - DETOUR_MEMBER_CALL(CVoiceGameMgr_ClientConnected)(edict); + DETOUR_MEMBER_CALL(edict); g_SentGameRulesMasks.GetRef()[ENTINDEX(edict) - 1].SetAll(); } @@ -537,7 +536,7 @@ namespace Mod::Etc::Extra_Player_Slots if (gpGlobals->maxClients > DEFAULT_MAX_PLAYERS) { gpGlobals->maxClients = DEFAULT_MAX_PLAYERS; } - DETOUR_MEMBER_CALL(CHLTVDirector_BuildActivePlayerList)(); + DETOUR_MEMBER_CALL(); gpGlobals->maxClients = oldMaxClients; } @@ -547,7 +546,7 @@ namespace Mod::Etc::Extra_Player_Slots CTFPlayer *player = reinterpret_cast(this); char oldReady = ready[player->entindex()]; Msg("pre ready %d \n", ready[player->entindex()]); - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinTeam)(team); + DETOUR_MEMBER_CALL(team); if (player->entindex() > DEFAULT_MAX_PLAYERS) { Msg("post ready %d\n", ready[player->entindex()]); ready[player->entindex()] = oldReady; @@ -558,7 +557,7 @@ namespace Mod::Etc::Extra_Player_Slots { if (ENTINDEX(pTFPlayer) > DEFAULT_MAX_PLAYERS ) return; - DETOUR_MEMBER_CALL(CTFGameRules_PlayerReadyStatus_UpdatePlayerState)(pTFPlayer, bState); + DETOUR_MEMBER_CALL(pTFPlayer, bState); } DETOUR_DECL_MEMBER(void, CTFGCServerSystem_ClientDisconnected, CSteamID steamid) @@ -569,7 +568,7 @@ namespace Mod::Etc::Extra_Player_Slots if (index > DEFAULT_MAX_PLAYERS) { oldstate = state[index]; } - DETOUR_MEMBER_CALL(CTFGCServerSystem_ClientDisconnected)(steamid); + DETOUR_MEMBER_CALL(steamid); if (oldstate != -1) { state[index] = oldstate; } @@ -581,7 +580,7 @@ namespace Mod::Etc::Extra_Player_Slots { SCOPED_INCREMENT(rc_CTFGameRules_ClientDisconnected); disconnected_player_edict = edict; - DETOUR_MEMBER_CALL(CTFGameRules_ClientDisconnected)(edict); + DETOUR_MEMBER_CALL(edict); disconnected_player_edict = nullptr; } @@ -590,12 +589,12 @@ namespace Mod::Etc::Extra_Player_Slots if (rc_CTFGameRules_ClientDisconnected && disconnected_player_edict != nullptr && iWantedTeam == 0 && pPlayer->entindex() == ENTINDEX(disconnected_player_edict)) { return 0; } - return DETOUR_MEMBER_CALL(CTFGameRules_GetTeamAssignmentOverride)(pPlayer, iWantedTeam, b1); + return DETOUR_MEMBER_CALL(pPlayer, iWantedTeam, b1); } DETOUR_DECL_MEMBER(bool, CTFGameMovement_CheckWater) { - return false;//DETOUR_MEMBER_CALL(CTFGameMovement_CheckWater)(); + return false;//DETOUR_MEMBER_CALL(); } CON_COMMAND(sig_get_entites, "") @@ -631,19 +630,19 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_MEMBER(ConVar *, CCvar_FindVar, const char *name) { Msg("CVar %s\n", name); - return DETOUR_MEMBER_CALL(CCvar_FindVar)(name); + return DETOUR_MEMBER_CALL(name); } DETOUR_DECL_MEMBER(const char *, ConVar_GetName) { - auto ret = DETOUR_MEMBER_CALL(ConVar_GetName)(); + auto ret = DETOUR_MEMBER_CALL(); Msg("CVarn %s\n", ret); return ret; } DETOUR_DECL_MEMBER(const char *, ConCommandBase_GetName) { - auto ret = DETOUR_MEMBER_CALL(ConCommandBase_GetName)(); + auto ret = DETOUR_MEMBER_CALL(); Msg("CCmd %s\n", ret); return ret; @@ -672,7 +671,7 @@ namespace Mod::Etc::Extra_Player_Slots } } - return DETOUR_STATIC_CALL(SV_BroadcastVoiceData)(pClient, nBytes, data, xuid); + return DETOUR_STATIC_CALL(pClient, nBytes, data, xuid); } CValueOverride_ConVar sv_alltalk("sv_alltalk"); @@ -689,7 +688,7 @@ namespace Mod::Etc::Extra_Player_Slots if (sv_alltalk.GetOriginalValue()) { return true; } - return DETOUR_MEMBER_CALL(CVoiceGameMgrHelper_CanPlayerHearPlayer)(pListener, pTalker, bProximity); + return DETOUR_MEMBER_CALL(pListener, pTalker, bProximity); } DETOUR_DECL_MEMBER(void, CVoiceGameMgr_UpdateMasks) @@ -699,7 +698,7 @@ namespace Mod::Etc::Extra_Player_Slots sv_alltalk.Set(false); } - DETOUR_MEMBER_CALL(CVoiceGameMgr_UpdateMasks)(); + DETOUR_MEMBER_CALL(); sv_alltalk.Reset(); // if (restoreAllTalk) { // sv_alltalk.SetValue(true); @@ -716,19 +715,19 @@ namespace Mod::Etc::Extra_Player_Slots } }); } - DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_State_Enter_PREROUND)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFGameRules_PowerupModeKillCountCompare) { Msg("called kill count compare\n"); - DETOUR_MEMBER_CALL(CTFGameRules_PowerupModeKillCountCompare)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFGameRules_PowerupModeInitKillCountTimer) { Msg("called init kill count timer\n"); - DETOUR_MEMBER_CALL(CTFGameRules_PowerupModeInitKillCountTimer)(); + DETOUR_MEMBER_CALL(); } struct KillEvent @@ -795,7 +794,7 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_MEMBER(bool, IGameEventManager2_FireEvent, IGameEvent *event, bool bDontBroadcast) { stopMoreEvents = false; - //return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + //return DETOUR_MEMBER_CALL(event, bDontBroadcast); Msg("stop %s\n", event != nullptr ? event->GetName() : "f"); return false; } @@ -866,7 +865,7 @@ namespace Mod::Etc::Extra_Player_Slots } } auto client = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseClient_FireGameEvent)(event); + DETOUR_MEMBER_CALL(event); } DETOUR_DECL_STATIC(void, SV_ComputeClientPacks, int clientCount, void **clients, void *snapshot) @@ -980,7 +979,7 @@ namespace Mod::Etc::Extra_Player_Slots //if (player33_fake_kill_time + 2 > gpGlobals->curtime) { // realTeam = TFPlayerResource()->m_iTeam[DEFAULT_MAX_PLAYERS]; //} - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); //if (realTeam != -1) { // // TFPlayerResource()->m_iTeam.SetIndex(realTeam, DEFAULT_MAX_PLAYERS); @@ -995,7 +994,7 @@ namespace Mod::Etc::Extra_Player_Slots // players = DEFAULT_MAX_PLAYERS; //} int val = FixSlotCrashPre(); - DETOUR_MEMBER_CALL(CSteam3Server_SendUpdatedServerDetails)(); + DETOUR_MEMBER_CALL(); FixSlotCrashPost(val); //players = oldPlayers; } @@ -1004,7 +1003,7 @@ namespace Mod::Etc::Extra_Player_Slots { if (ENTINDEX(pAttacker) > DEFAULT_MAX_PLAYERS || ENTINDEX(pVictim) > DEFAULT_MAX_PLAYERS) return; - DETOUR_MEMBER_CALL(CTFGameRules_CalcDominationAndRevenge)(pAttacker, pWeapon, pVictim, bIsAssist, piDeathFlags); + DETOUR_MEMBER_CALL(pAttacker, pWeapon, pVictim, bIsAssist, piDeathFlags); } @@ -1016,13 +1015,13 @@ namespace Mod::Etc::Extra_Player_Slots if (team != nullptr && team->GetNumPlayers() >= 16) { return g_aRawPlayerClassNames[(ENTINDEX(bot)/2 % 9) + 1]; } - return DETOUR_MEMBER_CALL(CTFBot_GetNextSpawnClassname)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_Event_Killed, const CTakeDamageInfo& info) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); if (sig_etc_extra_player_slots_no_death_cam.GetBool() && ToTFPlayer(player->m_hObserverTarget) != nullptr && ENTINDEX(player->m_hObserverTarget) > DEFAULT_MAX_PLAYERS) { player->m_hObserverTarget = nullptr; } @@ -1037,7 +1036,7 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_STATIC(bool, Host_Changelevel, bool fromSave, const char *mapname, const char *start) { nextmap = mapname; - return DETOUR_STATIC_CALL(Host_Changelevel)(fromSave, mapname, start); + return DETOUR_STATIC_CALL(fromSave, mapname, start); } @@ -1048,7 +1047,7 @@ namespace Mod::Etc::Extra_Player_Slots catapult->m_flRefireDelay.Get()[0] = gpGlobals->curtime + 0.5f; return; } - DETOUR_MEMBER_CALL(CTriggerCatapult_OnLaunchedVictim)(pVictim); + DETOUR_MEMBER_CALL(pVictim); } #ifdef FAKE_PLAYER_CLASS @@ -1058,14 +1057,14 @@ namespace Mod::Etc::Extra_Player_Slots GlobalThunk g_CBaseAnimating_ClassReg("g_CBaseAnimating_ClassReg"); DETOUR_DECL_MEMBER(void, CServerGameClients_ClientPutInServer, edict_t *edict, const char *playername) { - DETOUR_MEMBER_CALL(CServerGameClients_ClientPutInServer)(edict, playername); + DETOUR_MEMBER_CALL(edict, playername); if (edict->m_EdictIndex > DEFAULT_MAX_PLAYERS) GetContainingEntity(edict)->NetworkProp()->m_pServerClass = &g_CBaseCombatCharacter_ClassReg.GetRef(); } DETOUR_DECL_MEMBER(void, CBaseServer_FillServerInfo, SVC_ServerInfo &serverinfo) { - DETOUR_MEMBER_CALL(CBaseServer_FillServerInfo)(serverinfo); + DETOUR_MEMBER_CALL(serverinfo); serverinfo.m_nMaxClients = DEFAULT_MAX_PLAYERS; } @@ -1080,7 +1079,7 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_Equip, CBaseCombatCharacter *owner) { CBaseCombatWeapon *weapon = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseCombatWeapon_Equip)(owner); + DETOUR_MEMBER_CALL(owner); if (owner != nullptr && owner->IsPlayer() && owner->entindex() > DEFAULT_MAX_PLAYERS) { weapon->NetworkProp()->m_pServerClass = &g_CBaseAnimating_ClassReg.GetRef(); @@ -1092,7 +1091,7 @@ namespace Mod::Etc::Extra_Player_Slots DETOUR_DECL_MEMBER(void, CTFWearable_Equip, CBasePlayer *player) { CTFWearable *wearable = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFWearable_Equip)(player); + DETOUR_MEMBER_CALL(player); if (player != nullptr && player->entindex() > DEFAULT_MAX_PLAYERS) { wearable->NetworkProp()->m_pServerClass = &g_CBaseAnimating_ClassReg.GetRef(); } @@ -1114,14 +1113,14 @@ namespace Mod::Etc::Extra_Player_Slots } return; } - DETOUR_MEMBER_CALL(CTFPlayer_CreateRagdollEntity)(bShouldGib, bBurning, bUberDrop, bOnGround, bYER, bGold, bIce, bAsh, iCustom, bClassic); + DETOUR_MEMBER_CALL(bShouldGib, bBurning, bUberDrop, bOnGround, bYER, bGold, bIce, bAsh, iCustom, bClassic); } DETOUR_DECL_MEMBER(void, CTFPlayer_CreateFeignDeathRagdoll, const CTakeDamageInfo& info, bool b1, bool b2, bool b3) { auto player = reinterpret_cast(this); if (player->entindex() > DEFAULT_MAX_PLAYERS) return; - DETOUR_MEMBER_CALL(CTFPlayer_CreateFeignDeathRagdoll)(info, b1, b2, b3); + DETOUR_MEMBER_CALL(info, b1, b2, b3); } VHOOK_DECL(bool, CWeaponMedigun_Deploy) @@ -1135,7 +1134,7 @@ namespace Mod::Etc::Extra_Player_Slots if (effect == nullptr && attrDef != nullptr) { medigun->GetItem()->GetAttributeList().AddStringAttribute(attrDef, "medicgun_beam"); } - return VHOOK_CALL(CWeaponMedigun_Deploy)(); + return VHOOK_CALL(); } int customDamageTypeBullet = 0; @@ -1158,7 +1157,7 @@ namespace Mod::Etc::Extra_Player_Slots SCOPED_INCREMENT_IF(rc_FireWeaponDoTrace, doTrace); - DETOUR_MEMBER_CALL(CTFPlayer_FireBullet)(weapon, info, bDoEffects, nDamageType, nCustomDamageType); + DETOUR_MEMBER_CALL(weapon, info, bDoEffects, nDamageType, nCustomDamageType); } DETOUR_DECL_MEMBER(void, CTFPlayer_MaybeDrawRailgunBeam, IRecipientFilter *filter, CTFWeaponBase *weapon, const Vector &vStartPos, const Vector &vEndPos) @@ -1170,7 +1169,7 @@ namespace Mod::Etc::Extra_Player_Slots auto tracerName = reinterpret_cast(this)->GetTracerType(); DispatchParticleEffect(isCritTrace ? CFmtStr("%s_crit", tracerName).Get() : tracerName, PATTACH_ABSORIGIN, nullptr, nullptr, vStartPos, true, vec3_origin, vec3_origin, false, false, &cp, nullptr); } - DETOUR_MEMBER_CALL(CTFPlayer_MaybeDrawRailgunBeam)(filter, weapon, vStartPos, vEndPos); + DETOUR_MEMBER_CALL(filter, weapon, vStartPos, vEndPos); } int GetPlayerSkinNumber(CTFPlayer *player) { diff --git a/src/mod/etc/heat_seeking_rockets.cpp b/src/mod/etc/heat_seeking_rockets.cpp index d1d6bc5c..9aee5421 100644 --- a/src/mod/etc/heat_seeking_rockets.cpp +++ b/src/mod/etc/heat_seeking_rockets.cpp @@ -115,7 +115,7 @@ namespace Mod::Etc::Heat_Seeking_Rockets { auto proj = reinterpret_cast(this); CBaseEntity *original = proj->GetOriginalLauncher(); - DETOUR_MEMBER_CALL(CBaseProjectile_SetLauncher)(launcher); + DETOUR_MEMBER_CALL(launcher); if (launcher != nullptr && original == nullptr) { auto weapon = static_cast(launcher->MyCombatWeaponPointer()); @@ -190,7 +190,7 @@ namespace Mod::Etc::Heat_Seeking_Rockets val = MOVETYPE_CUSTOM; } - DETOUR_MEMBER_CALL(CBaseEntity_SetMoveType)(val, collide); + DETOUR_MEMBER_CALL(val, collide); //if (setmovetype_energyring) { // reinterpret_cast(this)->SetMoveType(MOVETYPE_CUSTOM); @@ -201,7 +201,7 @@ namespace Mod::Etc::Heat_Seeking_Rockets /*DETOUR_DECL_MEMBER(void, CTFProjectile_Rocket_Spawn) { - DETOUR_MEMBER_CALL(CTFProjectile_Rocket_Spawn)(); + DETOUR_MEMBER_CALL(); if (setmovetype_rocket) { reinterpret_cast(this)->SetMoveType(MOVETYPE_CUSTOM); setmovetype_energyring = false; @@ -211,7 +211,7 @@ namespace Mod::Etc::Heat_Seeking_Rockets /*DETOUR_DECL_MEMBER(void, CTFProjectile_Rocket_Spawn) { - DETOUR_MEMBER_CALL(CTFProjectile_Rocket_Spawn)(); + DETOUR_MEMBER_CALL(); auto ent = reinterpret_cast(this); if (ent->GetLauncher() != nullptr) { @@ -360,7 +360,7 @@ namespace Mod::Etc::Heat_Seeking_Rockets { auto ent = reinterpret_cast(this); if (!PerformCustomPhysics(ent, pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity)) { - return DETOUR_MEMBER_CALL(CBaseEntity_PerformCustomPhysics)(pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity); + return DETOUR_MEMBER_CALL(pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity); } } @@ -368,7 +368,7 @@ namespace Mod::Etc::Heat_Seeking_Rockets { auto ent = reinterpret_cast(this); if (!PerformCustomPhysics(ent, pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity)) { - return DETOUR_MEMBER_CALL(CTFProjectile_Flare_PerformCustomPhysics)(pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity); + return DETOUR_MEMBER_CALL(pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity); } } diff --git a/src/mod/etc/hltv_client_interact.cpp b/src/mod/etc/hltv_client_interact.cpp index 24ea69c5..d6c7bed8 100644 --- a/src/mod/etc/hltv_client_interact.cpp +++ b/src/mod/etc/hltv_client_interact.cpp @@ -12,7 +12,7 @@ namespace Mod::Etc::HLTV_Client_Interact auto client = reinterpret_cast(this); CCommand args; if (!args.Tokenize(cmd)) { - return DETOUR_MEMBER_CALL(CHLTVClient_ExecuteStringCommand)(cmd); + return DETOUR_MEMBER_CALL(cmd); } if (FStrEq(args[0], "say")) { @@ -36,7 +36,7 @@ namespace Mod::Etc::HLTV_Client_Interact return true; } - return DETOUR_MEMBER_CALL(CHLTVClient_ExecuteStringCommand)(cmd); + return DETOUR_MEMBER_CALL(cmd); } ConVar sig_etc_hltv_notify_clients("sig_etc_hltv_notify_clients", "1", FCVAR_NOTIFY, @@ -59,7 +59,7 @@ namespace Mod::Etc::HLTV_Client_Interact DETOUR_DECL_MEMBER(IClient *, CHLTVServer_ConnectClient, netadr_t &adr, int protocol, int challenge, int clientChallenge, int authProtocol, const char *name, const char *password, const char *hashedCDkey, int cdKeyLen) { - auto client = DETOUR_MEMBER_CALL(CHLTVServer_ConnectClient)(adr, protocol, challenge, clientChallenge, authProtocol, name, password, hashedCDkey, cdKeyLen); + auto client = DETOUR_MEMBER_CALL(adr, protocol, challenge, clientChallenge, authProtocol, name, password, hashedCDkey, cdKeyLen); return client; } @@ -70,14 +70,14 @@ namespace Mod::Etc::HLTV_Client_Interact if (sig_etc_hltv_notify_clients.GetBool() && client->m_nSignonState >= 5) { PrintToChatAll(CFmtStr("Source TV spectator %s disconnected", client->GetClientName())); } - DETOUR_MEMBER_CALL(CHLTVClient_Disconnect)(reason); + VHOOK_CALL(reason); } VHOOK_DECL(void, CBaseClient_ActivatePlayer) { auto client = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseClient_ActivatePlayer)(); + VHOOK_CALL(); timersys->CreateTimer(&timer_connect, 3.0f, client, 0); if (sig_etc_hltv_notify_clients.GetBool()) { PrintToChatAll(CFmtStr("Source TV spectator %s joined", client->GetClientName())); diff --git a/src/mod/etc/holiday_items_allow.cpp b/src/mod/etc/holiday_items_allow.cpp index 8875bdba..48906a84 100644 --- a/src/mod/etc/holiday_items_allow.cpp +++ b/src/mod/etc/holiday_items_allow.cpp @@ -11,7 +11,7 @@ namespace Mod::Etc::Holiday_Items_Allow DETOUR_DECL_MEMBER(bool, CTFPlayer_ItemIsAllowed, CEconItemView *item_view) { SCOPED_INCREMENT_IF(rc_CTFPlayer_ItemIsAllowed, item_view != nullptr && item_view->GetStaticData() != nullptr && item_view->GetStaticData()->GetKeyValues() != nullptr && FStrEq(item_view->GetStaticData()->GetKeyValues()->GetString("equip_region"), "zombie_body")); - return DETOUR_MEMBER_CALL(CTFPlayer_ItemIsAllowed)(item_view); + return DETOUR_MEMBER_CALL(item_view); } DETOUR_DECL_MEMBER(bool, CEconItemDefinition_BInitFromKV, KeyValues *kv, CUtlVector *errors) @@ -23,12 +23,12 @@ namespace Mod::Etc::Holiday_Items_Allow kv->RemoveSubKey(holiday); holiday->deleteThis(); } - return DETOUR_MEMBER_CALL(CEconItemDefinition_BInitFromKV)(kv, errors); + return DETOUR_MEMBER_CALL(kv, errors); } DETOUR_DECL_STATIC(int, UTIL_GetHolidayForString, const char *str) { - return rc_CTFPlayer_ItemIsAllowed ? DETOUR_STATIC_CALL(UTIL_GetHolidayForString)(str) : kHoliday_None; + return rc_CTFPlayer_ItemIsAllowed ? DETOUR_STATIC_CALL(str) : kHoliday_None; } class CMod : public IMod diff --git a/src/mod/etc/huntsman_damage_fix.cpp b/src/mod/etc/huntsman_damage_fix.cpp index 827abc79..65792e17 100644 --- a/src/mod/etc/huntsman_damage_fix.cpp +++ b/src/mod/etc/huntsman_damage_fix.cpp @@ -12,7 +12,7 @@ namespace Mod::Etc::Huntsman_Damage_Fix auto bow = reinterpret_cast(this); if (ToTFPlayer(bow->GetOwner())->IsBot()) - return DETOUR_MEMBER_CALL(CTFCompoundBow_GetProjectileDamage)(); + return DETOUR_MEMBER_CALL(); float flBaseDamage; float flChargeDamage; @@ -21,7 +21,7 @@ namespace Mod::Etc::Huntsman_Damage_Fix flBaseClassProjectileDamage = 0.0f; SCOPED_INCREMENT(rc_CTFCompoundBow_GetProjectileDamage); - (void)DETOUR_MEMBER_CALL(CTFCompoundBow_GetProjectileDamage)(); + (void)DETOUR_MEMBER_CALL(); flChargeDamage = flBaseClassProjectileDamage; } @@ -47,7 +47,7 @@ namespace Mod::Etc::Huntsman_Damage_Fix DETOUR_DECL_MEMBER(float, CTFWeaponBaseGun_GetProjectileDamage) { - float flDamage = DETOUR_MEMBER_CALL(CTFWeaponBaseGun_GetProjectileDamage)(); + float flDamage = DETOUR_MEMBER_CALL(); if (rc_CTFCompoundBow_GetProjectileDamage > 0) { flBaseClassProjectileDamage = flDamage; @@ -62,7 +62,7 @@ namespace Mod::Etc::Huntsman_Damage_Fix { float normal_time = 1.0f; - float actual_charge = DETOUR_MEMBER_CALL(CTFCompoundBow_GetChargeMaxTime)(); + float actual_charge = DETOUR_MEMBER_CALL(); auto bow = reinterpret_cast(this); diff --git a/src/mod/etc/instant_scaling.cpp b/src/mod/etc/instant_scaling.cpp index a180375c..34e79e8c 100644 --- a/src/mod/etc/instant_scaling.cpp +++ b/src/mod/etc/instant_scaling.cpp @@ -9,7 +9,7 @@ namespace Mod::Etc::Instant_Scaling DETOUR_DECL_MEMBER(void, CTFPlayer_TFPlayerThink) { - DETOUR_MEMBER_CALL(CTFPlayer_TFPlayerThink)(); + DETOUR_MEMBER_CALL(); auto player = reinterpret_cast(this); if (cvar_scalespeed.GetFloat() != 1.0f && TFGameRules()->IsMannVsMachineMode()) { player->m_flHeadScale = Approach(player->GetDesiredHeadScale(), player->m_flHeadScale, (cvar_scalespeed.GetFloat()-1) * gpGlobals->frametime); diff --git a/src/mod/etc/laserdot_fix.cpp b/src/mod/etc/laserdot_fix.cpp index 83ac8fd5..91bde168 100644 --- a/src/mod/etc/laserdot_fix.cpp +++ b/src/mod/etc/laserdot_fix.cpp @@ -30,7 +30,7 @@ namespace Mod::Etc::LaserDot_Fix // "CLaserDot" // "CSniperDot" - DETOUR_MEMBER_CALL(C_SniperDot_ClientThink)(); + DETOUR_MEMBER_CALL(); #endif } diff --git a/src/mod/etc/limp_projectiles.cpp b/src/mod/etc/limp_projectiles.cpp index 6f7f121c..c0b7b8a9 100644 --- a/src/mod/etc/limp_projectiles.cpp +++ b/src/mod/etc/limp_projectiles.cpp @@ -14,7 +14,7 @@ namespace Mod::Etc::Limp_Projectiles velocity.x, velocity.y, velocity.z); Vector vel_mod(velocity.x, 0.0f, velocity.z); - return DETOUR_STATIC_CALL(CTFGrenadePipebombProjectile_Create)(position, angles, vel_mod, angVelocity, pOwner, weaponInfo, i1, f1); + return DETOUR_STATIC_CALL(position, angles, vel_mod, angVelocity, pOwner, weaponInfo, i1, f1); } diff --git a/src/mod/etc/loose_cannon_damage_fix.cpp b/src/mod/etc/loose_cannon_damage_fix.cpp index a25a9d98..2497c8f2 100644 --- a/src/mod/etc/loose_cannon_damage_fix.cpp +++ b/src/mod/etc/loose_cannon_damage_fix.cpp @@ -12,7 +12,7 @@ namespace Mod::Etc::Loose_Cannon_Damage_Fix { SCOPED_INCREMENT(rc_CTFGrenadePipebombProjectile_PipebombTouch); pGrenade = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_PipebombTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); pGrenade = nullptr; } @@ -42,7 +42,7 @@ namespace Mod::Etc::Loose_Cannon_Damage_Fix } } - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } // DETOUR_DECL_MEMBER(void, CBaseGrenade_SetDamage, float flDamage) @@ -50,7 +50,7 @@ namespace Mod::Etc::Loose_Cannon_Damage_Fix // auto grenade = reinterpret_cast(this); // // float flBefore = grenade->GetDamage(); -// DETOUR_MEMBER_CALL(CBaseGrenade_SetDamage)(flDamage); +// DETOUR_MEMBER_CALL(flDamage); // float flAfter = grenade->GetDamage(); // // DevMsg("CBaseGrenade::SetDamage: [%.1f --> %.1f]\n", flBefore, flAfter); diff --git a/src/mod/etc/mapentity_additions.cpp b/src/mod/etc/mapentity_additions.cpp index 075111bc..e64a895b 100644 --- a/src/mod/etc/mapentity_additions.cpp +++ b/src/mod/etc/mapentity_additions.cpp @@ -395,7 +395,7 @@ namespace Mod::Etc::Mapentity_Additions EntityOutputPrintDebug(reinterpret_cast(this), Value, pActivator, pCaller, fDelay); } - DETOUR_MEMBER_CALL(CBaseEntityOutput_FireOutput)(Value, pActivator, pCaller, fDelay); + DETOUR_MEMBER_CALL(Value, pActivator, pCaller, fDelay); } DETOUR_DECL_MEMBER(bool, CBaseEntity_AcceptInput, const char *szInputName, CBaseEntity *pActivator, CBaseEntity *pCaller, variant_t Value, int outputID) @@ -419,7 +419,7 @@ namespace Mod::Etc::Mapentity_Additions if (!message_listeners_empty) { SendMessageToListeners("(%0.2f) input %s: %s.%s(%s)\n", gpGlobals->curtime, pCaller != nullptr ? STRING(pCaller->GetEntityName()) : "", ent->GetEntityName(), szInputName, Value.String()); } - auto ret = DETOUR_MEMBER_CALL(CBaseEntity_AcceptInput)(szInputName, pActivator, pCaller, Value, outputID); + auto ret = DETOUR_MEMBER_CALL(szInputName, pActivator, pCaller, Value, outputID); if (!ret && !message_listeners_empty) { SendMessageToListeners("unhandled input: (%s) -> (%s,%s)\n", szInputName, ent->GetClassname(), STRING(ent->GetEntityName())/*,", from (%s,%s)" STRING(pCaller->m_iClassname), STRING(pCaller->m_iName)*/ ); @@ -442,7 +442,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CTFGameRules_CleanUpMap) { - DETOUR_MEMBER_CALL(CTFGameRules_CleanUpMap)(); + DETOUR_MEMBER_CALL(); ActivateLoadedInput(); } @@ -604,7 +604,7 @@ namespace Mod::Etc::Mapentity_Additions if (szName[0] == '@' && !rc_SpecialParsedNameFail) return DoSpecialParsing(szName, pStartEntity, [&](CBaseEntity *entity, const char *realname) {return entList->FindEntityByClassname(entity, realname, filter);}); - if (!cvar_fast_lookup.GetBool()) return DETOUR_MEMBER_CALL(CGlobalEntityList_FindEntityByClassname)(pStartEntity, szName, filter); + if (!cvar_fast_lookup.GetBool()) return DETOUR_MEMBER_CALL(pStartEntity, szName, filter); string_t lowercaseStr; if (last_entity_name == szName) { @@ -660,7 +660,7 @@ namespace Mod::Etc::Mapentity_Additions if (szName[0] == '@' && !rc_SpecialParsedNameFail) return DoSpecialParsing(szName, pStartEntity, [&](CBaseEntity *entity, const char *realname) {return servertools->FindEntityByName(entity, realname, pSearchingEntity, pActivator, pCaller, pFilter);}); - if (szName[0] == '!' || !cvar_fast_lookup.GetBool()) return DETOUR_MEMBER_CALL(CGlobalEntityList_FindEntityByName)(pStartEntity, szName, pSearchingEntity, pActivator, pCaller, pFilter); + if (szName[0] == '!' || !cvar_fast_lookup.GetBool()) return DETOUR_MEMBER_CALL(pStartEntity, szName, pSearchingEntity, pActivator, pCaller, pFilter); auto entList = reinterpret_cast(this); @@ -719,7 +719,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CTFMedigunShield_UpdateShieldPosition) { - DETOUR_MEMBER_CALL(CTFMedigunShield_UpdateShieldPosition)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFMedigunShield_ShieldThink) @@ -740,21 +740,21 @@ namespace Mod::Etc::Mapentity_Additions shield->SetBlocksLOS(false); return; } - DETOUR_MEMBER_CALL(CTFMedigunShield_ShieldThink)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTriggerHurt_HurtEntity; DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CTriggerHurt_HurtEntity, CBaseEntity *other, float damage) { SCOPED_INCREMENT(rc_CTriggerHurt_HurtEntity); - return DETOUR_MEMBER_CALL(CTriggerHurt_HurtEntity)(other, damage); + return DETOUR_MEMBER_CALL(other, damage); } RefCount rc_CTriggerIgnite_BurnEntities; DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, int, CTriggerIgnite_BurnEntities) { SCOPED_INCREMENT(rc_CTriggerIgnite_BurnEntities); - return DETOUR_MEMBER_CALL(CTriggerIgnite_BurnEntities)(); + return DETOUR_MEMBER_CALL(); } CTFPlayer *selfburn_replace = nullptr; @@ -762,7 +762,7 @@ namespace Mod::Etc::Mapentity_Additions { auto me = reinterpret_cast(this); selfburn_replace = ToTFPlayer(me->GetOwnerEntity()); - DETOUR_MEMBER_CALL(CTriggerIgnite_IgniteEntity)(other); + DETOUR_MEMBER_CALL(other); selfburn_replace = nullptr; if (me->GetOwnerEntity() != nullptr && other->IsPlayer()) { } @@ -774,7 +774,7 @@ namespace Mod::Etc::Mapentity_Additions reinterpret_cast(this)->Burn(selfburn_replace, nullptr, duration); return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_SelfBurn)(duration); + DETOUR_MEMBER_CALL(duration); } RefCount rc_CBaseEntity_TakeDamage; @@ -792,7 +792,7 @@ namespace Mod::Etc::Mapentity_Additions CBaseEntity *entity = reinterpret_cast(this); bool alive = entity->IsAlive(); int health_pre = entity->GetHealth(); - auto damage = DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + auto damage = DETOUR_MEMBER_CALL(info); if (damage != 0 && health_pre - entity->GetHealth() != 0) { variant_t variant; variant.SetInt(health_pre - entity->GetHealth()); @@ -809,7 +809,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CBaseEntity_Event_Killed, CTakeDamageInfo &info) { CBaseEntity *entity = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseEntity_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); variant_t variant; variant.SetInt(info.GetDamage()); @@ -820,12 +820,12 @@ namespace Mod::Etc::Mapentity_Additions { info.SetDamage(-100); - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CBaseObject_InitializeMapPlacedObject) { - DETOUR_MEMBER_CALL(CBaseObject_InitializeMapPlacedObject)(); + DETOUR_MEMBER_CALL(); auto sentry = reinterpret_cast(this); variant_t variant; @@ -850,7 +850,7 @@ namespace Mod::Etc::Mapentity_Additions if (rtti_cast(view) != nullptr && view->GetCustomVariableFloat<"allowdamage">() == 0) { return; } - DETOUR_MEMBER_CALL(CBasePlayer_CommitSuicide)(explode, force); + DETOUR_MEMBER_CALL(explode, force); } DETOUR_DECL_STATIC(CTFDroppedWeapon *, CTFDroppedWeapon_Create, const Vector& vecOrigin, const QAngle& vecAngles, CBaseEntity *pOwner, const char *pszModelName, const CEconItemView *pItemView) @@ -864,7 +864,7 @@ namespace Mod::Etc::Mapentity_Additions TFGameRules()->Set_m_bPlayingMannVsMachine(false); } - auto result = DETOUR_STATIC_CALL(CTFDroppedWeapon_Create)(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); + auto result = DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); if (allow_create_dropped_weapon) { TFGameRules()->Set_m_bPlayingMannVsMachine(is_mvm_mode); @@ -887,7 +887,7 @@ namespace Mod::Etc::Mapentity_Additions variant.SetInt(entity->entindex()); entity->FireCustomOutput<"onkilled">(entity, entity, variant); - DETOUR_MEMBER_CALL(CBaseEntity_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); } THINK_FUNC_DECL(OnSpawnOutputFire) @@ -898,7 +898,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CBaseEntity_Activate) { auto entity = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseEntity_Activate)(); + DETOUR_MEMBER_CALL(); if (entity->GetExtraEntityData() != nullptr) { THINK_FUNC_SET(entity, OnSpawnOutputFire, gpGlobals->curtime); } @@ -924,14 +924,14 @@ namespace Mod::Etc::Mapentity_Additions if (szKeyName[0] == '$') { ParseCustomOutput(parse_ent, szKeyName + 1, szValue); } - return DETOUR_MEMBER_CALL(CBaseEntity_KeyValue)(szKeyName, szValue); + return DETOUR_MEMBER_CALL(szKeyName, szValue); } DETOUR_DECL_MEMBER(bool, CTankSpawner_Spawn, const Vector& where, CUtlVector> *ents) { auto spawner = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTankSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (cvar_fast_lookup.GetBool() && result && ents != nullptr && !ents->IsEmpty()) { @@ -948,7 +948,7 @@ namespace Mod::Etc::Mapentity_Additions { auto timer = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTeamRoundTimer_InputSetTime)(inputdata); + DETOUR_MEMBER_CALL(inputdata); // On some gamemodes, the game spawns timers automatically, the names are not pooled and need to be in order for fast lookup to work if (cvar_fast_lookup.GetBool()) { @@ -962,7 +962,7 @@ namespace Mod::Etc::Mapentity_Additions // StrLowerCopy(classname, lowercase, 255); // reinterpret_cast(this)->SetClassname(AllocPooledString(lowercase)); // } - // return DETOUR_MEMBER_CALL(CBaseEntity_PostConstructor)(classname); + // return DETOUR_MEMBER_CALL(classname); // } PooledString filter_keyvalue_class("$filter_keyvalue"); @@ -1110,7 +1110,7 @@ namespace Mod::Etc::Mapentity_Additions return false; } } - return DETOUR_MEMBER_CALL(CBaseFilter_PassesFilterImpl)(pCaller, pEntity); + return DETOUR_MEMBER_CALL(pCaller, pEntity); } void OnCameraRemoved(CTriggerCamera *camera) @@ -1133,7 +1133,7 @@ namespace Mod::Etc::Mapentity_Additions auto camera = reinterpret_cast(this); auto player = ToTFPlayer(camera->m_hPlayer); int oldTakeDamage = player != nullptr ? player->m_takedamage : 0; - DETOUR_MEMBER_CALL(CTriggerCamera_Enable)(); + DETOUR_MEMBER_CALL(); if (player != nullptr && !player->IsAlive() && player->m_hViewEntity == camera) { camera->m_spawnflags |= 8192; } @@ -1148,7 +1148,7 @@ namespace Mod::Etc::Mapentity_Additions auto player = ToTFPlayer(camera->m_hPlayer); int oldTakeDamage = player != nullptr ? camera->m_hPlayer->m_takedamage : 0; CBaseEntity *view = player != nullptr ? player->m_hViewEntity.Get() : nullptr; - DETOUR_MEMBER_CALL(CTriggerCamera_Disable)(); + DETOUR_MEMBER_CALL(); if (player != nullptr && view == camera) { if (!player->IsAlive()) { player->m_hViewEntity = nullptr; @@ -1171,13 +1171,13 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CTriggerCamera_D0) { OnCameraRemoved(reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CTriggerCamera_D0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTriggerCamera_D2) { OnCameraRemoved(reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CTriggerCamera_D2)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CFuncRotating_InputStop, inputdata_t *inputdata) @@ -1186,7 +1186,7 @@ namespace Mod::Etc::Mapentity_Additions if (data != nullptr) { data->m_hRotateTarget = nullptr; } - DETOUR_MEMBER_CALL(CFuncRotating_InputStop)(inputdata); + DETOUR_MEMBER_CALL(inputdata); } THINK_FUNC_DECL(DetectorTick) @@ -1301,7 +1301,7 @@ namespace Mod::Etc::Mapentity_Additions auto data = GetExtraTriggerDetectorData(trigger); THINK_FUNC_SET(trigger, DetectorTick, gpGlobals->curtime); } - DETOUR_MEMBER_CALL(CBaseTrigger_Activate)(); + DETOUR_MEMBER_CALL(); } THINK_FUNC_DECL(WeaponSpawnerTick) @@ -1444,7 +1444,7 @@ namespace Mod::Etc::Mapentity_Additions { if (rc_IsSpaceToSpawnHere_Allow) return true; - return DETOUR_STATIC_CALL(IsSpaceToSpawnHere)(pos); + return DETOUR_STATIC_CALL(pos); } THINK_FUNC_DECL(TFBotClearCustomVars) { @@ -1467,7 +1467,7 @@ namespace Mod::Etc::Mapentity_Additions THINK_FUNC_SET(player, TFBotClearCustomVars, gpGlobals->curtime); } - DETOUR_MEMBER_CALL(CTFPlayer_StateEnter)(nState); + DETOUR_MEMBER_CALL(nState); } VHOOK_DECL(bool, CPointTeleport_KeyValue, const char *szKeyName, const char *szValue) @@ -1480,7 +1480,7 @@ namespace Mod::Etc::Mapentity_Additions mod->kv->AddSubKey(kv); return true; } - return VHOOK_CALL(CPointTeleport_KeyValue)(szKeyName, szValue); + return VHOOK_CALL(szKeyName, szValue); } DETOUR_DECL_MEMBER(void, CPointTeleport_Activate) @@ -1489,7 +1489,7 @@ namespace Mod::Etc::Mapentity_Additions if (spawner->GetClassname() == weapon_spawner_classname) { THINK_FUNC_SET(spawner, WeaponSpawnerTick, gpGlobals->curtime + 0.1f); } - DETOUR_MEMBER_CALL(CPointTeleport_Activate)(); + DETOUR_MEMBER_CALL(); if (spawner->GetClassname() == PStr<"$tf_bot_spawn">()) { if (!SpawnTFBotRetry(spawner) && !spawner->GetCustomVariableBool<"manualspawn">()) { THINK_FUNC_SET(spawner, SpawnTFBotThink, gpGlobals->curtime); @@ -1522,7 +1522,7 @@ namespace Mod::Etc::Mapentity_Additions } } else { - DETOUR_MEMBER_CALL(CTFDroppedWeapon_InitPickedUpWeapon)(player, weapon); + DETOUR_MEMBER_CALL(player, weapon); } } @@ -1533,7 +1533,7 @@ namespace Mod::Etc::Mapentity_Additions { filter_entity = reinterpret_cast(this); filter_total_multiplier = 1.0f; - auto ret = DETOUR_MEMBER_CALL(CBaseFilter_PassesDamageFilter)(info); + auto ret = DETOUR_MEMBER_CALL(info); if (filter_total_multiplier != 1.0f) { if (filter_total_multiplier > 0) info.SetDamage(info.GetDamage() * filter_total_multiplier); @@ -1548,7 +1548,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(bool, CBaseFilter_PassesDamageFilter, CTakeDamageInfo &info) { - auto ret = DETOUR_MEMBER_CALL(CBaseFilter_PassesDamageFilter)(info); + auto ret = DETOUR_MEMBER_CALL(info); auto filter = reinterpret_cast(this); float multiplier = filter->GetCustomVariableFloat<"multiplier">(); @@ -1578,7 +1578,7 @@ namespace Mod::Etc::Mapentity_Additions return iDmgType == filter->GetCustomVariableFloat<"type">(); } } - return DETOUR_MEMBER_CALL(CBaseFilter_PassesDamageFilterImpl)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CEventQueue_AddEvent_CBaseEntity, CBaseEntity *target, const char *targetInput, variant_t Value, float fireDelay, CBaseEntity *pActivator, CBaseEntity *pCaller, int outputID) @@ -1589,7 +1589,7 @@ namespace Mod::Etc::Mapentity_Additions } return; } - DETOUR_MEMBER_CALL(CEventQueue_AddEvent_CBaseEntity)(target, targetInput, Value, fireDelay, pActivator, pCaller, outputID); + DETOUR_MEMBER_CALL(target, targetInput, Value, fireDelay, pActivator, pCaller, outputID); } DETOUR_DECL_MEMBER(void, CEventQueue_CancelEvents, CBaseEntity *caller) @@ -1619,12 +1619,12 @@ namespace Mod::Etc::Mapentity_Additions } return; } - DETOUR_MEMBER_CALL(CEventQueue_AddEvent)(target, targetInput, Value, fireDelay, pActivator, pCaller, outputID); + DETOUR_MEMBER_CALL(target, targetInput, Value, fireDelay, pActivator, pCaller, outputID); } DETOUR_DECL_STATIC(CBaseEntity *, CreateEntityByName, const char *className, int iForceEdictIndex) { - auto ret = DETOUR_STATIC_CALL(CreateEntityByName)(className, iForceEdictIndex); + auto ret = DETOUR_STATIC_CALL(className, iForceEdictIndex); if (ret != nullptr && !entity_listeners.empty()) { auto classNameOur = MAKE_STRING(ret->GetClassname()); for (auto it = entity_listeners.begin(); it != entity_listeners.end();) { @@ -1647,7 +1647,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CEventAction_CEventAction, const char *name) { - if (name == nullptr) { DETOUR_MEMBER_CALL(CEventAction_CEventAction)(name); return; } + if (name == nullptr) { DETOUR_MEMBER_CALL(name); return; } //TIME_SCOPE2(cevent) char *newname = nullptr; @@ -1682,7 +1682,7 @@ namespace Mod::Etc::Mapentity_Additions name = newname; } //Msg("Event action post %s\n", name); - DETOUR_MEMBER_CALL(CEventAction_CEventAction)(name); + DETOUR_MEMBER_CALL(name); } DETOUR_DECL_STATIC(void, SV_ComputeClientPacks, int clientCount, void **clients, void *snapshot) @@ -1693,7 +1693,7 @@ namespace Mod::Etc::Mapentity_Additions SetEntityVariable(module->entity, SENDPROP, entry.first.c_str(), entry.second.first); } } - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); for (auto &module : FakePropModule::List()) { for (auto &entry : module->props) { SetEntityVariable(module->entity, SENDPROP, entry.first.c_str(), entry.second.second); @@ -1705,14 +1705,14 @@ namespace Mod::Etc::Mapentity_Additions { if (entity->GetClassname() == PStr<"$script_manager">()) return true; - return DETOUR_MEMBER_CALL(CTFGameRules_RoundCleanupShouldIgnore)(entity); + return DETOUR_MEMBER_CALL(entity); } DETOUR_DECL_MEMBER(bool, CTFGameRules_ShouldCreateEntity, const char *classname) { if (strcmp(classname, "$script_manager") == 0) return false; - return DETOUR_MEMBER_CALL(CTFGameRules_ShouldCreateEntity)(classname); + return DETOUR_MEMBER_CALL(classname); } @@ -1740,7 +1740,7 @@ namespace Mod::Etc::Mapentity_Additions mod->Activate(); } - return VHOOK_CALL(CMathCounter_Activate)(); + return VHOOK_CALL(); } bool DoCollideTestInternal(CBaseEntity *entity1, CBaseEntity *entity2, bool &result, variant_t &val) { auto filterEnt = static_cast(val.Entity().Get()); @@ -1793,7 +1793,7 @@ namespace Mod::Etc::Mapentity_Additions return result; } } - return DETOUR_STATIC_CALL(PassServerEntityFilter)(ent1, ent2); + return DETOUR_STATIC_CALL(ent1, ent2); } DETOUR_DECL_MEMBER(int, CCollisionEvent_ShouldCollide, IPhysicsObject *pObj0, IPhysicsObject *pObj1, void *pGameData0, void *pGameData1) @@ -1813,7 +1813,7 @@ namespace Mod::Etc::Mapentity_Additions } } } - return DETOUR_MEMBER_CALL(CCollisionEvent_ShouldCollide)(pObj0, pObj1, pGameData0, pGameData1); + return DETOUR_MEMBER_CALL(pObj0, pObj1, pGameData0, pGameData1); } DETOUR_DECL_MEMBER(int, CBaseEntity_DispatchUpdateTransmitState) @@ -1832,7 +1832,7 @@ namespace Mod::Etc::Mapentity_Additions return FL_EDICT_FULLCHECK; } } - return DETOUR_MEMBER_CALL(CBaseEntity_DispatchUpdateTransmitState)(); + return DETOUR_MEMBER_CALL(); } bool ModVisibilityUpdate(CBaseEntity *entity, const CCheckTransmitInfo *info) @@ -1860,7 +1860,7 @@ namespace Mod::Etc::Mapentity_Additions if (entity->GetExtraEntityData() != nullptr && ModVisibilityUpdate(entity, info)) return FL_EDICT_DONTSEND; } - return DETOUR_MEMBER_CALL(CBaseEntity_ShouldTransmit)(info); + return DETOUR_MEMBER_CALL(info); } void ClearFakeProp() @@ -1886,7 +1886,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CPopulationManager_Initialize) { - auto ret = DETOUR_MEMBER_CALL(CPopulationManager_Initialize)(); + auto ret = DETOUR_MEMBER_CALL(); #ifndef NO_MVM if (change_level_info.setInitializeCurrency) { @@ -1910,14 +1910,14 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(void, CPopulationManager_ResetMap) { - DETOUR_MEMBER_CALL(CPopulationManager_ResetMap)(); + DETOUR_MEMBER_CALL(); change_level_info.setInitializeCurrency = false; } DETOUR_DECL_MEMBER(void, CObjectTeleporter_RecieveTeleportingPlayer, CTFPlayer *player) { auto tele = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CObjectTeleporter_RecieveTeleportingPlayer)(player); + DETOUR_MEMBER_CALL(player); if (player != nullptr) { tele->FireCustomOutput<"onteleportreceive">(player, tele, Variant()); } @@ -1930,7 +1930,7 @@ namespace Mod::Etc::Mapentity_Additions if (s_lastTeleporter.GetRef() == nullptr) { s_lastTeleporter.GetRef() = player; } - DETOUR_STATIC_CALL(OnBotTeleported)(player); + DETOUR_STATIC_CALL(player); if (s_lastTeleporter.GetRef() != nullptr) { s_lastTeleporter.GetRef()->FireCustomOutput<"onteleportreceive">(player, s_lastTeleporter.GetRef(), Variant()); } @@ -1938,7 +1938,7 @@ namespace Mod::Etc::Mapentity_Additions VHOOK_DECL(void, CObjectSentrygun_FireBullets, FireBulletsInfo_t &info) { - VHOOK_CALL(CObjectSentrygun_FireBullets)(info); + VHOOK_CALL(info); auto sentry = reinterpret_cast(this); sentry->FireCustomOutput<"onshootbullet">(sentry, sentry, Variant()); } @@ -1946,7 +1946,7 @@ namespace Mod::Etc::Mapentity_Additions CBaseEntity *sentry_gun_rocket = nullptr; DETOUR_DECL_STATIC(CTFProjectile_SentryRocket *, CTFProjectile_SentryRocket_Create, const Vector &vecOrigin, const QAngle &vecAngles, CBaseEntity *pOwner, CBaseEntity *pScorer) { - auto ret = DETOUR_STATIC_CALL(CTFProjectile_SentryRocket_Create)(vecOrigin, vecAngles, pOwner, pScorer); + auto ret = DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pScorer); sentry_gun_rocket = ret; return ret; } @@ -1954,7 +1954,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(bool, CObjectSentrygun_FireRocket) { sentry_gun_rocket = nullptr; - bool ret = DETOUR_MEMBER_CALL(CObjectSentrygun_FireRocket)(); + bool ret = DETOUR_MEMBER_CALL(); if (ret && sentry_gun_rocket != nullptr) { auto sentry = reinterpret_cast(this); sentry->FireCustomOutput<"onshootrocket">(sentry_gun_rocket, sentry, Variant()); @@ -1980,7 +1980,7 @@ namespace Mod::Etc::Mapentity_Additions } } } - auto result = DETOUR_MEMBER_CALL(CTFBot_GetFlagToFetch)(); + auto result = DETOUR_MEMBER_CALL(); for (auto flag : disabledFlags) { flag->SetDisabled(false); } @@ -1998,7 +1998,7 @@ namespace Mod::Etc::Mapentity_Additions return; } } - DETOUR_MEMBER_CALL(CCaptureFlag_FlagTouch)(other); + DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(bool, CFlagDetectionZone_EntityIsFlagCarrier, CBaseEntity *other) @@ -2020,14 +2020,14 @@ namespace Mod::Etc::Mapentity_Additions return false; } } - return DETOUR_MEMBER_CALL(CFlagDetectionZone_EntityIsFlagCarrier)(other); + return DETOUR_MEMBER_CALL(other); } RefCount rc_CTFBotDeliverFlag_UpgradeOverTime; DETOUR_DECL_MEMBER(bool,CTFBotDeliverFlag_UpgradeOverTime, CTFBot *bot) { SCOPED_INCREMENT_IF(rc_CTFBotDeliverFlag_UpgradeOverTime, bot->GetItem() != nullptr && bot->GetItem()->GetCustomVariableBool<"disablebuffs">()); - auto result = DETOUR_MEMBER_CALL(CTFBotDeliverFlag_UpgradeOverTime)(bot); + auto result = DETOUR_MEMBER_CALL(bot); if (result && bot->GetItem() != nullptr) { switch (TFObjectiveResource()->m_nFlagCarrierUpgradeLevel) { case 1: bot->GetItem()->FireCustomOutput<"onbombupgradelevel1">(bot, bot->GetItem(), Variant()); break; @@ -2045,18 +2045,18 @@ namespace Mod::Etc::Mapentity_Additions { if (rc_CTFBotDeliverFlag_UpgradeOverTime) return; - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } DETOUR_DECL_MEMBER(void, CCaptureFlag_Drop, CTFPlayer *pPlayer, bool bVisible, bool bThrown, bool bMessage) { - DETOUR_MEMBER_CALL(CCaptureFlag_Drop)(pPlayer, bVisible, bThrown, bMessage); + DETOUR_MEMBER_CALL(pPlayer, bVisible, bThrown, bMessage); auto flag = reinterpret_cast(this); flag->FireCustomOutput<"ondrop">(pPlayer, flag, Variant()); } DETOUR_DECL_MEMBER(void, CCaptureFlag_PickUp, CTFPlayer *player, bool invisible) { - DETOUR_MEMBER_CALL(CCaptureFlag_PickUp)(player, invisible); + DETOUR_MEMBER_CALL(player, invisible); auto flag = reinterpret_cast(this); flag->FireCustomOutput<"onpickup">(player, flag, Variant()); } @@ -2073,14 +2073,14 @@ namespace Mod::Etc::Mapentity_Additions pushEntity = push; pushFilter = rtti_cast(val.Entity().Get()); } - DETOUR_MEMBER_CALL(CPointPush_PushThink)(); + DETOUR_MEMBER_CALL(); pushFilter = nullptr; pushEntity = nullptr; } DETOUR_DECL_STATIC(int, UTIL_EntitiesInSphere, const Vector& center, float radius, CFlaggedEntitiesEnum *pEnum) { - auto result = DETOUR_STATIC_CALL(UTIL_EntitiesInSphere)(center, radius, pEnum); + auto result = DETOUR_STATIC_CALL(center, radius, pEnum); if (pushFilter != nullptr) { auto list = pEnum->GetList(); for (auto i = 0; i < pEnum->GetCount(); i++) { @@ -2100,7 +2100,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(bool, IVision_IsLineOfSightClear, const Vector &pos) { seeEntity = reinterpret_cast(this)->GetBot()->GetEntity(); - auto result = DETOUR_MEMBER_CALL(IVision_IsLineOfSightClear)(pos); + auto result = DETOUR_MEMBER_CALL(pos); seeEntity = nullptr; return result; } @@ -2108,7 +2108,7 @@ namespace Mod::Etc::Mapentity_Additions DETOUR_DECL_MEMBER(bool, IVision_IsLineOfSightClearToEntity, CBaseEntity *subject, Vector *visibleSpot) { seeEntity = reinterpret_cast(this)->GetBot()->GetEntity(); - auto result = DETOUR_MEMBER_CALL(IVision_IsLineOfSightClearToEntity)(subject, visibleSpot); + auto result = DETOUR_MEMBER_CALL(subject, visibleSpot); seeEntity = nullptr; return result; } @@ -2129,7 +2129,7 @@ namespace Mod::Etc::Mapentity_Additions } return true; } - return VHOOK_CALL(CFuncWall_ShouldCollide)(collisionGroup, contentsMask); + return VHOOK_CALL(collisionGroup, contentsMask); } GlobalThunk PackRatios("PackRatios"); @@ -2147,7 +2147,7 @@ namespace Mod::Etc::Mapentity_Additions packRatiosArr[1] = ratio; packRatiosArr[2] = ratio; } - DETOUR_MEMBER_CALL(CItem_ItemTouch)(entity); + DETOUR_MEMBER_CALL(entity); if (ratio != -1.0f) { packRatiosArr[0] = oldPackRatios[0]; packRatiosArr[1] = oldPackRatios[1]; @@ -2187,7 +2187,7 @@ namespace Mod::Etc::Mapentity_Additions return true; } } - return VHOOK_CALL(CTFBot_KeyValue)(szKeyName, szValue); + return VHOOK_CALL(szKeyName, szValue); } DETOUR_DECL_MEMBER(void, CTFBot_Spawn) @@ -2198,7 +2198,7 @@ namespace Mod::Etc::Mapentity_Additions return; } - DETOUR_MEMBER_CALL(CTFBot_Spawn)(); + DETOUR_MEMBER_CALL(); } VHOOK_DECL(void, CTFBot_Activate) @@ -2209,7 +2209,7 @@ namespace Mod::Etc::Mapentity_Additions if (mod != nullptr) { bot->m_iInitialTeamNum = 0; } - VHOOK_CALL(CTFBot_Activate)(); + VHOOK_CALL(); if (mod != nullptr) { mod->activated = true; auto spawner = IPopulationSpawner::ParseSpawner(&mod->populator, mod->kv); @@ -2253,7 +2253,7 @@ namespace Mod::Etc::Mapentity_Additions THINK_FUNC_SET(player, PlayerKickThink, gpGlobals->curtime + player->GetCustomVariableFloat<"kickafterdeathdelay">(-1.0f)); } } - DETOUR_MEMBER_CALL(CTFPlayer_StateLeave)(); + DETOUR_MEMBER_CALL(); } #ifndef NO_MVM @@ -2264,7 +2264,7 @@ namespace Mod::Etc::Mapentity_Additions betweenWavesModifiedWaveBar = false; return; } - DETOUR_MEMBER_CALL(CPopulationManager_UpdateObjectiveResource)(); + DETOUR_MEMBER_CALL(); } #endif diff --git a/src/mod/etc/medicgun_beam_machinery.cpp b/src/mod/etc/medicgun_beam_machinery.cpp index f693a0fb..f48e7a4d 100644 --- a/src/mod/etc/medicgun_beam_machinery.cpp +++ b/src/mod/etc/medicgun_beam_machinery.cpp @@ -8,7 +8,7 @@ namespace Mod::Etc::Medicgun_Beam_Machinery { if (pTarget->IsBaseObject()) return true; - return DETOUR_MEMBER_CALL(CWeaponMedigun_AllowedToHealTarget)(pTarget); + return DETOUR_MEMBER_CALL(pTarget); } diff --git a/src/mod/etc/melee_ignore_teammates.cpp b/src/mod/etc/melee_ignore_teammates.cpp index fd8fbcef..34594497 100644 --- a/src/mod/etc/melee_ignore_teammates.cpp +++ b/src/mod/etc/melee_ignore_teammates.cpp @@ -17,7 +17,7 @@ namespace Mod::Etc::Melee_Ignore_Teammates DETOUR_DECL_MEMBER(void, CTFWeaponBaseMelee_Smack ) { SCOPED_INCREMENT(rc_CTFWeaponBaseMelee_Smack); - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFWeaponBaseMelee_DoSwingTraceInternal, CGameTrace& tr, bool cleave_attack, CUtlVector *traces) { @@ -57,12 +57,12 @@ namespace Mod::Etc::Melee_Ignore_Teammates attacker = weapon->GetTFPlayerOwner(); //is_whip = (CAttributeManager::AttribHookValue(0, "speed_buff_ally", weapon) > 0); SCOPED_INCREMENT(rc_CTFWeaponBaseMelee_DoSwingTraceInternal); - result = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(tr, cleave_attack, traces); + result = DETOUR_MEMBER_CALL(tr, cleave_attack, traces); if (tr.m_pEnt != nullptr && tr.m_pEnt->GetTeamNumber() == attacker->GetTeamNumber()) { CGameTrace newtrace; enemy_attack_pass = true; - bool newresult = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(newtrace, cleave_attack, traces); + bool newresult = DETOUR_MEMBER_CALL(newtrace, cleave_attack, traces); enemy_attack_pass = false; if(newtrace.m_pEnt != nullptr && newtrace.m_pEnt->GetTeamNumber() != attacker->GetTeamNumber()) { @@ -73,7 +73,7 @@ namespace Mod::Etc::Melee_Ignore_Teammates //is_whip = false; } else { - result = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(tr, cleave_attack, traces); + result = DETOUR_MEMBER_CALL(tr, cleave_attack, traces); } if (cleave_attack) { @@ -93,13 +93,13 @@ namespace Mod::Etc::Melee_Ignore_Teammates is_whip = (CAttributeManager::AttribHookValue(0, "speed_buff_ally", weapon) > 0); - result = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(tr, cleave_attack, traces); + result = DETOUR_MEMBER_CALL(tr, cleave_attack, traces); melee = nullptr; owner = nullptr; is_whip = false; } else { - result = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(tr, cleave_attack, traces); + result = DETOUR_MEMBER_CALL(tr, cleave_attack, traces); }*/ return result; @@ -109,16 +109,16 @@ namespace Mod::Etc::Melee_Ignore_Teammates { if (trace.m_pEnt == nullptr) return false; - return DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_OnSwingHit)(trace); + return DETOUR_MEMBER_CALL(trace); } DETOUR_DECL_STATIC(int, CAttributeManager_AttribHookValue_int, int value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) { if (rc_CTFWeaponBaseMelee_Smack > 0 && V_stricmp(attr, "melee_cleave_attack") == 0) { - value = DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_int)(value, "projectile_penetration", ent, vec, b1); + value = DETOUR_STATIC_CALL(value, "projectile_penetration", ent, vec, b1); } - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_int)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } DETOUR_DECL_MEMBER(bool, CTraceFilterIgnoreFriendlyCombatItems_ShouldHitEntity, IHandleEntity *pServerEntity, int contentsMask) @@ -128,7 +128,7 @@ namespace Mod::Etc::Melee_Ignore_Teammates if (entity->IsPlayer() && entity->GetTeamNumber() == attacker->GetTeamNumber()) return false; } - return DETOUR_MEMBER_CALL(CTraceFilterIgnoreFriendlyCombatItems_ShouldHitEntity)(pServerEntity, contentsMask); + return DETOUR_MEMBER_CALL(pServerEntity, contentsMask); } @@ -137,7 +137,7 @@ namespace Mod::Etc::Melee_Ignore_Teammates DETOUR_DECL_STATIC(void, FindHullIntersection, const Vector& vecSrc, trace_t& tr, const Vector& mins, const Vector& maxs, CBaseEntity *pEntity) { SCOPED_INCREMENT(rc_FindHullIntersection); - DETOUR_STATIC_CALL(FindHullIntersection)(vecSrc, tr, mins, maxs, pEntity); + DETOUR_STATIC_CALL(vecSrc, tr, mins, maxs, pEntity); } @@ -164,7 +164,7 @@ namespace Mod::Etc::Melee_Ignore_Teammates #warning TODO } - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); } */ diff --git a/src/mod/etc/misc.cpp b/src/mod/etc/misc.cpp index 4cab8468..f61e718f 100644 --- a/src/mod/etc/misc.cpp +++ b/src/mod/etc/misc.cpp @@ -26,7 +26,7 @@ namespace Mod::Etc::Misc return false; } - return DETOUR_MEMBER_CALL(CTFProjectile_Rocket_IsDeflectable)(); + return DETOUR_MEMBER_CALL(); } bool AllowHit(CBaseEntity *proj, CBaseEntity *other) @@ -50,7 +50,7 @@ namespace Mod::Etc::Misc auto arrow = reinterpret_cast(this); if (AllowHit(arrow, pOther)) - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_ArrowTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } DETOUR_DECL_MEMBER(void, CTFProjectile_EnergyRing_ProjectileTouch, CBaseEntity *pOther) @@ -58,7 +58,7 @@ namespace Mod::Etc::Misc auto proj = reinterpret_cast(this); if (AllowHit(proj, pOther)) - DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_ProjectileTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } DETOUR_DECL_MEMBER(void, CTFProjectile_BallOfFire_RocketTouch, CBaseEntity *pOther) @@ -66,7 +66,7 @@ namespace Mod::Etc::Misc auto arrow = reinterpret_cast(this); if (AllowHit(arrow, pOther)) - DETOUR_MEMBER_CALL(CTFProjectile_BallOfFire_RocketTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } RefCount rc_DoNotOverrideSmoke; @@ -85,7 +85,7 @@ namespace Mod::Etc::Misc } auto playerOwner = ToTFPlayer(owner); SCOPED_INCREMENT_IF(rc_DoNotOverrideSmoke, playerOwner != nullptr && FindCaseInsensitive(playerOwner->GetPlayerName(), "smoke") != nullptr); - DETOUR_MEMBER_CALL(CTFBaseRocket_Explode)(pTrace, pOther); + DETOUR_MEMBER_CALL(pTrace, pOther); sentry_attacker_rocket = nullptr; } @@ -95,7 +95,7 @@ namespace Mod::Etc::Misc info.m_DmgInfo->SetAttacker(sentry_attacker_rocket); sentry_attacker_rocket = nullptr; } - DETOUR_MEMBER_CALL(CTFGameRules_RadiusDamage)(info); + DETOUR_MEMBER_CALL(info); } RefCount rc_SendProxy_PlayerObjectList; @@ -115,13 +115,13 @@ namespace Mod::Etc::Misc } } } - DETOUR_STATIC_CALL(SendProxy_PlayerObjectList)(pProp, pStruct, pData, pOut, iElement, objectID); + DETOUR_STATIC_CALL(pProp, pStruct, pData, pOut, iElement, objectID); } RefCount rc_SendProxyArrayLength_PlayerObjects; DETOUR_DECL_STATIC(int, SendProxyArrayLength_PlayerObjects, const void *pStruct, int objectID) { - int count = DETOUR_STATIC_CALL(SendProxyArrayLength_PlayerObjects)(pStruct, objectID); + int count = DETOUR_STATIC_CALL(pStruct, objectID); CTFPlayer *player = (CTFPlayer *)(pStruct); bool firstminisentry = true; for (int i = 0; i < count; i++) { @@ -163,12 +163,12 @@ namespace Mod::Etc::Misc player->GetObject(minanimtimeid)->DetonateObject(); } } - DETOUR_MEMBER_CALL(CTFPlayer_StartBuildingObjectOfType)(type, mode); + DETOUR_MEMBER_CALL(type, mode); } DETOUR_DECL_MEMBER(void, CCaptureFlag_Drop, CTFPlayer *pPlayer, bool bVisible, bool bThrown, bool bMessage) { - DETOUR_MEMBER_CALL(CCaptureFlag_Drop)(pPlayer, bVisible, bThrown, bMessage); + DETOUR_MEMBER_CALL(pPlayer, bVisible, bThrown, bMessage); auto flag = reinterpret_cast(this); if ( TFGameRules()->IsMannVsMachineMode() ) { @@ -193,12 +193,12 @@ namespace Mod::Etc::Misc if (weapon != nullptr) { weapon->RemoveEffects(EF_NODRAW); } - DETOUR_MEMBER_CALL(CTFPlayerShared_OnRemoveStunned)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveAllWeapons) { - DETOUR_MEMBER_CALL(CTFPlayer_RemoveAllWeapons)(); + DETOUR_MEMBER_CALL(); auto player = reinterpret_cast(this); player->ClearDisguiseWeaponList(); if (player->m_Shared->m_hDisguiseWeapon != nullptr) { @@ -212,13 +212,13 @@ namespace Mod::Etc::Misc if (collisionGroup == COLLISION_GROUP_PLAYER_MOVEMENT) { return false; } - return VHOOK_CALL(CZombie_ShouldCollide)(collisionGroup,contentsMask ); + return VHOOK_CALL(collisionGroup,contentsMask ); } DETOUR_DECL_MEMBER(void, CTFPlayer_Event_Killed, const CTakeDamageInfo& info) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); if (player->m_hObserverTarget != nullptr && !player->IsBot()) { ForEachEntityByClassname("ambient_generic", [&](CBaseEntity *pEnt){ auto ambient = static_cast(pEnt); @@ -334,7 +334,7 @@ namespace Mod::Etc::Misc closedir(dir); } } - DETOUR_STATIC_CALL(Script_StringToFile)(filename, string); + DETOUR_STATIC_CALL(filename, string); } class CMod_ScriptSaveLimit : public IMod @@ -359,7 +359,7 @@ namespace Mod::Etc::Misc auto proj = reinterpret_cast(this); auto thrower = ToTFPlayer(proj->GetThrower()); SCOPED_INCREMENT_IF(rc_DoNotOverrideSmoke, thrower != nullptr && FindCaseInsensitive(thrower->GetPlayerName(), "smoke") != nullptr); - DETOUR_MEMBER_CALL(CTFWeaponBaseGrenadeProj_Explode)(pTrace, bitsDamageType); + DETOUR_MEMBER_CALL(pTrace, bitsDamageType); } DETOUR_DECL_STATIC(void, DispatchParticleEffect, char const *name, Vector vec, QAngle ang, CBaseEntity *entity) @@ -367,7 +367,7 @@ namespace Mod::Etc::Misc if (!rc_DoNotOverrideSmoke && strcmp(name, "fluidSmokeExpl_ring_mvm") == 0) { name = "hightower_explosion"; } - DETOUR_STATIC_CALL(DispatchParticleEffect)(name, vec, ang, entity); + DETOUR_STATIC_CALL(name, vec, ang, entity); } class CMod_SentryBusterParticleChange : public IMod @@ -405,7 +405,7 @@ namespace Mod::Etc::Misc g_pMonsterResource->m_iBossHealthPercentageByte = (int) (healthPercentage * 255.0f); } } - return DETOUR_MEMBER_CALL(CHeadlessHatman_OnTakeDamage_Alive)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CHeadlessHatman_Spawn) @@ -416,7 +416,7 @@ namespace Mod::Etc::Misc { g_pMonsterResource->m_iBossHealthPercentageByte = 255; } - DETOUR_MEMBER_CALL(CHeadlessHatman_Spawn)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CHeadlessHatman_D2) @@ -426,7 +426,7 @@ namespace Mod::Etc::Misc { g_pMonsterResource->m_iBossHealthPercentageByte = 0; } - DETOUR_MEMBER_CALL(CHeadlessHatman_D2)(); + DETOUR_MEMBER_CALL(); } class CMod_HHHHealthBar : public IMod diff --git a/src/mod/etc/override_move_speed.cpp b/src/mod/etc/override_move_speed.cpp index d1cc6376..11825059 100644 --- a/src/mod/etc/override_move_speed.cpp +++ b/src/mod/etc/override_move_speed.cpp @@ -98,7 +98,7 @@ namespace Mod::Etc::Override_Move_Speed CMoveData_Set_MaxSpeed(pMove, cvar_limit.GetFloat()); } - DETOUR_MEMBER_CALL(CTFGameMovement_ProcessMovement)(pBasePlayer, pMove); + DETOUR_MEMBER_CALL(pBasePlayer, pMove); } DETOUR_DECL_MEMBER(void, CTFGameMovement_ProcessMovement_client, CBasePlayer *pBasePlayer, CMoveData *pMove) @@ -107,7 +107,7 @@ namespace Mod::Etc::Override_Move_Speed CMoveData_Set_MaxSpeed(pMove, cvar_limit.GetFloat()); } - DETOUR_MEMBER_CALL(CTFGameMovement_ProcessMovement_client)(pBasePlayer, pMove); + DETOUR_MEMBER_CALL(pBasePlayer, pMove); } diff --git a/src/mod/etc/player_bullet_boundingbox_fix.cpp b/src/mod/etc/player_bullet_boundingbox_fix.cpp index b63036a3..bb3ba78e 100644 --- a/src/mod/etc/player_bullet_boundingbox_fix.cpp +++ b/src/mod/etc/player_bullet_boundingbox_fix.cpp @@ -28,7 +28,7 @@ namespace Mod::Etc::Player_Bullet_Bounding_Fix } }); - DETOUR_STATIC_CALL(FX_FireBullets)(pWpn, iPlayer, vecOrigin, vecAngles, iWeapon, iMode, iSeed, flSpread, flDamage, bCritical); + DETOUR_STATIC_CALL(pWpn, iPlayer, vecOrigin, vecAngles, iWeapon, iMode, iSeed, flSpread, flDamage, bCritical); for (CBasePlayer *playerl : player_vec) { playerl->CollisionProp()->SetSurroundingBoundsType(USE_SPECIFIED_BOUNDS, &VEC_HULL_MIN, &VEC_HULL_MAX); diff --git a/src/mod/etc/ratelimit_exclude.cpp b/src/mod/etc/ratelimit_exclude.cpp index 7f4c48e1..ddff8986 100644 --- a/src/mod/etc/ratelimit_exclude.cpp +++ b/src/mod/etc/ratelimit_exclude.cpp @@ -30,7 +30,7 @@ namespace Mod::Etc::RateLimit_Exclude if (V_stricmp(pszCommand, str.c_str()) == 0) return true; } - return DETOUR_MEMBER_CALL(CBaseMultiplayerPlayer_ShouldRunRateLimitedCommand)(pszCommand); + return DETOUR_MEMBER_CALL(pszCommand); } diff --git a/src/mod/etc/sendprop_override.cpp b/src/mod/etc/sendprop_override.cpp index 2126843f..2f57ab36 100644 --- a/src/mod/etc/sendprop_override.cpp +++ b/src/mod/etc/sendprop_override.cpp @@ -161,7 +161,7 @@ namespace Mod::Etc::SendProp_Override WriteOverride(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); return; } - DETOUR_STATIC_CALL(SendTable_WritePropList)(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); + DETOUR_STATIC_CALL(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); } int CheckOverridePropIndex(int *pDeltaProps, int nDeltaProps, const int objectID) @@ -211,7 +211,7 @@ namespace Mod::Etc::SendProp_Override const int objectID ) { - int count = DETOUR_STATIC_CALL(SendTable_CalcDelta)(pTable, pFromState, nFromBits, pToState, nToBits, pDeltaProps, nMaxDeltaProps, objectID); + int count = DETOUR_STATIC_CALL(pTable, pFromState, nFromBits, pToState, nToBits, pDeltaProps, nMaxDeltaProps, objectID); if (client_num != 0 && objectID >= 0 && objectID < 2048 && entityHasOverride[objectID]) { return CheckOverridePropIndex(pDeltaProps, count, objectID); } @@ -242,7 +242,7 @@ namespace Mod::Etc::SendProp_Override { client_num = client->m_nEntityIndex; - DETOUR_MEMBER_CALL(CBaseServer_WriteDeltaEntities)(client, to, from, pBuf); + DETOUR_MEMBER_CALL(client, to, from, pBuf); client_num = 0; } @@ -278,7 +278,7 @@ namespace Mod::Etc::SendProp_Override writeInfo = u; u->m_pOldPack = nullptr; } - DETOUR_STATIC_CALL(SV_DetermineUpdateType)(u); + DETOUR_STATIC_CALL(u); if (hasOverride) { u->m_pOldPack = preOldPack; writeInfo = nullptr; @@ -288,7 +288,7 @@ namespace Mod::Etc::SendProp_Override DETOUR_DECL_MEMBER(int, PackedEntity_GetPropsChangedAfterTick, int tick, int *iOutProps, int nMaxOutProps) { auto pack = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(PackedEntity_GetPropsChangedAfterTick)(tick, iOutProps, nMaxOutProps); + auto result = DETOUR_MEMBER_CALL(tick, iOutProps, nMaxOutProps); if (entityHasOverride[pack->m_nEntityIndex] && writeInfo != nullptr) { writeInfo->m_pOldPack = preOldPack; return CheckOverridePropIndex(iOutProps, result, pack->m_nEntityIndex); @@ -298,7 +298,7 @@ namespace Mod::Etc::SendProp_Override DETOUR_DECL_MEMBER(void, CGameServer_SendClientMessages, bool sendSnapshots) { - DETOUR_MEMBER_CALL(CGameServer_SendClientMessages)(sendSnapshots); + DETOUR_MEMBER_CALL(sendSnapshots); for (auto mod : AutoList::List()) { for (auto it = mod->propOverrides.begin(); it != mod->propOverrides.end();) { auto &overr = *it; diff --git a/src/mod/etc/sendprop_override_extension.cpp b/src/mod/etc/sendprop_override_extension.cpp index 7350cd24..5e6a84a9 100644 --- a/src/mod/etc/sendprop_override_extension.cpp +++ b/src/mod/etc/sendprop_override_extension.cpp @@ -560,7 +560,7 @@ namespace Mod::Etc::SendProp_Override_Extension } } } - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); for (auto &plCallback : callbacks) { if (plCallback.isPerClient) { if (plCallback.valueSet) { diff --git a/src/mod/etc/server_allow_wait_command.cpp b/src/mod/etc/server_allow_wait_command.cpp index 45c9b00c..ae5e5db3 100644 --- a/src/mod/etc/server_allow_wait_command.cpp +++ b/src/mod/etc/server_allow_wait_command.cpp @@ -11,7 +11,7 @@ namespace Mod::Etc::Server_Allow_Wait_Command DETOUR_DECL_MEMBER(bool, CCommandBuffer_AddText, const char *pText, int nTickDelay ) { reinterpret_cast(this)->SetWaitEnabled(true); - return DETOUR_MEMBER_CALL(CCommandBuffer_AddText)(pText, nTickDelay); + return DETOUR_MEMBER_CALL(pText, nTickDelay); } class CMod : public IMod diff --git a/src/mod/etc/spectator_vote_fix.cpp b/src/mod/etc/spectator_vote_fix.cpp index 3718b23f..3a0e1b3d 100644 --- a/src/mod/etc/spectator_vote_fix.cpp +++ b/src/mod/etc/spectator_vote_fix.cpp @@ -11,7 +11,7 @@ namespace Mod::MvM::Spectator_Vote_Fix if (sv_vote_allow_spectators.GetBool() && player != nullptr && player->GetTeamNumber() <= TEAM_SPECTATOR) { return 3; } - auto result = DETOUR_MEMBER_CALL(CVoteController_TryCastVote)(index, issue); + auto result = DETOUR_MEMBER_CALL(index, issue); return result; } diff --git a/src/mod/etc/suppress_nb_event_messages.cpp b/src/mod/etc/suppress_nb_event_messages.cpp index d3e6425f..807760f9 100644 --- a/src/mod/etc/suppress_nb_event_messages.cpp +++ b/src/mod/etc/suppress_nb_event_messages.cpp @@ -14,7 +14,7 @@ namespace Mod::Etc::Suppress_NB_Event_Messages return SPEW_CONTINUE; } - return DETOUR_STATIC_CALL(D__SpewMessage)(spewType, pGroupName, nLevel, pColor, pMsgFormat, args); + return DETOUR_STATIC_CALL(spewType, pGroupName, nLevel, pColor, pMsgFormat, args); } diff --git a/src/mod/etc/trigger_filter_fix.cpp b/src/mod/etc/trigger_filter_fix.cpp index 6189e01a..49388b99 100644 --- a/src/mod/etc/trigger_filter_fix.cpp +++ b/src/mod/etc/trigger_filter_fix.cpp @@ -13,7 +13,7 @@ namespace Mod::Etc::Trigger_Filter_Fix return;// false; } - DETOUR_MEMBER_CALL(CBaseTrigger_InputStartTouch)(data); + DETOUR_MEMBER_CALL(data); } DETOUR_DECL_MEMBER(void, CBaseTrigger_InputEndTouch, inputdata_t &data) @@ -24,7 +24,7 @@ namespace Mod::Etc::Trigger_Filter_Fix return;// false; } - DETOUR_MEMBER_CALL(CBaseTrigger_InputEndTouch)(data); + DETOUR_MEMBER_CALL(data); } DETOUR_DECL_MEMBER(void, CBaseFilter_InputTestActivator, inputdata_t &data) @@ -35,7 +35,7 @@ namespace Mod::Etc::Trigger_Filter_Fix return; } - DETOUR_MEMBER_CALL(CBaseFilter_InputTestActivator)(data); + DETOUR_MEMBER_CALL(data); } DETOUR_DECL_MEMBER(void, CGameUI_Deactivate, CBaseEntity *pActivator) @@ -48,7 +48,7 @@ namespace Mod::Etc::Trigger_Filter_Fix pActivator = UTIL_EntityByIndex(0); } - DETOUR_MEMBER_CALL(CGameUI_Deactivate)(pActivator); + DETOUR_MEMBER_CALL(pActivator); } class CMod : public IMod diff --git a/src/mod/etc/unintended_class_weapon_improvements.cpp b/src/mod/etc/unintended_class_weapon_improvements.cpp index 2c19e9e8..72f43d47 100644 --- a/src/mod/etc/unintended_class_weapon_improvements.cpp +++ b/src/mod/etc/unintended_class_weapon_improvements.cpp @@ -161,7 +161,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements } } - DETOUR_MEMBER_CALL(CTFPlayerClassShared_SetCustomModel)(s1, b1); + DETOUR_MEMBER_CALL(s1, b1); } bool OnUnequipUnintendedClassWeapon(CTFPlayer *owner, CTFWeaponBase *weapon, UnintendedClassViewmodelOverride *mod) @@ -199,7 +199,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements DETOUR_DECL_MEMBER(void, CTFWeaponBase_UpdateHands) { - DETOUR_MEMBER_CALL(CTFWeaponBase_UpdateHands)(); + DETOUR_MEMBER_CALL(); auto ent = reinterpret_cast(this); auto weapon = rtti_cast(ent); @@ -317,14 +317,14 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements #ifndef NO_MVM Mod::Pop::PopMgr_Extensions::DisableLoadoutSlotReplace(false); #endif - DETOUR_MEMBER_CALL(CTFWearable_Equip)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_Deploy) { auto wep = reinterpret_cast(this); auto mod = wep->GetEntityModule("unintendedclassweapon"); - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_Deploy)(); + auto result = DETOUR_MEMBER_CALL(); if (result && mod != nullptr && wep->GetTFPlayerOwner() != nullptr) { OnEquipUnintendedClassWeapon(wep->GetTFPlayerOwner(), wep, mod); @@ -337,7 +337,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements auto weapon = reinterpret_cast(this); auto mod = weapon->GetEntityModule("unintendedclassweapon"); - auto result = DETOUR_MEMBER_CALL(CTFWeaponBase_Holster)(); + auto result = DETOUR_MEMBER_CALL(); if (result && mod != nullptr && weapon->GetTFPlayerOwner() != nullptr) { OnUnequipUnintendedClassWeapon(weapon->GetTFPlayerOwner(), weapon, mod); @@ -356,7 +356,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements if (player != nullptr && ammoMod) { mult = player->GetMaxAmmo(weapon->m_iPrimaryAmmoType) != 0 ? (float)player->GetAmmoCount(weapon->m_iPrimaryAmmoType) / (float)player->GetMaxAmmo(weapon->m_iPrimaryAmmoType) : 0.0f; } - auto result = DETOUR_MEMBER_CALL(CBaseCombatCharacter_Weapon_Detach)(weapon); + auto result = DETOUR_MEMBER_CALL(weapon); if (ammoMod != nullptr) { weapon->RemoveEntityModule("playermaxammo"); @@ -377,13 +377,13 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements if (mod != nullptr && weapon != nullptr && mod->owner != nullptr) { OnUnequipUnintendedClassWeapon(mod->owner, weapon, mod); } - DETOUR_MEMBER_CALL(CEconEntity_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_Taunt, taunts_t index, int taunt_concept) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Taunt)(index, taunt_concept); + DETOUR_MEMBER_CALL(index, taunt_concept); int playerClass = player->GetPlayerClass()->GetClassIndex(); if (!player->m_Shared->InCond(TF_COND_TAUNTING) && player->GetActiveTFWeapon() != nullptr && player->GetActiveTFWeapon()->GetItem() != nullptr && player->GetActiveTFWeapon()->GetItem()->GetItemDefinition()->GetLoadoutSlot(playerClass) == -1) { int validClass = -1; @@ -396,7 +396,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements if (validClass != -1) { auto oldClass = player->GetPlayerClass()->GetClassIndex(); player->GetPlayerClass()->SetClassIndex(validClass); - DETOUR_MEMBER_CALL(CTFPlayer_Taunt)(index, taunt_concept); + DETOUR_MEMBER_CALL(index, taunt_concept); player->GetPlayerClass()->SetClassIndex(oldClass); } // for (int i = 0; i < 48; i++) { @@ -405,7 +405,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements // auto oldActiveWeapon = player->GetActiveTFWeapon(); // player->SetActiveWeapon(weapon); // Msg("This\n"); - // DETOUR_MEMBER_CALL(CTFPlayer_Taunt)(index, taunt_concept); + // DETOUR_MEMBER_CALL(index, taunt_concept); // player->SetActiveWeapon(oldActiveWeapon); // break; // } @@ -430,7 +430,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements DETOUR_DECL_MEMBER(void, CTFWeaponBaseMelee_SecondaryAttack) { auto weapon = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); auto owner = weapon->GetTFPlayerOwner(); if (owner != nullptr && owner->m_Shared->InCond(TF_COND_STEALTHED)) { owner->DoClassSpecialSkill(); @@ -441,7 +441,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements { auto player = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFPlayer_DoClassSpecialSkill)(); + auto result = DETOUR_MEMBER_CALL(); if (!player->IsAlive()) return result; @@ -476,7 +476,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements auto playerClass = player->GetOuter()->GetPlayerClass(); int classPre = playerClass->GetClassIndex(); playerClass->SetClassIndex(TF_CLASS_DEMOMAN); - DETOUR_MEMBER_CALL(CTFPlayerShared_UpdateChargeMeter)(); + DETOUR_MEMBER_CALL(); playerClass->SetClassIndex(classPre); } @@ -484,12 +484,12 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements { auto player = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFPlayer_EndClassSpecialSkill)(); + auto result = DETOUR_MEMBER_CALL(); if (result && player->GetPlayerClass()->GetClassIndex() != TF_CLASS_DEMOMAN) { int classPre = player->GetPlayerClass()->GetClassIndex(); player->GetPlayerClass()->SetClassIndex(TF_CLASS_DEMOMAN); - result = DETOUR_MEMBER_CALL(CTFPlayer_EndClassSpecialSkill)(); + result = DETOUR_MEMBER_CALL(); player->GetPlayerClass()->SetClassIndex(classPre); } return result; @@ -505,7 +505,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements player->GetPlayerClass()->SetClassIndex(TF_CLASS_DEMOMAN); } - float ret = DETOUR_MEMBER_CALL(CTFPlayer_TeamFortress_CalculateMaxSpeed)(flag); + float ret = DETOUR_MEMBER_CALL(flag); if (player->GetPlayerClass()->GetClassIndex() != TF_CLASS_SCOUT && player->Weapon_OwnsThisID(TF_WEAPON_PEP_BRAWLER_BLASTER)) { ret *= RemapValClamped( player->m_Shared->m_flHypeMeter, 0.0f, 100.0f, 1.0f, 1.45f ); @@ -526,7 +526,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements DETOUR_DECL_MEMBER(int, CTFPlayer_GetMaxHealthForBuffing) { - int ret = DETOUR_MEMBER_CALL(CTFPlayer_GetMaxHealthForBuffing)(); + int ret = DETOUR_MEMBER_CALL(); auto player = reinterpret_cast(this); if (player->GetPlayerClass()->GetClassIndex() != TF_CLASS_DEMOMAN) { auto sword = rtti_cast(player->GetEntityForLoadoutSlot(LOADOUT_POSITION_MELEE)); @@ -540,7 +540,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements DETOUR_DECL_MEMBER(void, CTFMinigun_SecondaryAttack) { auto player = reinterpret_cast(this)->GetTFPlayerOwner(); - DETOUR_MEMBER_CALL(CTFMinigun_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); ActivateShield(player); } @@ -548,7 +548,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements { auto player = reinterpret_cast(this)->GetTFPlayerOwner(); if (!ActivateShield(player)) { - DETOUR_MEMBER_CALL(CTFFists_SecondaryAttack)(); + DETOUR_MEMBER_CALL(); } } @@ -562,7 +562,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements break; } } - DETOUR_MEMBER_CALL(CTFFists_Punch)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(bool, ClassCanBuild, int classIndex, int type) @@ -574,7 +574,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements { if ((type < 0 || type >= OBJ_LAST) && type != 255) return; - DETOUR_MEMBER_CALL(CTFWeaponBuilder_SetSubType)(type); + DETOUR_MEMBER_CALL(type); } DETOUR_DECL_MEMBER(void, CTFPlayer_ManageBuilderWeapons, TFPlayerClassData_t *pData) @@ -585,7 +585,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements if (classIndex != TF_CLASS_ENGINEER && classIndex != TF_CLASS_SPY) return; - DETOUR_MEMBER_CALL(CTFPlayer_ManageBuilderWeapons)(pData); + DETOUR_MEMBER_CALL(pData); } THINK_FUNC_DECL(SetTypeToSapper) @@ -623,12 +623,12 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements } VHOOK_DECL(void, CTFWeaponBuilder_Equip, CBaseCombatCharacter *owner) { - VHOOK_CALL(CTFWeaponBuilder_Equip)(owner); + VHOOK_CALL(owner); THINK_FUNC_SET(reinterpret_cast(this), SetBuildableObjectTypes, gpGlobals->curtime); } VHOOK_DECL(void, CTFWeaponSapper_Equip, CBaseCombatCharacter *owner) { - VHOOK_CALL(CTFWeaponSapper_Equip)(owner); + VHOOK_CALL(owner); THINK_FUNC_SET(reinterpret_cast(this), SetBuildableObjectTypes, gpGlobals->curtime); } @@ -672,7 +672,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_ClientCommand)(args); + return DETOUR_MEMBER_CALL(args); } DETOUR_DECL_MEMBER(int, CTFItemDefinition_GetLoadoutSlot, int classIndex) @@ -680,13 +680,13 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements auto item_def = reinterpret_cast(this); if (classIndex == TF_CLASS_UNDEFINED && StringStartsWith(item_def->GetItemClass(), "tf_weapon_revolver")) return LOADOUT_POSITION_PRIMARY; - return DETOUR_MEMBER_CALL(CTFItemDefinition_GetLoadoutSlot)(classIndex); + return DETOUR_MEMBER_CALL(classIndex); } DETOUR_DECL_STATIC(void, HandleRageGain, CTFPlayer *pPlayer, unsigned int iRequiredBuffFlags, float flDamage, float fInverseRageGainScale) { if (pPlayer == nullptr) { - DETOUR_STATIC_CALL(HandleRageGain)(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); + DETOUR_STATIC_CALL(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); return; } @@ -720,7 +720,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements restoreClass = classIndex; } } - DETOUR_STATIC_CALL(HandleRageGain)(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); + DETOUR_STATIC_CALL(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); if (restoreClass != -1) { pPlayer->GetPlayerClass()->SetClassIndex(restoreClass); } @@ -735,7 +735,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements restoreClass = player->GetPlayerClass()->GetClassIndex(); player->GetPlayerClass()->SetClassIndex(TF_CLASS_SCOUT); } - DETOUR_MEMBER_CALL(CTFPlayerShared_UpdateEnergyDrinkMeter)(); + DETOUR_MEMBER_CALL(); if (restoreClass != -1) { player->GetPlayerClass()->SetClassIndex(restoreClass); } @@ -765,12 +765,12 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements } } } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } DETOUR_DECL_MEMBER(bool, CTFPlayer_CanAirDash) { - bool ret = DETOUR_MEMBER_CALL(CTFPlayer_CanAirDash)(); + bool ret = DETOUR_MEMBER_CALL(); if (!ret) { auto player = reinterpret_cast(this); if (!player->IsPlayerClass(TF_CLASS_SCOUT) && player->m_Shared->InCond(TF_COND_SODAPOPPER_HYPE)) { @@ -782,7 +782,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements DETOUR_DECL_MEMBER(int, CTFPlayer_OnTakeDamage, CTakeDamageInfo &info) { - int damage = DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(info); + int damage = DETOUR_MEMBER_CALL(info); auto player = reinterpret_cast(this); if (player->GetPlayerClass()->GetClassIndex() != TF_CLASS_SCOUT) { @@ -817,7 +817,7 @@ namespace Mod::Etc::Unintended_Class_Weapon_Improvements } } } - auto ret = DETOUR_MEMBER_CALL(CTFPlayer_GetMaxAmmo)(ammoIndex, classIndex); + auto ret = DETOUR_MEMBER_CALL(ammoIndex, classIndex); if (restore) { GetPlayerClassData(classIndex > 0 ? classIndex : player->GetPlayerClass()->GetClassIndex())->m_aAmmoMax[ammoIndex] = valueRestore; } diff --git a/src/mod/etc/vehicle_fix.cpp b/src/mod/etc/vehicle_fix.cpp index 8132a84c..a1de7238 100644 --- a/src/mod/etc/vehicle_fix.cpp +++ b/src/mod/etc/vehicle_fix.cpp @@ -96,7 +96,7 @@ namespace Mod::Util::Vehicle_Fix vehicle->m_nVehicleType = 8; } } - DETOUR_MEMBER_CALL(CPropVehicleDriveable_Spawn)(); + DETOUR_MEMBER_CALL(); vehicle->SetCollisionGroup(COLLISION_GROUP_PLAYER_MOVEMENT); THINK_FUNC_SET(vehicle, CarThink, gpGlobals->curtime + 0.01); } @@ -114,7 +114,7 @@ namespace Mod::Util::Vehicle_Fix serverVehicle->SetupMove(player, ucmd, pHelper, move); } } - DETOUR_MEMBER_CALL(CPlayerMove_SetupMove)(player, ucmd, pHelper, move); + DETOUR_MEMBER_CALL(player, ucmd, pHelper, move); } DETOUR_DECL_MEMBER(int, CBaseServerVehicle_GetExitAnimToUse, Vector *vec, bool far) @@ -126,7 +126,7 @@ namespace Mod::Util::Vehicle_Fix { if (pActivator != nullptr && pActivator == reinterpret_cast(this)->m_hPlayer) return; - DETOUR_MEMBER_CALL(CPropVehicleDriveable_Use)(pActivator, pCaller, useType, value); + DETOUR_MEMBER_CALL(pActivator, pCaller, useType, value); } DETOUR_DECL_MEMBER(VoiceCommandMenuItem_t *, CMultiplayRules_VoiceCommand, CBasePlayer* player, int menu, int item) @@ -152,7 +152,7 @@ namespace Mod::Util::Vehicle_Fix } - return DETOUR_MEMBER_CALL(CMultiplayRules_VoiceCommand)(player, menu, item); + return DETOUR_MEMBER_CALL(player, menu, item); } @@ -162,7 +162,7 @@ namespace Mod::Util::Vehicle_Fix DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CBasePlayer_GetInVehicle, CBaseServerVehicle *vehicle, int mode) { auto player = reinterpret_cast(this); - auto ret = DETOUR_MEMBER_CALL(CBasePlayer_GetInVehicle)(vehicle, mode); + auto ret = DETOUR_MEMBER_CALL(vehicle, mode); if (ret) { if (player->m_hVehicle != nullptr) { player->m_Local->m_bDrawViewmodel = player->m_hVehicle->GetCustomVariableFloat<"allowweapons">(); @@ -209,7 +209,7 @@ namespace Mod::Util::Vehicle_Fix player->GetActiveTFWeapon()->SetEffects(player->GetActiveTFWeapon()->GetEffects() & ~(EF_NODRAW)); } } - DETOUR_MEMBER_CALL(CBasePlayer_LeaveVehicle)(pos, angles); + DETOUR_MEMBER_CALL(pos, angles); player->m_Local->m_bDrawViewmodel = true; static ConVarRef predict("sv_client_predict"); @@ -219,7 +219,7 @@ namespace Mod::Util::Vehicle_Fix VHOOK_DECL(unsigned int, CPropVehicleDriveable_PhysicsSolidMaskForEntity) { auto vehicle = reinterpret_cast(this); - auto mask = VHOOK_CALL(CBaseEntity_PhysicsSolidMaskForEntity)() | CONTENTS_PLAYERCLIP; + auto mask = VHOOK_CALL() | CONTENTS_PLAYERCLIP; if (vehicle->GetTeamNumber() == TF_TEAM_BLUE) mask |= CONTENTS_REDTEAM; else if (vehicle->GetTeamNumber() == TF_TEAM_RED) @@ -244,7 +244,7 @@ namespace Mod::Util::Vehicle_Fix info2.SetDamage(info2.GetDamage() * vehicle->GetCustomVariableFloat<"passbulletdamage">(1.0f)); return vehicle->m_hPlayer->TakeDamage(info2); } - return VHOOK_CALL(CPropVehicleDriveable_OnTakeDamage)(info); + return VHOOK_CALL(info); } @@ -254,7 +254,7 @@ namespace Mod::Util::Vehicle_Fix if (vehicle->m_hPlayer != nullptr) { vehicle->m_hPlayer->LeaveVehicle(); } - return VHOOK_CALL(CPropVehicleDriveable_UpdateOnRemove)(); + return VHOOK_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_ForceRespawn) @@ -263,7 +263,7 @@ namespace Mod::Util::Vehicle_Fix if (player->m_hVehicle != nullptr) { player->LeaveVehicle(); } - return DETOUR_MEMBER_CALL(CTFPlayer_ForceRespawn)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CBaseServerVehicle_IsPassengerVisible, int role) @@ -281,7 +281,7 @@ namespace Mod::Util::Vehicle_Fix DETOUR_DECL_MEMBER(void, CTFWeaponBaseGun_UpdatePunchAngles, CTFPlayer *player) { if (player->m_hVehicle == nullptr) - DETOUR_MEMBER_CALL(CTFWeaponBaseGun_UpdatePunchAngles)(player); + DETOUR_MEMBER_CALL(player); } // Prevent driver's rockets from colliding with the vehicle @@ -294,13 +294,13 @@ namespace Mod::Util::Vehicle_Fix } DETOUR_DECL_MEMBER(void, CTFBaseProjectile_Spawn) { - DETOUR_MEMBER_CALL(CTFBaseProjectile_Spawn)(); + DETOUR_MEMBER_CALL(); SetOwnerToVehicle(reinterpret_cast(this)); } DETOUR_DECL_MEMBER(void, CTFProjectile_Arrow_Spawn) { - DETOUR_MEMBER_CALL(CTFProjectile_Arrow_Spawn)(); + DETOUR_MEMBER_CALL(); SetOwnerToVehicle(reinterpret_cast(this)); } @@ -320,14 +320,14 @@ namespace Mod::Util::Vehicle_Fix //DevMsg("Angles %f %f %f %f\n", angles.x, player->m_hVehicle->GetAbsAngles().x, player->m_hVehicle->GetAbsAngles().y, player->m_hVehicle->GetAbsAngles().z); //angles.x += player->m_hVehicle->GetAbsAngles().z + 0.5; } - return DETOUR_MEMBER_CALL(CBasePlayer_EyeAngles)(); + return DETOUR_MEMBER_CALL(); } /*DETOUR_DECL_MEMBER(unsigned int, CTFBaseProjectile_PhysicsSolidMaskForEntity) { auto owner = ToTFPlayer(reinterpret_cast(this)->GetOwnerEntity()); if (owner != nullptr && owner->m_hVehicle != nullptr) { - return DETOUR_MEMBER_CALL(CTFBaseProjectile_PhysicsSolidMaskForEntity)() | CON; + return DETOUR_MEMBER_CALL() | CON; } }*/ @@ -339,7 +339,7 @@ namespace Mod::Util::Vehicle_Fix if (player != nullptr && player->m_hVehicle != nullptr) { g_RecipientFilterPredictionSystem.GetRef().m_pSuppressHost = nullptr; } - DETOUR_MEMBER_CALL(CTFWeaponBase_PrimaryAttack)(); + DETOUR_MEMBER_CALL(); g_RecipientFilterPredictionSystem.GetRef().m_pSuppressHost = oldHost; } @@ -365,13 +365,13 @@ namespace Mod::Util::Vehicle_Fix } } //info2.SetDamageType(info2.GetDamageType() | DMG_PHYSGUN); - DETOUR_MEMBER_CALL(CPropVehicleDriveable_TraceAttack)(info2, vecDir, ptr, pAccumulator); + DETOUR_MEMBER_CALL(info2, vecDir, ptr, pAccumulator); } DETOUR_DECL_MEMBER(void, CPropVehicleDriveable_DriveVehicle, float flFrameTime, CUserCmd *ucmd, int iButtonsDown, int iButtonsReleased) { - DETOUR_MEMBER_CALL(CPropVehicleDriveable_DriveVehicle)(flFrameTime, ucmd, iButtonsDown, iButtonsReleased); + DETOUR_MEMBER_CALL(flFrameTime, ucmd, iButtonsDown, iButtonsReleased); auto vehicle = reinterpret_cast(this); variant_t variant; if (iButtonsReleased & IN_ATTACK) { @@ -422,7 +422,7 @@ namespace Mod::Util::Vehicle_Fix DETOUR_DECL_STATIC(float, CalculatePhysicsImpactDamage, int index, gamevcollisionevent_t *pEvent, void *table, float energyScale, bool allowStaticDamage, int &damageTypeOut, bool bDamageFromHeldObjects) { - auto damage = DETOUR_STATIC_CALL(CalculatePhysicsImpactDamage)(index, pEvent, table, energyScale, allowStaticDamage, damageTypeOut, bDamageFromHeldObjects); + auto damage = DETOUR_STATIC_CALL(index, pEvent, table, energyScale, allowStaticDamage, damageTypeOut, bDamageFromHeldObjects); if (pEvent->pEntities[0] != nullptr) { damage *= pEvent->pEntities[0]->GetCustomVariableFloat<"impactdamagemult">(1.0f); } @@ -439,7 +439,7 @@ namespace Mod::Util::Vehicle_Fix if (character->IsPlayer()/* && character->VPhysicsGetObject() != nullptr && !character->VPhysicsGetObject()->IsMoveable()*/) { return 0; } - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_CalculatePhysicsStressDamage)(stress, obj); + return DETOUR_MEMBER_CALL(stress, obj); } THINK_FUNC_DECL(ApplyImmobile) @@ -452,7 +452,7 @@ namespace Mod::Util::Vehicle_Fix DETOUR_DECL_MEMBER(void, CTFGameRules_OnPlayerSpawned, CTFPlayer *player) { THINK_FUNC_SET(player, ApplyImmobile, gpGlobals->curtime+0.01f); - DETOUR_MEMBER_CALL(CTFGameRules_OnPlayerSpawned)(player); + DETOUR_MEMBER_CALL(player); } DETOUR_DECL_STATIC(void, SV_ComputeClientPacks, int clientCount, void **clients, void *snapshot) @@ -467,7 +467,7 @@ namespace Mod::Util::Vehicle_Fix } }); - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); ForEachTFPlayer([](CTFPlayer *player) { if (player->m_hVehicle != nullptr && player->m_hVehicle->GetCustomVariableFloat<"playermodellookforward">(1.0f)) { QAngle ang = player->m_angEyeAngles; @@ -486,7 +486,7 @@ namespace Mod::Util::Vehicle_Fix if (owner != nullptr && owner->m_hVehicle != nullptr) { g_RecipientFilterPredictionSystem.GetRef().m_pSuppressHost = nullptr; } - DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); + DETOUR_MEMBER_CALL(index, soundtime); g_RecipientFilterPredictionSystem.GetRef().m_pSuppressHost = oldHost; } @@ -495,7 +495,7 @@ namespace Mod::Util::Vehicle_Fix if (rtti_cast(pOther) != nullptr) { return; } - DETOUR_MEMBER_CALL(CTFProjectile_EnergyRing_ProjectileTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } VHOOK_DECL(bool, CPropVehicleDriveable_IsCombatItem) diff --git a/src/mod/etc/weapon_mimic_teamnum.cpp b/src/mod/etc/weapon_mimic_teamnum.cpp index ed238ee6..63e2729e 100644 --- a/src/mod/etc/weapon_mimic_teamnum.cpp +++ b/src/mod/etc/weapon_mimic_teamnum.cpp @@ -100,7 +100,7 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum dmgInfo->SetDamageType(dmgtype); } } - VHOOK_CALL(CBaseEntity_ModifyFireBulletsDamage)(dmgInfo); + VHOOK_CALL(dmgInfo); } CVirtualHook bulletDamageHook(TypeName(), "CBaseEntity::ModifyFireBulletsDamage", GET_VHOOK_CALLBACK(CBaseEntity_ModifyFireBulletsDamage), GET_VHOOK_INNERPTR(CBaseEntity_ModifyFireBulletsDamage)); @@ -268,7 +268,7 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum MimicFire(mimic); } else { - DETOUR_MEMBER_CALL(CTFPointWeaponMimic_Fire)(); + DETOUR_MEMBER_CALL(); } } @@ -294,7 +294,7 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum if (scorer != nullptr) { pScorer = scorer; } - projectile = DETOUR_STATIC_CALL(CTFProjectile_Rocket_Create)(pLauncher, vecOrigin, vecAngles, pOwner, pScorer); + projectile = DETOUR_STATIC_CALL(pLauncher, vecOrigin, vecAngles, pOwner, pScorer); return projectile; } @@ -303,7 +303,7 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum if (scorer != nullptr) { pScorer = scorer; } - projectile = DETOUR_STATIC_CALL(CTFProjectile_Arrow_Create)(vecOrigin, vecAngles, fSpeed, fGravity, projectileType, pOwner, pScorer); + projectile = DETOUR_STATIC_CALL(vecOrigin, vecAngles, fSpeed, fGravity, projectileType, pOwner, pScorer); return reinterpret_cast(projectile); } @@ -313,7 +313,7 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum grenade = true; pOwner = scorer; } - projectile = DETOUR_STATIC_CALL(CBaseEntity_CreateNoSpawn)(szName, vecOrigin, vecAngles, pOwner); + projectile = DETOUR_STATIC_CALL(szName, vecOrigin, vecAngles, pOwner); return projectile; } @@ -337,19 +337,19 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum { OnRemove(reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CTFPointWeaponMimic_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPointWeaponMimic_dtor2) { OnRemove(reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CTFPointWeaponMimic_dtor2)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPointWeaponMimic_Spawn) { - DETOUR_MEMBER_CALL(CTFPointWeaponMimic_Spawn)(); + DETOUR_MEMBER_CALL(); auto mimic = reinterpret_cast(this); int spawnflags = mimic->m_spawnflags; @@ -386,7 +386,7 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum return killIcon; } } - auto result = DETOUR_MEMBER_CALL(CTFGameRules_GetKillingWeaponName)(info, pVictim, iWeaponID); + auto result = DETOUR_MEMBER_CALL(info, pVictim, iWeaponID); //Msg("Killicon %s\n", result); return result; } @@ -401,13 +401,13 @@ namespace Mod::Etc::Weapon_Mimic_Teamnum if (dmgtype != -1) { return dmgtype; } - return DETOUR_MEMBER_CALL(CTFBaseProjectile_GetDamageType)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_Event_Killed, const CTakeDamageInfo& info) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); CBaseEntity *observer = player->m_hObserverTarget; if (info.GetInflictor() != nullptr) { if (rtti_cast(info.GetInflictor()) != nullptr) { diff --git a/src/mod/item/item_common.cpp b/src/mod/item/item_common.cpp index 49b539e6..003934df 100644 --- a/src/mod/item/item_common.cpp +++ b/src/mod/item/item_common.cpp @@ -472,7 +472,7 @@ namespace Mod::Item::Common if (view->m_iEntityLevel == 414918 && view->m_iItemDefinitionIndex == 0) { view->m_iItemDefinitionIndex = view->m_iEntityQuality; } - auto ret = DETOUR_MEMBER_CALL(CEconItemView_GetSkin)(team, viewmodel); + auto ret = DETOUR_MEMBER_CALL(team, viewmodel); if (view->m_iEntityLevel == 414918) { view->m_iItemDefinitionIndex = 0; } @@ -486,7 +486,7 @@ namespace Mod::Item::Common if (view->m_iEntityLevel == 414918 && view->m_iItemDefinitionIndex == 0) { view->m_iItemDefinitionIndex = view->m_iEntityQuality; } - auto ret = DETOUR_MEMBER_CALL(CEconItemView_GetPlayerDisplayModel)(playerclass, team); + auto ret = DETOUR_MEMBER_CALL(playerclass, team); if (view->m_iEntityLevel == 414918) { view->m_iItemDefinitionIndex = 0; } diff --git a/src/mod/mvm/allow_vote_mid_wave.cpp b/src/mod/mvm/allow_vote_mid_wave.cpp index 152d82c3..b54a9206 100644 --- a/src/mod/mvm/allow_vote_mid_wave.cpp +++ b/src/mod/mvm/allow_vote_mid_wave.cpp @@ -11,7 +11,7 @@ namespace Mod::MvM::Allow_Vote_Mid_Wave restoreRound = true; TFGameRules()->State_SetDirect(GR_STATE_BETWEEN_RNDS); } - auto result = DETOUR_MEMBER_CALL(CKickIssue_RequestCallVote)(var1, var2, fail, var4); + auto result = DETOUR_MEMBER_CALL(var1, var2, fail, var4); if (restoreRound) { TFGameRules()->State_SetDirect(GR_STATE_RND_RUNNING); } diff --git a/src/mod/mvm/changebotattributes_crash_fix.cpp b/src/mod/mvm/changebotattributes_crash_fix.cpp index 4b5f2416..91e6c703 100644 --- a/src/mod/mvm/changebotattributes_crash_fix.cpp +++ b/src/mod/mvm/changebotattributes_crash_fix.cpp @@ -10,7 +10,7 @@ namespace Mod::MvM::ChangeBotAttributes_Crash_Fix DETOUR_DECL_MEMBER(void, CPointPopulatorInterface_InputChangeBotAttributes, inputdata_t& inputdata) { SCOPED_INCREMENT(rc_CPointPopulatorInterface_InputChangeBotAttributes); - DETOUR_MEMBER_CALL(CPointPopulatorInterface_InputChangeBotAttributes)(inputdata); + DETOUR_MEMBER_CALL(inputdata); } DETOUR_DECL_MEMBER(CTFBot::EventChangeAttributes_t *, CTFBot_GetEventChangeAttributes, const char *name) @@ -23,7 +23,7 @@ namespace Mod::MvM::ChangeBotAttributes_Crash_Fix PrintToChatAll("Invalid changebotattributes name"); return nullptr; } - return DETOUR_MEMBER_CALL(CTFBot_GetEventChangeAttributes)(name); + return DETOUR_MEMBER_CALL(name); } DETOUR_DECL_MEMBER(void, CTFBot_AddEventChangeAttributes, CTFBot::EventChangeAttributes_t * ecattr) @@ -33,7 +33,7 @@ namespace Mod::MvM::ChangeBotAttributes_Crash_Fix return; } - DETOUR_MEMBER_CALL(CTFBot_AddEventChangeAttributes)(ecattr); + DETOUR_MEMBER_CALL(ecattr); } class CMod : public IMod diff --git a/src/mod/mvm/changeclass_anytime.cpp b/src/mod/mvm/changeclass_anytime.cpp index 286272ee..e7b0108b 100644 --- a/src/mod/mvm/changeclass_anytime.cpp +++ b/src/mod/mvm/changeclass_anytime.cpp @@ -33,7 +33,7 @@ namespace Mod::MvM::ChangeClass_AnyTime // DevMsg("- IsMannVsMachineMode: %s\n", (TFGameRules()->IsMannVsMachineMode() ? "true" : "false")); // DevMsg("- GetTeamNumber: %d\n", player->GetTeamNumber()); - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinClass)(pClassName, b1); + DETOUR_MEMBER_CALL(pClassName, b1); } DETOUR_DECL_MEMBER(bool, CTFPlayer_IsReadyToPlay) @@ -45,7 +45,7 @@ namespace Mod::MvM::ChangeClass_AnyTime return false; } - auto result = DETOUR_MEMBER_CALL(CTFPlayer_IsReadyToPlay)(); + auto result = DETOUR_MEMBER_CALL(); // DevMsg("- passthru: return %s\n", (result ? "true" : "false")); return result; } diff --git a/src/mod/mvm/chat_unrestrict.cpp b/src/mod/mvm/chat_unrestrict.cpp index 9f4b4798..cbece0d4 100644 --- a/src/mod/mvm/chat_unrestrict.cpp +++ b/src/mod/mvm/chat_unrestrict.cpp @@ -16,7 +16,7 @@ namespace Mod::MvM::Chat_Unrestrict } } - return DETOUR_MEMBER_CALL(CTFPlayer_CanHearAndReadChatFrom)(them); + return DETOUR_MEMBER_CALL(them); } diff --git a/src/mod/mvm/disposable_sentry_health_upgrades.cpp b/src/mod/mvm/disposable_sentry_health_upgrades.cpp index eb7d27ff..c1e5115b 100644 --- a/src/mod/mvm/disposable_sentry_health_upgrades.cpp +++ b/src/mod/mvm/disposable_sentry_health_upgrades.cpp @@ -15,7 +15,7 @@ namespace Mod::MvM::Disposable_Sentry_Health_Upgrades int max_health = sentry->GetMaxHealth(); SCOPED_INCREMENT(rc_CObjectSentrygun_MakeDisposableBuilding); - DETOUR_MEMBER_CALL(CObjectSentrygun_MakeDisposableBuilding)(owner); + DETOUR_MEMBER_CALL(owner); sentry->SetMaxHealth(max_health); } @@ -30,7 +30,7 @@ namespace Mod::MvM::Disposable_Sentry_Health_Upgrades return; } - DETOUR_MEMBER_CALL(CBaseObject_SetHealth)(amt); + DETOUR_MEMBER_CALL(amt); } @@ -41,7 +41,7 @@ namespace Mod::MvM::Disposable_Sentry_Health_Upgrades bool m_bDisposableBuilding = obj->m_bDisposableBuilding; obj->m_bDisposableBuilding = false; - int ret = DETOUR_MEMBER_CALL(CBaseObject_GetMaxHealthForCurrentLevel)(); + int ret = DETOUR_MEMBER_CALL(); obj->m_bDisposableBuilding = m_bDisposableBuilding; return ret; diff --git a/src/mod/mvm/drop_weapons.cpp b/src/mod/mvm/drop_weapons.cpp index b29875af..f8112184 100644 --- a/src/mod/mvm/drop_weapons.cpp +++ b/src/mod/mvm/drop_weapons.cpp @@ -15,7 +15,7 @@ namespace Mod::MvM::Drop_Weapons return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_ShouldDropAmmoPack)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_CTFPlayer_DropAmmoPack; @@ -25,7 +25,7 @@ namespace Mod::MvM::Drop_Weapons SCOPED_INCREMENT(rc_CTFPlayer_DropAmmoPack); drop_player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_DropAmmoPack)(info, b1, b2); + DETOUR_MEMBER_CALL(info, b1, b2); drop_player = nullptr; } @@ -36,17 +36,17 @@ namespace Mod::MvM::Drop_Weapons return nullptr; } - return DETOUR_STATIC_CALL(CTFAmmoPack_Create)(vecOrigin, vecAngles, pOwner, pszModelName); + return DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pszModelName); } DETOUR_DECL_STATIC(CTFDroppedWeapon *, CTFDroppedWeapon_Create, const Vector& vecOrigin, const QAngle& vecAngles, CBaseEntity *pOwner, const char *pszModelName, const CEconItemView *pItemView) { if (!TFGameRules()->IsMannVsMachineMode()) { - return DETOUR_STATIC_CALL(CTFDroppedWeapon_Create)(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); + return DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); } TFGameRules()->Set_m_bPlayingMannVsMachine(false); - CTFDroppedWeapon *pDroppedWeapon = DETOUR_STATIC_CALL(CTFDroppedWeapon_Create)(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); + CTFDroppedWeapon *pDroppedWeapon = DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); TFGameRules()->Set_m_bPlayingMannVsMachine(true); return pDroppedWeapon; } diff --git a/src/mod/mvm/extended_upgrades.cpp b/src/mod/mvm/extended_upgrades.cpp index 506d6486..a607f306 100644 --- a/src/mod/mvm/extended_upgrades.cpp +++ b/src/mod/mvm/extended_upgrades.cpp @@ -1332,14 +1332,14 @@ namespace Mod::MvM::Extended_Upgrades DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { ClearUpgrades(); - auto ret = DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + auto ret = DETOUR_MEMBER_CALL(); return ret; } DETOUR_DECL_MEMBER(void, CMannVsMachineUpgradeManager_LoadUpgradesFileFromPath, const char *path) { - DETOUR_MEMBER_CALL(CMannVsMachineUpgradeManager_LoadUpgradesFileFromPath)(path); + DETOUR_MEMBER_CALL(path); AddUpgradesToGameList(); } @@ -1350,7 +1350,7 @@ namespace Mod::MvM::Extended_Upgrades return player_is_downgrading || from_buy_upgrade; } - return DETOUR_MEMBER_CALL(CTFGameRules_CanUpgradeWithAttrib)(player, slot, defindex, upgrade); + return DETOUR_MEMBER_CALL(player, slot, defindex, upgrade); } DETOUR_DECL_MEMBER(int, CTFGameRules_GetCostForUpgrade, CMannVsMachineUpgrades* upgrade, int slot, int classindex, CTFPlayer *player) @@ -1358,12 +1358,12 @@ namespace Mod::MvM::Extended_Upgrades if (upgrade != nullptr && upgrade->m_iQuality == 9500) return upgrade->m_nCost; - return DETOUR_MEMBER_CALL(CTFGameRules_GetCostForUpgrade)(upgrade, slot, classindex, player); + return DETOUR_MEMBER_CALL(upgrade, slot, classindex, player); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, unsigned short, CUpgrades_ApplyUpgradeToItem, CTFPlayer* player, CEconItemView *item, int upgrade, int cost, bool downgrade, bool fresh) { - attrib_definition_index_t result = DETOUR_MEMBER_CALL(CUpgrades_ApplyUpgradeToItem)(player, item, upgrade, cost, downgrade, fresh); + attrib_definition_index_t result = DETOUR_MEMBER_CALL(player, item, upgrade, cost, downgrade, fresh); upgrade_success = result != INVALID_ATTRIB_DEF_INDEX; DevMsg("ApplyUpgradeToItem %d %d %d %d\n", upgrade_success, upgrade, cost, downgrade); @@ -1395,7 +1395,7 @@ namespace Mod::MvM::Extended_Upgrades DETOUR_DECL_MEMBER(int, CTFItemDefinition_GetLoadoutSlot, int classIndex) { CTFItemDefinition *item_def = reinterpret_cast(this); - int slot = DETOUR_MEMBER_CALL(CTFItemDefinition_GetLoadoutSlot)(classIndex); + int slot = DETOUR_MEMBER_CALL(classIndex); if (rc_CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot && item_def->m_iItemDefIndex != 0 && slot == -1 && classIndex != TF_CLASS_UNDEFINED) { slot = item_def->GetLoadoutSlot(TF_CLASS_UNDEFINED); } @@ -1406,12 +1406,12 @@ namespace Mod::MvM::Extended_Upgrades { SCOPED_INCREMENT(rc_CUpgrades_PlayerPurchasingUpgrade); player_is_downgrading = sell; - DETOUR_MEMBER_CALL(CUpgrades_PlayerPurchasingUpgrade)(player, itemslot, upgradeslot, sell, free, b3); + DETOUR_MEMBER_CALL(player, itemslot, upgradeslot, sell, free, b3); } DETOUR_DECL_MEMBER(void, CPopulationManager_RestoreCheckpoint) { - DETOUR_MEMBER_CALL(CPopulationManager_RestoreCheckpoint)(); + DETOUR_MEMBER_CALL(); bought_upgrades_v2 = bought_upgrades_v2_checkpoint; ForEachTFPlayer([](CTFPlayer *player) { @@ -1449,7 +1449,7 @@ namespace Mod::MvM::Extended_Upgrades DETOUR_DECL_MEMBER(void, CPopulationManager_SetCheckpoint, int wave) { - DETOUR_MEMBER_CALL(CPopulationManager_SetCheckpoint)(wave); + DETOUR_MEMBER_CALL(wave); bought_upgrades_v2_checkpoint = bought_upgrades_v2; } @@ -1457,7 +1457,7 @@ namespace Mod::MvM::Extended_Upgrades { bought_upgrades_v2_checkpoint.clear(); bought_upgrades_v2.clear(); - DETOUR_MEMBER_CALL(CPopulationManager_ResetMap)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CUpgrades_GrantOrRemoveAllUpgrades; @@ -1533,14 +1533,14 @@ namespace Mod::MvM::Extended_Upgrades } bought_upgrades_v2.clear(); } - DETOUR_MEMBER_CALL(CUpgrades_GrantOrRemoveAllUpgrades)(player, remove, refund); + DETOUR_MEMBER_CALL(player, remove, refund); } RefCount rc_GetUpgradeStepData; DETOUR_DECL_STATIC(CEconItemView *, CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot, CTFPlayer *player, int slot, CEconEntity **entity) { SCOPED_INCREMENT(rc_CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot); - auto result = DETOUR_STATIC_CALL(CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot)(player, slot, entity); + auto result = DETOUR_STATIC_CALL(player, slot, entity); if (rc_GetUpgradeStepData && entity != nullptr && rtti_cast(*entity) != nullptr) { *entity = nullptr; } @@ -1574,7 +1574,7 @@ namespace Mod::MvM::Extended_Upgrades } } } - auto result = DETOUR_STATIC_CALL(GetUpgradeStepData)(player, slot, upgrade, cur_step, over_cap); + auto result = DETOUR_STATIC_CALL(player, slot, upgrade, cur_step, over_cap); // To reduce refund execution time, only count steps that are bought for the item if (rc_CUpgrades_GrantOrRemoveAllUpgrades && result > cur_step) { return cur_step; @@ -1612,14 +1612,14 @@ namespace Mod::MvM::Extended_Upgrades } return INVALID_ATTRIB_DEF_INDEX; } - return DETOUR_STATIC_CALL(ApplyUpgrade_Default)(upgrade, pTFPlayer, pEconItemView, nCost, bDowngrade); + return DETOUR_STATIC_CALL(upgrade, pTFPlayer, pEconItemView, nCost, bDowngrade); } DETOUR_DECL_MEMBER(void, CTFPlayer_GiveDefaultItems) { if (rc_CUpgrades_PlayerPurchasingUpgrade > 0 && buying_upgrade) { return; } - DETOUR_MEMBER_CALL(CTFPlayer_GiveDefaultItems)(); + DETOUR_MEMBER_CALL(); } class CMod : public IMod, public IModCallbackListener, public IFrameUpdatePostEntityThinkListener diff --git a/src/mod/mvm/friendlyfire.cpp b/src/mod/mvm/friendlyfire.cpp index 35eed46b..cb8a355f 100644 --- a/src/mod/mvm/friendlyfire.cpp +++ b/src/mod/mvm/friendlyfire.cpp @@ -33,7 +33,7 @@ namespace Mod::MvM::FriendlyFire return true; } - return DETOUR_MEMBER_CALL(CTFGameRules_FPlayerCanTakeDamage)(pPlayer, pAttacker, info); + return DETOUR_MEMBER_CALL(pPlayer, pAttacker, info); } DETOUR_DECL_MEMBER(bool, CTFPlayer_WantsLagCompensationOnEntity, const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec *pEntityTransmitBits) @@ -45,7 +45,7 @@ namespace Mod::MvM::FriendlyFire return true; } - return DETOUR_MEMBER_CALL(CTFPlayer_WantsLagCompensationOnEntity)(pPlayer, pCmd, pEntityTransmitBits); + return DETOUR_MEMBER_CALL(pPlayer, pCmd, pEntityTransmitBits); } diff --git a/src/mod/mvm/gamemode_converter.cpp b/src/mod/mvm/gamemode_converter.cpp index 3b26dec0..acc8f710 100644 --- a/src/mod/mvm/gamemode_converter.cpp +++ b/src/mod/mvm/gamemode_converter.cpp @@ -86,7 +86,7 @@ namespace Mod::MvM::Gamemode_Converter foundMvmGame = IsMvMMapCheck(pMapData); if (foundMvmGame) { - DETOUR_STATIC_CALL(MapEntity_ParseAllEntities)(pMapData, pFilter, bActivateEntities); + DETOUR_STATIC_CALL(pMapData, pFilter, bActivateEntities); return; } @@ -601,14 +601,14 @@ namespace Mod::MvM::Gamemode_Converter WriteEntityString(entitiesStr, parsedEntities); CTFPlayer::PrecacheMvM(); - DETOUR_STATIC_CALL(MapEntity_ParseAllEntities)(entitiesStr.c_str(), pFilter, bActivateEntities); + DETOUR_STATIC_CALL(entitiesStr.c_str(), pFilter, bActivateEntities); } CountdownTimerInline generateMeshTimer; bool generateMesh = false; DETOUR_DECL_MEMBER(int, CNavMesh_Load) { - auto value = DETOUR_MEMBER_CALL(CNavMesh_Load)(); + auto value = DETOUR_MEMBER_CALL(); // Generate nav mesh if missing if (value == 1) { generateMesh = true; @@ -619,7 +619,7 @@ namespace Mod::MvM::Gamemode_Converter DETOUR_DECL_STATIC(void, CPopulationManager_FindDefaultPopulationFileShortNames, CUtlVector &vec) { - DETOUR_STATIC_CALL(CPopulationManager_FindDefaultPopulationFileShortNames)(vec); + DETOUR_STATIC_CALL(vec); if (foundMvmGame) return; diff --git a/src/mod/mvm/gib_improvements.cpp b/src/mod/mvm/gib_improvements.cpp index 7d4c1f81..cf6f5807 100644 --- a/src/mod/mvm/gib_improvements.cpp +++ b/src/mod/mvm/gib_improvements.cpp @@ -99,7 +99,7 @@ namespace Mod::MvM::Gib_Improvements DETOUR_DECL_MEMBER(void, CTFSniperRifle_ExplosiveHeadShot, CTFPlayer *pAttacker, CTFPlayer *pVictim) { SCOPED_INCREMENT(rc_CTFSniperRifle_ExplosiveHeadShot); - DETOUR_MEMBER_CALL(CTFSniperRifle_ExplosiveHeadShot)(pAttacker, pVictim); + DETOUR_MEMBER_CALL(pAttacker, pVictim); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_StunPlayer, float duration, float slowdown, int flags, CTFPlayer *attacker) @@ -115,7 +115,7 @@ namespace Mod::MvM::Gib_Improvements eh_victims.insert(shared->GetOuter()); } - DETOUR_MEMBER_CALL(CTFPlayerShared_StunPlayer)(duration, slowdown, flags, attacker); + DETOUR_MEMBER_CALL(duration, slowdown, flags, attacker); } @@ -156,7 +156,7 @@ namespace Mod::MvM::Gib_Improvements if (eh_tick == gpGlobals->tickcount && eh_victims.count(player) != 0) { return true; } - bool ret = DETOUR_MEMBER_CALL(CTFPlayer_ShouldGib)(info); + bool ret = DETOUR_MEMBER_CALL(info); DevMsg("damage info %d %d\n", ret, info.GetDamageType()); return ret; } @@ -189,7 +189,7 @@ namespace Mod::MvM::Gib_Improvements } } - return DETOUR_MEMBER_CALL(CTFPlayer_CreateRagdollEntity)(bShouldGib, bBurning, bUberDrop, bOnGround, bYER, bGold, bIce, bAsh, iCustom, bClassic); + return DETOUR_MEMBER_CALL(bShouldGib, bBurning, bUberDrop, bOnGround, bYER, bGold, bIce, bAsh, iCustom, bClassic); } diff --git a/src/mod/mvm/go_back_in_time.cpp b/src/mod/mvm/go_back_in_time.cpp index e43def4c..874bd9e3 100644 --- a/src/mod/mvm/go_back_in_time.cpp +++ b/src/mod/mvm/go_back_in_time.cpp @@ -10,7 +10,7 @@ namespace Mod::MvM::GoBackInTime { SCOPED_INCREMENT(rc_CTFSniperRifle_ExplosiveHeadShot); - DETOUR_MEMBER_CALL(CTFSniperRifle_ExplosiveHeadShot)(player1, player2); + DETOUR_MEMBER_CALL(player1, player2); } RefCount rc_CTFPlayerShared_OnRemovePhase; @@ -18,7 +18,7 @@ namespace Mod::MvM::GoBackInTime { SCOPED_INCREMENT(rc_CTFPlayerShared_OnRemovePhase); - DETOUR_MEMBER_CALL(CTFPlayerShared_OnRemovePhase)(); + DETOUR_MEMBER_CALL(); } @@ -28,7 +28,7 @@ namespace Mod::MvM::GoBackInTime return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_StunPlayer)(duration, slowdown, flags, attacker); + DETOUR_MEMBER_CALL(duration, slowdown, flags, attacker); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_MakeBleed, CTFPlayer *attacker, CTFWeaponBase *weapon, float bleedTime, int bleeddmg, bool perm, int val) @@ -43,7 +43,7 @@ namespace Mod::MvM::GoBackInTime DevMsg("Damage after: %d\n",bleeddmg); } - DETOUR_MEMBER_CALL(CTFPlayerShared_MakeBleed)(attacker, weapon, bleedTime, bleeddmg, perm, val); + DETOUR_MEMBER_CALL(attacker, weapon, bleedTime, bleeddmg, perm, val); } DETOUR_DECL_STATIC(CTFReviveMarker *, CTFReviveMarker_Create, CTFPlayer *player) diff --git a/src/mod/mvm/human_death_yells.cpp b/src/mod/mvm/human_death_yells.cpp index 471e1087..89d05e3b 100644 --- a/src/mod/mvm/human_death_yells.cpp +++ b/src/mod/mvm/human_death_yells.cpp @@ -78,14 +78,14 @@ namespace Mod::MvM::Human_Death_Yells DETOUR_DECL_MEMBER(void, CTFPlayer_SpyDeadRingerDeath, const CTakeDamageInfo& info) { SCOPED_INCREMENT(rc_CTFPlayer_SpyDeadRingerDeath); - DETOUR_MEMBER_CALL(CTFPlayer_SpyDeadRingerDeath)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CTFPlayer_DeathSound, const CTakeDamageInfo& info) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_DeathSound)(info); + DETOUR_MEMBER_CALL(info); /* these checks are essentially in reverse order */ if (TFGameRules()->IsMannVsMachineMode() && player->GetTeamNumber() != TF_TEAM_BLUE && !rc_CTFPlayer_SpyDeadRingerDeath) { diff --git a/src/mod/mvm/jointeam_blue_allow.cpp b/src/mod/mvm/jointeam_blue_allow.cpp index c1750562..e8266b93 100644 --- a/src/mod/mvm/jointeam_blue_allow.cpp +++ b/src/mod/mvm/jointeam_blue_allow.cpp @@ -928,7 +928,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; { /* it's important to let the call happen, because pPlayer->m_nCurrency * is set to its proper value in the call (stupid, but whatever) */ - auto iResult = DETOUR_MEMBER_CALL(CTFGameRules_GetTeamAssignmentOverride)(pPlayer, iWantedTeam, b1); + auto iResult = DETOUR_MEMBER_CALL(pPlayer, iWantedTeam, b1); // debug message for the "sometimes bots don't get put on TEAM_SPECTATOR properly at wave end" situation if (TFGameRules()->IsMannVsMachineMode() && pPlayer->IsBot() && iResult != iWantedTeam) { @@ -974,14 +974,14 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; return nullptr; } - return DETOUR_STATIC_CALL(CTFReviveMarker_Create)(player); + return DETOUR_STATIC_CALL(player); } DETOUR_DECL_MEMBER(void, CTFPlayer_OnNavAreaChanged, CNavArea *enteredArea, CNavArea *leftArea) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_OnNavAreaChanged)(enteredArea, leftArea); + DETOUR_MEMBER_CALL(enteredArea, leftArea); if (IsMvMBlueHuman(player) && (enteredArea == nullptr || static_cast(enteredArea)->HasTFAttributes(BLUE_SPAWN_ROOM)) && @@ -999,7 +999,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; } } - DETOUR_MEMBER_CALL(CTFGameRules_ClientCommandKeyValues)(pEntity, pKeyValues); + DETOUR_MEMBER_CALL(pEntity, pKeyValues); } @@ -1011,7 +1011,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_IsAllowedToPickUpFlag)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CCaptureZone_ShimTouch, CBaseEntity *pOther) @@ -1064,13 +1064,13 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; //player->m_Shared->StunPlayer(1.0f, 1.0f, TF_STUNFLAGS_CONTROL | TF_STUNFLAGS_CONTROL, nullptr); }(); - DETOUR_MEMBER_CALL(CCaptureZone_ShimTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } // DETOUR_DECL_MEMBER(void, CPlayerMove_StartCommand, CBasePlayer *player, CUserCmd *ucmd) // { -// DETOUR_MEMBER_CALL(CPlayerMove_StartCommand)(player, ucmd); +// DETOUR_MEMBER_CALL(player, ucmd); // // DevMsg("CPlayerMove::StartCommand(#%d): buttons = %08x\n", ENTINDEX(player), ucmd->buttons); // @@ -1089,7 +1089,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; { SCOPED_INCREMENT_IF(rc_CTFGameRules_FireGameEvent__teamplay_round_start, (event != nullptr && strcmp(event->GetName(), "teamplay_round_start") == 0)); - DETOUR_MEMBER_CALL(CTFGameRules_FireGameEvent)(event); + DETOUR_MEMBER_CALL(event); } DETOUR_DECL_STATIC(int, CollectPlayers_CTFPlayer, CUtlVector *playerVector, int team, bool isAlive, bool shouldAppend) @@ -1099,7 +1099,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; return CollectPlayers_RedAndBlue_IsBot(playerVector, team, isAlive, shouldAppend); } - return DETOUR_STATIC_CALL(CollectPlayers_CTFPlayer)(playerVector, team, isAlive, shouldAppend); + return DETOUR_STATIC_CALL(playerVector, team, isAlive, shouldAppend); } @@ -1117,7 +1117,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; SCOPED_INCREMENT(rc_CTFPlayerShared_RadiusSpyScan); radius_spy_scan_teamnum = player->GetTeamNumber(); - DETOUR_MEMBER_CALL(CTFPlayerShared_RadiusSpyScan)(); + DETOUR_MEMBER_CALL(); } __gcc_regcall static int CollectPlayers_RadiusSpyScan(CUtlVector *playerVector, int team, bool isAlive, bool shouldAppend) @@ -1135,7 +1135,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; { auto bot = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFBot_Spawn)(); + DETOUR_MEMBER_CALL(); if (TFGameRules()->IsMannVsMachineMode()) { // ========= MANN VS MACHINE MODE ROUND STATE TRANSITIONS ========== @@ -1184,7 +1184,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; DETOUR_DECL_MEMBER(bool, CTFGameRules_PlayerReadyStatus_ShouldStartCountdown) { - bool ret = DETOUR_MEMBER_CALL(CTFGameRules_PlayerReadyStatus_ShouldStartCountdown)(); + bool ret = DETOUR_MEMBER_CALL(); if (TFGameRules()->IsMannVsMachineMode()) { bool notReadyPlayerBlue = false; bool notReadyPlayerRed = false; @@ -1211,7 +1211,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; DETOUR_DECL_MEMBER(int, CTFBaseBoss_OnTakeDamage, CTakeDamageInfo &info) { - float damage = DETOUR_MEMBER_CALL(CTFBaseBoss_OnTakeDamage)(info); + float damage = DETOUR_MEMBER_CALL(info); if (info.GetAttacker() != nullptr && info.GetAttacker()->GetTeamNumber() == reinterpret_cast(this)->GetTeamNumber()) return 0; return damage; @@ -1230,7 +1230,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; } } } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveAmmo, int count, const char *name) @@ -1240,7 +1240,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; if (change) player->SetTeamNumber(TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTFPlayer_RemoveAmmo)(count, name); + DETOUR_MEMBER_CALL(count, name); if (change) player->SetTeamNumber(TF_TEAM_BLUE); @@ -1259,7 +1259,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; sentryRocketAmmoCurrent = obj->m_iAmmoRockets; bool stopammo = TFGameRules()->IsMannVsMachineMode() && !cvar_infinite_ammo.GetBool() && IsMvMBlueHuman(owner); - DETOUR_MEMBER_CALL(CObjectSentrygun_SentryThink)(); + DETOUR_MEMBER_CALL(); if (stopammo) { obj->m_iMaxAmmoShells = maxAmmo; @@ -1273,7 +1273,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; { auto obj = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CObjectSentrygun_Attack)(); + DETOUR_MEMBER_CALL(); sentryAmmoCurrent = obj->m_iAmmoShells; sentryRocketAmmoCurrent = obj->m_iAmmoRockets; } @@ -1287,7 +1287,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; if (changedteam) obj->SetTeamNumber(TF_TEAM_RED); - bool ret = DETOUR_MEMBER_CALL(CBaseObject_ShouldQuickBuild)(); + bool ret = DETOUR_MEMBER_CALL(); if (changedteam) obj->SetTeamNumber(TF_TEAM_BLUE); @@ -1304,7 +1304,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; if (changedteam) obj->SetTeamNumber(TF_TEAM_RED); - DETOUR_MEMBER_CALL(CObjectTeleporter_DeterminePlaybackRate)(); + DETOUR_MEMBER_CALL(); if (obj->m_iState == 1) { StopParticleEffects(obj); } @@ -1315,14 +1315,14 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; DETOUR_DECL_MEMBER(bool, CTFGameRules_ShouldRespawnQuickly, CTFPlayer *player) { - bool ret = DETOUR_MEMBER_CALL(CTFGameRules_ShouldRespawnQuickly)(player); + bool ret = DETOUR_MEMBER_CALL(player); ret |= TFGameRules()->IsMannVsMachineMode() && player->GetPlayerClass()->GetClassIndex() == TF_CLASS_SCOUT && !player->IsBot(); return ret; } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CTFKnife_CanPerformBackstabAgainstTarget, CTFPlayer *target ) { - bool ret = DETOUR_MEMBER_CALL(CTFKnife_CanPerformBackstabAgainstTarget)(target); + bool ret = DETOUR_MEMBER_CALL(target); if ( !ret && TFGameRules() && TFGameRules()->IsMannVsMachineMode() && target->GetTeamNumber() == TF_TEAM_RED ) { @@ -1388,7 +1388,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; DETOUR_DECL_MEMBER(void, CTFGameRules_OnPlayerSpawned, CTFPlayer *player) { - DETOUR_MEMBER_CALL(CTFGameRules_OnPlayerSpawned)(player); + DETOUR_MEMBER_CALL(player); bool bluhuman = IsMvMBlueHuman(player); CTFPlayer *playerbot = ToTFBot(player); if ((bluhuman && cvar_teleport.GetBool()) || cvar_teleport_player.GetBool()) { @@ -1405,7 +1405,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; DETOUR_DECL_MEMBER(void, CTFPlayer_Touch, CBaseEntity *toucher) { - DETOUR_MEMBER_CALL(CTFPlayer_Touch)(toucher); + DETOUR_MEMBER_CALL(toucher); auto player = reinterpret_cast(this); if (player->IsMiniBoss() && toucher->IsBaseObject()) { CBaseObject *obj = ToBaseObject(toucher); @@ -1436,7 +1436,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; } }); } - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); if (cvar_no_footsteps.GetBool()) { ForEachTFPlayer([&](CTFPlayer *player) { @@ -1457,12 +1457,12 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; if (IsMvMBlueHuman(reinterpret_cast(this)->GetTFPlayerOwner())) { return; } - DETOUR_MEMBER_CALL(CTFSniperRifle_CreateSniperDot)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(CBaseEntity *, CSniperDot_Create, Vector &origin, CBaseEntity *owner, bool visibleDot) { - return laser_dot = DETOUR_STATIC_CALL(CSniperDot_Create)(origin, owner, visibleDot); + return laser_dot = DETOUR_STATIC_CALL(origin, owner, visibleDot); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveAllOwnedEntitiesFromWorld, bool explode) @@ -1472,7 +1472,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; if (blueHuman) { TFGameRules()->Set_m_bPlayingMannVsMachine(false); } - DETOUR_MEMBER_CALL(CTFPlayer_RemoveAllOwnedEntitiesFromWorld)(explode); + DETOUR_MEMBER_CALL(explode); if (blueHuman) { TFGameRules()->Set_m_bPlayingMannVsMachine(true); } @@ -1550,14 +1550,14 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; event->SetInt("winning_team", teamnum == TF_TEAM_RED ? TF_TEAM_BLUE : TF_TEAM_RED); } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } RefCount rc_CTFBot_Event_Killed; DETOUR_DECL_MEMBER(void, CTFBot_Event_Killed, const CTakeDamageInfo& info) { auto bot = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFBot_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); extern ConVar cvar_force; if (cvar_force.GetBool() && bot->GetTeamNumber() == TF_TEAM_RED) { @@ -1637,7 +1637,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; TFGameRules()->Set_m_bPlayingMannVsMachine(false); } - bool ret = DETOUR_MEMBER_CALL(CVoteController_IsValidVoter)(); + bool ret = DETOUR_MEMBER_CALL(); if (blueHuman) { TFGameRules()->Set_m_bPlayingMannVsMachine(true); @@ -1652,14 +1652,14 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; // DevMsg("CTFGameRules::PlayerKilled\n"); killed = IsMvMBlueHuman(ToTFPlayer(info.GetAttacker())) && pVictim->GetTeamNumber() == TF_TEAM_RED ? pVictim : nullptr; team_change_back = false; - DETOUR_MEMBER_CALL(CTFGameRules_PlayerKilled)(pVictim, info); + DETOUR_MEMBER_CALL(pVictim, info); } DETOUR_DECL_MEMBER(void, CTeamplayRules_PlayerKilled, CBasePlayer *pVictim, const CTakeDamageInfo& info) { if (killed != nullptr && team_change_back) killed->SetTeamNumber(TF_TEAM_RED); - DETOUR_MEMBER_CALL(CTeamplayRules_PlayerKilled)(pVictim, info); + DETOUR_MEMBER_CALL(pVictim, info); killed = nullptr; } @@ -1671,7 +1671,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; team_change_back = true; } - return DETOUR_STATIC_CALL(GetKilleaterWeaponFromDamageInfo)(info); + return DETOUR_STATIC_CALL(info); } DETOUR_DECL_MEMBER(void, CMultiplayRules_HaveAllPlayersSpeakConceptIfAllowed, int iConcept, int iTeam /* = TEAM_UNASSIGNED */, const char *modifiers) @@ -1679,7 +1679,7 @@ constexpr uintptr_t s_CallOff_CollectPlayers_RadiusSpyScan = 0x2c; if (iConcept == TF_TEAM_RED) { iTeam = TF_TEAM_BLUE; } - DETOUR_MEMBER_CALL(CMultiplayRules_HaveAllPlayersSpeakConceptIfAllowed)(iConcept, iTeam, modifiers); + DETOUR_MEMBER_CALL(iConcept, iTeam, modifiers); } void CallbackScoreboard(CBaseEntity *entity, int clientIndex, DVariant &value, int callbackIndex, SendProp *prop, uintptr_t data) { diff --git a/src/mod/mvm/medigunshield_damage.cpp b/src/mod/mvm/medigunshield_damage.cpp index 9b38fd27..aa74706d 100644 --- a/src/mod/mvm/medigunshield_damage.cpp +++ b/src/mod/mvm/medigunshield_damage.cpp @@ -72,7 +72,7 @@ namespace Mod::MvM::MedigunShield_Damage DETOUR_DECL_STATIC(CTFMedigunShield *, CTFMedigunShield_Create, CTFPlayer *player) { - CTFMedigunShield *shield = DETOUR_STATIC_CALL(CTFMedigunShield_Create)(player); + CTFMedigunShield *shield = DETOUR_STATIC_CALL(player); float damage = 1.0f; CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(player, damage, mult_dmg_vs_players); if (damage > 0.0f) { diff --git a/src/mod/mvm/no_halloween_souls.cpp b/src/mod/mvm/no_halloween_souls.cpp index 129d8d44..e0e7515c 100644 --- a/src/mod/mvm/no_halloween_souls.cpp +++ b/src/mod/mvm/no_halloween_souls.cpp @@ -11,7 +11,7 @@ namespace Mod::MvM::No_Halloween_Souls return; } - DETOUR_MEMBER_CALL(CTFGameRules_DropHalloweenSoulPack)(i1, vec1, ent1, i2); + DETOUR_MEMBER_CALL(i1, vec1, ent1, i2); } diff --git a/src/mod/mvm/player_attribute_override.cpp b/src/mod/mvm/player_attribute_override.cpp index d7d9b32d..34466062 100644 --- a/src/mod/mvm/player_attribute_override.cpp +++ b/src/mod/mvm/player_attribute_override.cpp @@ -10,7 +10,7 @@ namespace Mod::MvM::PlayerAttributeOverride DETOUR_DECL_MEMBER(CBaseEntity *, CTFPlayer_GiveNamedItem, const char *classname, int i1, const CEconItemView *item_view, bool b1) { auto player = reinterpret_cast(this); - CBaseEntity *entity = DETOUR_MEMBER_CALL(CTFPlayer_GiveNamedItem)(classname, i1, item_view, b1); + CBaseEntity *entity = DETOUR_MEMBER_CALL(classname, i1, item_view, b1); if (entity != nullptr && TFGameRules()->IsMannVsMachineMode() && player->GetTeamNumber() == TF_TEAM_RED) { } diff --git a/src/mod/mvm/player_limit.cpp b/src/mod/mvm/player_limit.cpp index 05c8ab0f..ecff80b0 100644 --- a/src/mod/mvm/player_limit.cpp +++ b/src/mod/mvm/player_limit.cpp @@ -197,7 +197,7 @@ namespace Mod::MvM::Player_Limit } } - bool ret = DETOUR_MEMBER_CALL(CTFGameRules_ClientConnected)(pEntity, pszName, pszAddress, reject, maxrejectlen); + bool ret = DETOUR_MEMBER_CALL(pEntity, pszName, pszAddress, reject, maxrejectlen); if (gamerules->IsMannVsMachineMode()) { // Fix Source TV client counting as real player @@ -245,7 +245,7 @@ namespace Mod::MvM::Player_Limit /* it's important to let the call happen, because pPlayer->m_nCurrency * is set to its proper value in the call (stupid, but whatever) */ - auto iResult = DETOUR_MEMBER_CALL(CTFGameRules_GetTeamAssignmentOverride)(pPlayer, iWantedTeam, b1); + auto iResult = DETOUR_MEMBER_CALL(pPlayer, iWantedTeam, b1); return iResult; } @@ -257,7 +257,7 @@ namespace Mod::MvM::Player_Limit static CValueOverride_ConVar tf_mvm_defenders_team_size("tf_mvm_defenders_team_size"); tf_mvm_defenders_team_size.Set(red + blu); - DETOUR_MEMBER_CALL(CTFGCServerSystem_PreClientUpdate)(); + DETOUR_MEMBER_CALL(); tf_mvm_defenders_team_size.Reset(); } diff --git a/src/mod/mvm/red_robot_eye_glow.cpp b/src/mod/mvm/red_robot_eye_glow.cpp index 2aa53f51..7e72df50 100644 --- a/src/mod/mvm/red_robot_eye_glow.cpp +++ b/src/mod/mvm/red_robot_eye_glow.cpp @@ -103,7 +103,7 @@ namespace Mod::MvM::Red_Robot_Eye_Glow { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_ChangeTeam)(iTeamNum, b1, b2, b3); + DETOUR_MEMBER_CALL(iTeamNum, b1, b2, b3); if (iTeamNum == TF_TEAM_RED || (iTeamNum == TEAM_SPECTATOR && player->IsAlive())) { const char *modelname = player->GetPlayerClass()->GetCustomModel(); @@ -119,19 +119,19 @@ namespace Mod::MvM::Red_Robot_Eye_Glow auto player = shared->GetOuter(); DeployModel(player, s1); - DETOUR_MEMBER_CALL(CTFPlayerClassShared_SetCustomModel)(s1, b1); + DETOUR_MEMBER_CALL(s1, b1); } DETOUR_DECL_MEMBER(void, CTFBot_OnEventChangeAttributes, void *ecattr) { auto player = reinterpret_cast(this); DeployModel(player, player->GetPlayerClass()->GetCustomModel()); - DETOUR_MEMBER_CALL(CTFBot_OnEventChangeAttributes)(ecattr); + DETOUR_MEMBER_CALL(ecattr); } DETOUR_DECL_MEMBER(void, CTFGameRules_PlayerKilled, CBasePlayer *pVictim, const CTakeDamageInfo& info) { - DETOUR_MEMBER_CALL(CTFGameRules_PlayerKilled)(pVictim, info); + DETOUR_MEMBER_CALL(pVictim, info); if (pVictim->GetCustomVariableFloat<"CustomEyeGlow">()) { StopParticleEffects(pVictim); diff --git a/src/mod/mvm/refund_exploit_fix.cpp b/src/mod/mvm/refund_exploit_fix.cpp index 4dff0b5f..7572b358 100644 --- a/src/mod/mvm/refund_exploit_fix.cpp +++ b/src/mod/mvm/refund_exploit_fix.cpp @@ -26,7 +26,7 @@ namespace Mod::MvM::Refund_Exploit_Fix DETOUR_DECL_MEMBER(int, CTFPlayer_GetAutoTeam, int team) { SCOPED_INCREMENT(rc_GetAutoTeam); - return DETOUR_MEMBER_CALL(CTFPlayer_GetAutoTeam)(team); + return DETOUR_MEMBER_CALL(team); } DETOUR_DECL_MEMBER(void, CPopulationManager_SetNumRespecsForPlayer, CTFPlayer *player, int num) @@ -36,7 +36,7 @@ namespace Mod::MvM::Refund_Exploit_Fix return; } - DETOUR_MEMBER_CALL(CPopulationManager_SetNumRespecsForPlayer)(player, num); + DETOUR_MEMBER_CALL(player, num); } diff --git a/src/mod/mvm/refund_usermsg_overflow_fix.cpp b/src/mod/mvm/refund_usermsg_overflow_fix.cpp index 6a9b13df..833abc1c 100644 --- a/src/mod/mvm/refund_usermsg_overflow_fix.cpp +++ b/src/mod/mvm/refund_usermsg_overflow_fix.cpp @@ -9,19 +9,19 @@ namespace Mod::MvM::UserMsg_Overflow DETOUR_DECL_MEMBER(void, CUpgrades_GrantOrRemoveAllUpgrades, CTFPlayer * player, bool remove, bool refund) { SCOPED_INCREMENT_IF(rc_CUpgrades_GrantOrRemoveAllUpgrades, refund); - DETOUR_MEMBER_CALL(CUpgrades_GrantOrRemoveAllUpgrades)(player, remove, refund); + DETOUR_MEMBER_CALL(player, remove, refund); } DETOUR_DECL_MEMBER(void, CMannVsMachineStats_NotifyTargetPlayerEvent, CTFPlayer *player, int wave, int eType, int nCost) { if (rc_CUpgrades_GrantOrRemoveAllUpgrades == 0) - DETOUR_MEMBER_CALL(CMannVsMachineStats_NotifyTargetPlayerEvent)(player, wave, eType, nCost); + DETOUR_MEMBER_CALL(player, wave, eType, nCost); } DETOUR_DECL_MEMBER(void, CMannVsMachineStats_PlayerEvent_Upgraded, CTFPlayer *player, uint16 nItemDef, uint16 nAttributeDef, uint8 nQuality, int16 nCost, bool bIsBottle) { if (rc_CUpgrades_GrantOrRemoveAllUpgrades == 0) - DETOUR_MEMBER_CALL(CMannVsMachineStats_PlayerEvent_Upgraded)(player, nItemDef, nAttributeDef, nQuality, nCost, bIsBottle); + DETOUR_MEMBER_CALL(player, nItemDef, nAttributeDef, nQuality, nCost, bIsBottle); } diff --git a/src/mod/mvm/robosapper_override.cpp b/src/mod/mvm/robosapper_override.cpp index 1c18e908..e5263ddd 100644 --- a/src/mod/mvm/robosapper_override.cpp +++ b/src/mod/mvm/robosapper_override.cpp @@ -27,14 +27,14 @@ namespace Mod::MvM::RoboSapper_Override radius = cvar_radius.GetInt(); } - DETOUR_MEMBER_CALL(CObjectSapper_ApplyRoboSapper)(target, duration, radius); + DETOUR_MEMBER_CALL(target, duration, radius); } RefCount rc_CObjectSapper_ApplyRoboSapperEffects; DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CObjectSapper_ApplyRoboSapperEffects, CTFPlayer *target, float duration) { SCOPED_INCREMENT(rc_CObjectSapper_ApplyRoboSapperEffects); - return DETOUR_MEMBER_CALL(CObjectSapper_ApplyRoboSapperEffects)(target, duration); + return DETOUR_MEMBER_CALL(target, duration); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_StunPlayer, float duration, float slowdown, int flags, CTFPlayer *attacker) @@ -51,7 +51,7 @@ namespace Mod::MvM::RoboSapper_Override slowdown = cvar_stun_amount.GetFloat(); } - DETOUR_MEMBER_CALL(CTFPlayerShared_StunPlayer)(duration, slowdown, flags, attacker); + DETOUR_MEMBER_CALL(duration, slowdown, flags, attacker); } diff --git a/src/mod/mvm/robot_limit.cpp b/src/mod/mvm/robot_limit.cpp index a58dc876..3261c817 100644 --- a/src/mod/mvm/robot_limit.cpp +++ b/src/mod/mvm/robot_limit.cpp @@ -280,7 +280,7 @@ namespace Mod::MvM::Robot_Limit { SCOPED_INCREMENT(rc_JumpToWave); //DevMsg("[%8.3f] JumpToWaveRobotlimit\n", gpGlobals->curtime); - DETOUR_MEMBER_CALL(CPopulationManager_JumpToWave)(wave, f1); + DETOUR_MEMBER_CALL(wave, f1); THINK_FUNC_SET(g_pPopulationManager, SpawnBots, gpGlobals->curtime + 0.12f); @@ -290,7 +290,7 @@ namespace Mod::MvM::Robot_Limit DETOUR_DECL_MEMBER(void, CPopulationManager_WaveEnd, bool b1) { //DevMsg("[%8.3f] WaveEnd\n", gpGlobals->curtime); - DETOUR_MEMBER_CALL(CPopulationManager_WaveEnd)(b1); + DETOUR_MEMBER_CALL(b1); CUtlVector mvm_bots; CollectMvMBots(&mvm_bots, cvar_fix_red.GetBool()); @@ -299,7 +299,7 @@ namespace Mod::MvM::Robot_Limit DETOUR_DECL_MEMBER(void, CMannVsMachineStats_RoundEvent_WaveEnd, bool success) { - DETOUR_MEMBER_CALL(CMannVsMachineStats_RoundEvent_WaveEnd)(success); + DETOUR_MEMBER_CALL(success); if (!success && rc_JumpToWave == 0) { //DevMsg("[%8.3f] RoundEvent_WaveEnd\n", gpGlobals->curtime); CUtlVector mvm_bots; @@ -310,7 +310,7 @@ namespace Mod::MvM::Robot_Limit DETOUR_DECL_MEMBER(ActionResult< CTFBot >, CTFBotDead_Update, CTFBot *bot, float interval) { - auto result = DETOUR_MEMBER_CALL(CTFBotDead_Update)(bot,interval); + auto result = DETOUR_MEMBER_CALL(bot,interval); if (result.transition == ActionTransition::DONE) { CUtlVector mvm_bots; CollectMvMBots(&mvm_bots, cvar_fix_red.GetBool()); @@ -323,7 +323,7 @@ namespace Mod::MvM::Robot_Limit DETOUR_DECL_MEMBER(void, CPopulationManager_StartCurrentWave) { - DETOUR_MEMBER_CALL(CPopulationManager_StartCurrentWave)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CGameServer_SetHibernating, bool hibernate) @@ -334,14 +334,14 @@ namespace Mod::MvM::Robot_Limit THINK_FUNC_SET(g_pPopulationManager, SpawnBots, gpGlobals->curtime + 0.12f); } hibernated = hibernate; - DETOUR_MEMBER_CALL(CGameServer_SetHibernating)(hibernate); + DETOUR_MEMBER_CALL(hibernate); } CWaveSpawnPopulator *populator_parse = nullptr; DETOUR_DECL_MEMBER(bool, CWaveSpawnPopulator_Parse, KeyValues *kv_orig) { populator_parse = reinterpret_cast(this); - bool result = DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Parse)(kv_orig); + bool result = DETOUR_MEMBER_CALL(kv_orig); populator_parse = nullptr; return result; @@ -353,7 +353,7 @@ namespace Mod::MvM::Robot_Limit // Unused variable, now used to tell if the wavespawn contains a tfbot spawner populator_parse->m_bHasTFBotSpawner = true; } - return DETOUR_MEMBER_CALL(CTFBotSpawner_Parse)(kv_orig); + return DETOUR_MEMBER_CALL(kv_orig); } DETOUR_DECL_MEMBER(void, CWaveSpawnPopulator_Update) @@ -365,7 +365,7 @@ namespace Mod::MvM::Robot_Limit offset = - (GetMvMInvaderLimit() - 22); } slots += offset; - DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Update)(); + DETOUR_MEMBER_CALL(); slots -= offset; } diff --git a/src/mod/mvm/robot_multiplier.cpp b/src/mod/mvm/robot_multiplier.cpp index 5fa2512e..3ff8fa46 100644 --- a/src/mod/mvm/robot_multiplier.cpp +++ b/src/mod/mvm/robot_multiplier.cpp @@ -19,7 +19,7 @@ namespace Mod::MvM::Robot_Multiplier CValueOverride_ConVar sig_mvm_robot_limit_override("sig_mvm_robot_limit_override"); DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { - bool ret = DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + bool ret = DETOUR_MEMBER_CALL(); auto manager = reinterpret_cast(this); manager->m_nStartingCurrency = manager->m_nStartingCurrency * (manager->m_nStartingCurrency < 3000 ? sig_mvm_robot_multiplier_currency_start.GetFloat() : sig_mvm_robot_multiplier_currency.GetFloat()); int realMult = cvar_enable.GetInt() * 22 / Mod::Pop::PopMgr_Extensions::GetMaxRobotLimit(); @@ -30,7 +30,7 @@ namespace Mod::MvM::Robot_Multiplier DETOUR_DECL_MEMBER(bool, CWaveSpawnPopulator_Parse, KeyValues *kv) { - bool result = DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Parse)(kv); + bool result = DETOUR_MEMBER_CALL(kv); auto wavespawn = reinterpret_cast(this); int realMult = cvar_enable.GetInt() * 22 / Mod::Pop::PopMgr_Extensions::GetMaxRobotLimit(); @@ -64,7 +64,7 @@ namespace Mod::MvM::Robot_Multiplier { auto spawner = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTankSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (result && ents != nullptr && !ents->IsEmpty()) { auto tank = rtti_cast(ents->Tail().Get()); @@ -90,7 +90,7 @@ namespace Mod::MvM::Robot_Multiplier } } - return DETOUR_MEMBER_CALL(CMissionPopulator_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } class CMod : public IMod diff --git a/src/mod/mvm/sapper_allow_multiple_active.cpp b/src/mod/mvm/sapper_allow_multiple_active.cpp index ff4ce609..684196d5 100644 --- a/src/mod/mvm/sapper_allow_multiple_active.cpp +++ b/src/mod/mvm/sapper_allow_multiple_active.cpp @@ -10,7 +10,7 @@ namespace Mod::MvM::Sapper_Allow_Multiple_Active DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall,int, CTFPlayer_CanBuild, int iObjectType, int iObjectMode) { SCOPED_INCREMENT_IF(rc_CTFPlayer_CanBuild__sapper, iObjectType == OBJ_ATTACHMENT_SAPPER); - return DETOUR_MEMBER_CALL(CTFPlayer_CanBuild)(iObjectType, iObjectMode); + return DETOUR_MEMBER_CALL(iObjectType, iObjectMode); } @@ -20,7 +20,7 @@ namespace Mod::MvM::Sapper_Allow_Multiple_Active return 0; } - return DETOUR_MEMBER_CALL(CTFPlayer_GetNumObjects)(iObjectType, iObjectMode); + return DETOUR_MEMBER_CALL(iObjectType, iObjectMode); } diff --git a/src/mod/mvm/teleporter_aggro.cpp b/src/mod/mvm/teleporter_aggro.cpp index e63c5ba4..5b747756 100644 --- a/src/mod/mvm/teleporter_aggro.cpp +++ b/src/mod/mvm/teleporter_aggro.cpp @@ -13,7 +13,7 @@ namespace Mod::Pop::Teleporter_Aggro DETOUR_DECL_MEMBER(void, CTFBotVision_UpdatePotentiallyVisibleNPCVector) { if (!TFGameRules()->IsMannVsMachineMode()) { - DETOUR_MEMBER_CALL(CTFBotVision_UpdatePotentiallyVisibleNPCVector)(); + DETOUR_MEMBER_CALL(); return; } @@ -26,7 +26,7 @@ namespace Mod::Pop::Teleporter_Aggro if (allow) TFGameRules()->Set_m_bPlayingMannVsMachine(false); - DETOUR_MEMBER_CALL(CTFBotVision_UpdatePotentiallyVisibleNPCVector)(); + DETOUR_MEMBER_CALL(); if (allow) TFGameRules()->Set_m_bPlayingMannVsMachine(true); diff --git a/src/mod/mvm/upgrade_disallow.cpp b/src/mod/mvm/upgrade_disallow.cpp index 47e9f935..9cf363f7 100644 --- a/src/mod/mvm/upgrade_disallow.cpp +++ b/src/mod/mvm/upgrade_disallow.cpp @@ -79,7 +79,7 @@ namespace Mod::MvM::Upgrade_Disallow } } - DETOUR_MEMBER_CALL(CUpgrades_PlayerPurchasingUpgrade)(player, itemslot, upgradeslot, sell, free, b3); + DETOUR_MEMBER_CALL(player, itemslot, upgradeslot, sell, free, b3); } @@ -114,7 +114,7 @@ namespace Mod::MvM::Upgrade_Disallow } } - auto result = DETOUR_STATIC_CALL(ApplyUpgrade_Default)(upgrade, pTFPlayer, pEconItemView, nCost, bDowngrade); + auto result = DETOUR_STATIC_CALL(upgrade, pTFPlayer, pEconItemView, nCost, bDowngrade); return result; } diff --git a/src/mod/mvm/upgradestation_regen_improved.cpp b/src/mod/mvm/upgradestation_regen_improved.cpp index 48adebf1..23d01e88 100644 --- a/src/mod/mvm/upgradestation_regen_improved.cpp +++ b/src/mod/mvm/upgradestation_regen_improved.cpp @@ -13,7 +13,7 @@ namespace Mod::MvM::UpgradeStation_Regen_Improved DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CUpgrades_PlayerPurchasingUpgrade, CTFPlayer *player, int slot, int tier, bool sell, bool free, bool b3) { SCOPED_INCREMENT(rc_CUpgrades_PlayerPurchasingUpgrade); - DETOUR_MEMBER_CALL(CUpgrades_PlayerPurchasingUpgrade)(player, slot, tier, sell, free, b3); + DETOUR_MEMBER_CALL(player, slot, tier, sell, free, b3); } @@ -60,7 +60,7 @@ namespace Mod::MvM::UpgradeStation_Regen_Improved return; } - DETOUR_MEMBER_CALL(CTFPlayer_GiveDefaultItems)(); + DETOUR_MEMBER_CALL(); } diff --git a/src/mod/mvm/wave_spawn_at_once.cpp b/src/mod/mvm/wave_spawn_at_once.cpp index 04cf27d3..549f56b8 100644 --- a/src/mod/mvm/wave_spawn_at_once.cpp +++ b/src/mod/mvm/wave_spawn_at_once.cpp @@ -13,7 +13,7 @@ namespace Mod::MvM::Sub_Wave_Spawn_At_Once DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { waveNum = 0; - bool ret = DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + bool ret = DETOUR_MEMBER_CALL(); auto manager = reinterpret_cast(this); int red, blu, spectators, robots; Mod::MvM::Player_Limit::GetSlotCounts(red, blu, spectators, robots); @@ -25,11 +25,11 @@ namespace Mod::MvM::Sub_Wave_Spawn_At_Once { auto wave = reinterpret_cast(this); waveNum++; - return DETOUR_MEMBER_CALL(CWave_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } DETOUR_DECL_MEMBER(bool, CWaveSpawnPopulator_Parse, KeyValues *kv) { - bool result = DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Parse)(kv); + bool result = DETOUR_MEMBER_CALL(kv); auto wavespawn = reinterpret_cast(this); wavespawn->m_waitForAllDead = ""; wavespawn->m_waitForAllSpawned = ""; @@ -43,7 +43,7 @@ namespace Mod::MvM::Sub_Wave_Spawn_At_Once DETOUR_DECL_MEMBER(bool, CMissionPopulator_Parse, KeyValues *kv) { kv->SetInt("InitialCooldown", 0); - return DETOUR_MEMBER_CALL(CMissionPopulator_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } class CMod : public IMod @@ -81,7 +81,7 @@ namespace Mod::MvM::Wave_Spawn_At_Once { SCOPED_INCREMENT(rc_CPopulationManager_Parse); waveNum = 0; - auto ret = DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + auto ret = DETOUR_MEMBER_CALL(); int red, blu, spectators, robots; Mod::MvM::Player_Limit::GetSlotCounts(red, blu, spectators, robots); sig_mvm_robot_limit_override.Set(Max(sig_mvm_robot_limit_override.GetOriginalValue(), Min(gpGlobals->maxClients - red - blu - 1, Mod::Pop::PopMgr_Extensions::GetMaxRobotLimit() * waveNum ))); @@ -93,7 +93,7 @@ namespace Mod::MvM::Wave_Spawn_At_Once DETOUR_DECL_MEMBER(bool, CPopulationManager_IsValidPopfile, CUtlString name) { SCOPED_INCREMENT(rc_CPopulationManager_IsValidPopfile); - return DETOUR_MEMBER_CALL(CPopulationManager_IsValidPopfile)(name); + return DETOUR_MEMBER_CALL(name); } RefCount rc_Parse_Popfile; @@ -142,7 +142,7 @@ namespace Mod::MvM::Wave_Spawn_At_Once ++rc_KeyValues_LoadFromFile; - auto result = DETOUR_MEMBER_CALL(KeyValues_LoadFromFile)(filesystem, resourceName, pathID, refreshCache); + auto result = DETOUR_MEMBER_CALL(filesystem, resourceName, pathID, refreshCache); --rc_KeyValues_LoadFromFile; if (result && rc_CPopulationManager_Parse > 0 && rc_KeyValues_LoadFromFile == 0 && rc_CPopulationManager_IsValidPopfile == 0 && rc_Parse_Popfile == 0) { @@ -158,11 +158,11 @@ namespace Mod::MvM::Wave_Spawn_At_Once { auto wave = reinterpret_cast(this); waveNum++; - return DETOUR_MEMBER_CALL(CWave_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } DETOUR_DECL_MEMBER(bool, CWaveSpawnPopulator_Parse, KeyValues *kv) { - bool result = DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Parse)(kv); + bool result = DETOUR_MEMBER_CALL(kv); auto wavespawn = reinterpret_cast(this); if (waveNum == 1) { g_pPopulationManager->m_nStartingCurrency += wavespawn->m_totalCurrency; @@ -173,7 +173,7 @@ namespace Mod::MvM::Wave_Spawn_At_Once DETOUR_DECL_MEMBER(bool, CMissionPopulator_Parse, KeyValues *kv) { kv->SetInt("BeginAtWave", 1); - return DETOUR_MEMBER_CALL(CMissionPopulator_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } class CMod : public IMod diff --git a/src/mod/mvm/weapon_antigrief.cpp b/src/mod/mvm/weapon_antigrief.cpp index 0ba72c97..e6c95717 100644 --- a/src/mod/mvm/weapon_antigrief.cpp +++ b/src/mod/mvm/weapon_antigrief.cpp @@ -33,7 +33,7 @@ namespace Mod::MvM::Weapon_AntiGrief DETOUR_DECL_MEMBER(void, CTFProjectile_Flare_Explode, CGameTrace *tr, CBaseEntity *ent) { SCOPED_INCREMENT(rc_ScorchShot); - DETOUR_MEMBER_CALL(CTFProjectile_Flare_Explode)(tr, ent); + DETOUR_MEMBER_CALL(tr, ent); } @@ -41,21 +41,21 @@ namespace Mod::MvM::Weapon_AntiGrief DETOUR_DECL_MEMBER(void, CTFGrenadePipebombProjectile_PipebombTouch, CBaseEntity *ent) { SCOPED_INCREMENT(rc_LooseCannon); - DETOUR_MEMBER_CALL(CTFGrenadePipebombProjectile_PipebombTouch)(ent); + DETOUR_MEMBER_CALL(ent); } RefCount rc_ShortStop; DETOUR_DECL_MEMBER(void, CTFPistol_ScoutPrimary_Push) { SCOPED_INCREMENT(rc_ShortStop); - DETOUR_MEMBER_CALL(CTFPistol_ScoutPrimary_Push)(); + DETOUR_MEMBER_CALL(); } RefCount rc_ForceANature1; DETOUR_DECL_MEMBER(void, CTFScatterGun_ApplyPostHitEffects, const CTakeDamageInfo& info, CTFPlayer *victim) { SCOPED_INCREMENT_IF(rc_ForceANature1, BotIsAGiant(victim)); - DETOUR_MEMBER_CALL(CTFScatterGun_ApplyPostHitEffects)(info, victim); + DETOUR_MEMBER_CALL(info, victim); } RefCount rc_ForceANature2; RefCount rc_AirborneRage; @@ -66,7 +66,7 @@ namespace Mod::MvM::Weapon_AntiGrief SCOPED_INCREMENT_IF(rc_ForceANature2, BotIsAGiant(player)); SCOPED_INCREMENT_IF(rc_AirborneRage, cvar_airborne_rage.GetBool() && BotIsAGiant(player) && !(player->GetFlags() & FL_ONGROUND) && info.GetAttacker() != player); - DETOUR_MEMBER_CALL(CTFPlayer_ApplyPushFromDamage)(info, vec); + DETOUR_MEMBER_CALL(info, vec); } DETOUR_DECL_MEMBER(void, CTFPlayer_ApplyAbsVelocityImpulse, const Vector *v1) @@ -75,11 +75,11 @@ namespace Mod::MvM::Weapon_AntiGrief if (rc_AirborneRage) { Vector v2 = *v1 * 0.33f; - DETOUR_MEMBER_CALL(CTFPlayer_ApplyAbsVelocityImpulse)(&v2); + DETOUR_MEMBER_CALL(&v2); return; } - DETOUR_MEMBER_CALL(CTFPlayer_ApplyAbsVelocityImpulse)(v1); + DETOUR_MEMBER_CALL(v1); } @@ -91,7 +91,7 @@ namespace Mod::MvM::Weapon_AntiGrief } } - return DETOUR_STATIC_CALL(CanScatterGunKnockBack)(scattergun, damage, distsqr); + return DETOUR_STATIC_CALL(scattergun, damage, distsqr); } RefCount rc_StunOnHit; @@ -100,7 +100,7 @@ namespace Mod::MvM::Weapon_AntiGrief { SCOPED_INCREMENT(rc_StunOnHit); weapon = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFWeaponBase_ApplyOnHitAttributes)(ent, player, info); + DETOUR_MEMBER_CALL(ent, player, info); } static inline bool ShouldBlock_ScorchShot() { return (cvar_scorchshot .GetBool() && rc_ScorchShot > 0); } static inline bool ShouldBlock_LooseCannon() { return (cvar_loosecannon.GetBool() && rc_LooseCannon > 0); } @@ -132,7 +132,7 @@ namespace Mod::MvM::Weapon_AntiGrief } } - DETOUR_MEMBER_CALL(CTFPlayer_ApplyGenericPushbackImpulse)(impulse, inflictor); + DETOUR_MEMBER_CALL(impulse, inflictor); } RefCount rc_StunBall; @@ -144,7 +144,7 @@ namespace Mod::MvM::Weapon_AntiGrief auto player = ToTFPlayer(other); SCOPED_INCREMENT_IF(rc_StunBall, (cvar_stunball.GetBool() || stun > 1) && player != nullptr && !(BotIsAGiant(player) || (player->IsBot() && player->HasTheFlag()))); - DETOUR_MEMBER_CALL(CTFStunBall_ApplyBallImpactEffectOnVictim)(other); + DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_StunPlayer, float duration, float slowdown, int flags, CTFPlayer *attacker) @@ -163,7 +163,7 @@ namespace Mod::MvM::Weapon_AntiGrief } } - DETOUR_MEMBER_CALL(CTFPlayerShared_StunPlayer)(duration, slowdown, flags, attacker); + DETOUR_MEMBER_CALL(duration, slowdown, flags, attacker); } class CMod : public IMod diff --git a/src/mod/mvm/weapon_balancing.cpp b/src/mod/mvm/weapon_balancing.cpp index f1df3a8c..0a37aa04 100644 --- a/src/mod/mvm/weapon_balancing.cpp +++ b/src/mod/mvm/weapon_balancing.cpp @@ -50,7 +50,7 @@ namespace Mod::MvM::Weapon_Balancing } } - DETOUR_MEMBER_CALL(CTFPlayerShared_StunPlayer)(duration, slowdown, flags, attacker); + DETOUR_MEMBER_CALL(duration, slowdown, flags, attacker); } CTFSniperRifle *sniperrifle = nullptr; @@ -63,7 +63,7 @@ namespace Mod::MvM::Weapon_Balancing if (!WeaponID_IsSniperRifle(sniperrifle->GetWeaponID())) sniperrifle = nullptr; - DETOUR_MEMBER_CALL(CTFSniperRifle_ExplosiveHeadShot)(player1, player2); + DETOUR_MEMBER_CALL(player1, player2); } /* UTIL_EntitiesInSphere forwards call to partition->EnumerateElementsInSphere */ @@ -79,10 +79,10 @@ namespace Mod::MvM::Weapon_Balancing radius_eh = radius*(0.75f+chargedmg*0.3f); origin_eh = &origin; - return DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInSphere)(listMask, origin, radius_eh, coarseTest, pIterator); + return DETOUR_MEMBER_CALL(listMask, origin, radius_eh, coarseTest, pIterator); } - return DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInSphere)(listMask, origin, radius, coarseTest, pIterator); + return DETOUR_MEMBER_CALL(listMask, origin, radius, coarseTest, pIterator); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_MakeBleed, CTFPlayer *attacker, CTFWeaponBase *weapon, float bleedTime, int bleeddmg, bool perm, int val) @@ -110,14 +110,14 @@ namespace Mod::MvM::Weapon_Balancing DevMsg("Damage after: %f %f %d\n",radius_eh,distance, bleeddmg); } - DETOUR_MEMBER_CALL(CTFPlayerShared_MakeBleed)(attacker, weapon, bleedTime, bleeddmg, perm, val); + DETOUR_MEMBER_CALL(attacker, weapon, bleedTime, bleeddmg, perm, val); } //std::map, int> backstab_count; DETOUR_DECL_MEMBER(float, CTFKnife_GetMeleeDamage, CBaseEntity *pTarget, int* piDamageType, int* piCustomDamage) { - float ret = DETOUR_MEMBER_CALL(CTFKnife_GetMeleeDamage)(pTarget, piDamageType, piCustomDamage); + float ret = DETOUR_MEMBER_CALL(pTarget, piDamageType, piCustomDamage); auto knife = reinterpret_cast(this); if (cvar_backstab_nerf.GetBool() && *piCustomDamage == TF_DMG_CUSTOM_BACKSTAB && !knife->GetTFPlayerOwner()->IsBot() && pTarget->IsPlayer() && ToTFPlayer(pTarget)->IsMiniBoss() ) { @@ -148,7 +148,7 @@ namespace Mod::MvM::Weapon_Balancing else flDuration += 0.5f; } - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } RefCount rc_CTFWeaponBase_ApplyOnHitAttributes; @@ -178,14 +178,14 @@ namespace Mod::MvM::Weapon_Balancing } } } - DETOUR_MEMBER_CALL(CTFWeaponBase_ApplyOnHitAttributes)(ent, player, info); + DETOUR_MEMBER_CALL(ent, player, info); victim_onhit = nullptr; } DETOUR_DECL_MEMBER(void, CTFBaseRocket_CheckForStunOnImpact, CTFPlayer* pTarget) { SCOPED_INCREMENT_IF(rc_CTFBaseRocket_CheckForStunOnImpact, cvar_beggar_stun_nerf.GetBool()); - DETOUR_MEMBER_CALL(CTFBaseRocket_CheckForStunOnImpact)(pTarget); + DETOUR_MEMBER_CALL(pTarget); } RefCount rc_HandleRageGain; @@ -193,7 +193,7 @@ namespace Mod::MvM::Weapon_Balancing { SCOPED_INCREMENT_IF(rc_HandleRageGain, (0x10 /*kRageBuffFlag_OnHeal*/ & iRequiredBuffFlags) && !pPlayer->IsBot() && pPlayer->IsPlayerClass( TF_CLASS_MEDIC ) && (cvar_heal_rage_from_upgrades_ratio.GetFloat() != 1.0f || cvar_heal_rage_ratio.GetFloat() != -1.0f)); - DETOUR_STATIC_CALL(HandleRageGain)(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); + DETOUR_STATIC_CALL(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_ModifyRage, float delta) @@ -216,7 +216,7 @@ namespace Mod::MvM::Weapon_Balancing delta = (delta / bonus) * (1.0f + ((bonus - 1.0f) * cvar_heal_rage_from_upgrades_ratio.GetFloat())) * cvar_heal_rage_ratio.GetFloat(); } - DETOUR_MEMBER_CALL(CTFPlayerShared_ModifyRage)(delta); + DETOUR_MEMBER_CALL(delta); } @@ -227,7 +227,7 @@ namespace Mod::MvM::Weapon_Balancing CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( victim_onhit, ragescale, rage_giving_scale ); val *= ragescale; } - DETOUR_MEMBER_CALL(CWeaponMedigun_AddCharge)(val); + DETOUR_MEMBER_CALL(val); } class CMod : public IMod //, public IModCallbackListener diff --git a/src/mod/mvm/yer_unnerf.cpp b/src/mod/mvm/yer_unnerf.cpp index f58a2f65..f2d1348c 100644 --- a/src/mod/mvm/yer_unnerf.cpp +++ b/src/mod/mvm/yer_unnerf.cpp @@ -78,7 +78,7 @@ namespace Mod::MvM::YER_Unnerf //Yer nerf: -20% damage vs giants DETOUR_DECL_MEMBER(float, CTFKnife_GetMeleeDamage, CBaseEntity *pTarget, int* piDamageType, int* piCustomDamage) { - float ret = DETOUR_MEMBER_CALL(CTFKnife_GetMeleeDamage)(pTarget, piDamageType, piCustomDamage); + float ret = DETOUR_MEMBER_CALL(pTarget, piDamageType, piCustomDamage); if (*piCustomDamage == TF_DMG_CUSTOM_BACKSTAB && pTarget->IsPlayer() && ToTFPlayer(pTarget)->IsMiniBoss()) { auto knife = reinterpret_cast(this); diff --git a/src/mod/perf/attributes_optimize.cpp b/src/mod/perf/attributes_optimize.cpp index 549a7a8f..fd1d0ed5 100644 --- a/src/mod/perf/attributes_optimize.cpp +++ b/src/mod/perf/attributes_optimize.cpp @@ -214,7 +214,7 @@ namespace Mod::Perf::Attributes_Optimize return value; if (vec != nullptr || !b1){ - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_float)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } return GetAttribValue(value, attr, const_cast(ent), false); @@ -226,7 +226,7 @@ namespace Mod::Perf::Attributes_Optimize return value; if (vec != nullptr || !b1) { - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_int)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } return RoundFloatToInt(GetAttribValue(static_cast(value), attr, const_cast(ent), true)); @@ -237,12 +237,12 @@ namespace Mod::Perf::Attributes_Optimize { callsapply++; - return DETOUR_MEMBER_CALL(CAttributeManager_ApplyAttributeFloatWrapper)(val, ent, name, vec); + return DETOUR_MEMBER_CALL(val, ent, name, vec); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CAttributeManager_ClearCache) { - DETOUR_MEMBER_CALL(CAttributeManager_ClearCache)(); + DETOUR_MEMBER_CALL(); auto mgr = reinterpret_cast(this); if (mgr->m_hOuter != nullptr) { @@ -267,13 +267,13 @@ namespace Mod::Perf::Attributes_Optimize DETOUR_DECL_MEMBER(void, CEconEntity_UpdateOnRemove) { - DETOUR_MEMBER_CALL(CEconEntity_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); RemoveAttributeManager(reinterpret_cast(this)); } DETOUR_DECL_MEMBER(void, CTFPlayer_UpdateOnRemove) { - DETOUR_MEMBER_CALL(CTFPlayer_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); RemoveAttributeManager(reinterpret_cast(this)); } diff --git a/src/mod/perf/clientside_wearable_optimize.cpp b/src/mod/perf/clientside_wearable_optimize.cpp index 1f1d9573..a9aafd98 100644 --- a/src/mod/perf/clientside_wearable_optimize.cpp +++ b/src/mod/perf/clientside_wearable_optimize.cpp @@ -22,7 +22,7 @@ namespace Mod::Perf::Clientside_Wearable_Optimize DETOUR_DECL_MEMBER(void, CBasePlayer_EquipWearable, CEconWearable *wearable) { - DETOUR_MEMBER_CALL(CBasePlayer_EquipWearable)(wearable); + DETOUR_MEMBER_CALL(wearable); auto item = wearable->GetItem() ; if (item == nullptr) return; THINK_FUNC_SET(wearable, Unfollow, gpGlobals->curtime); diff --git a/src/mod/perf/css_bot_vision_optimize.cpp b/src/mod/perf/css_bot_vision_optimize.cpp index 3aaaf0e4..60a2b09f 100644 --- a/src/mod/perf/css_bot_vision_optimize.cpp +++ b/src/mod/perf/css_bot_vision_optimize.cpp @@ -38,7 +38,7 @@ namespace Mod::Perf::CSS_Bot_Vision_Optimize DETOUR_DECL_MEMBER(Vector *, CCSBot_GetPartPosition, CBasePlayer *player, int partType) { - if (!rc_CCSBot_IsVisible) return DETOUR_MEMBER_CALL(CCSBot_GetPartPosition)(player,partType); + if (!rc_CCSBot_IsVisible) return DETOUR_MEMBER_CALL(player,partType); switch (partType) { case GUT: return &gut_pos; @@ -58,7 +58,7 @@ namespace Mod::Perf::CSS_Bot_Vision_Optimize // case 16: partTypeIndex = 4; break; // } // if (gpGlobals->tickcount > mod->boneOffsetsTick[partTypeIndex] + 6) { - // auto vec = DETOUR_MEMBER_CALL(CCSBot_GetPartPosition)(player,partType); + // auto vec = DETOUR_MEMBER_CALL(player,partType); // mod->boneOffsets[partTypeIndex] = *vec - player->GetAbsOrigin(); // //mod->boneAngleStored[partTypeIndex] = player->GetAbsAngles(); // mod->boneOffsetsTick[partTypeIndex] = gpGlobals->tickcount; @@ -70,11 +70,11 @@ namespace Mod::Perf::CSS_Bot_Vision_Optimize // //Vector boneOffsetResult; // //VectorRotate(boneOffset, player->GetAbsAngles() - mod->boneAngleStored[partTypeIndex], boneOffsetResult); // *bonePosCalculated = player->GetAbsOrigin() + boneOffset; - // //auto vec = DETOUR_MEMBER_CALL(CCSBot_GetPartPosition)(player,partType); + // //auto vec = DETOUR_MEMBER_CALL(player,partType); // //Msg("Diff %f %f %f\n", vec->x - bonePosCalculated->x, vec->y - bonePosCalculated->y, vec->z - bonePosCalculated->z); // return bonePosCalculated; // } - //auto vec = DETOUR_MEMBER_CALL(CCSBot_GetPartPosition)(player,partType); + //auto vec = DETOUR_MEMBER_CALL(player,partType); //Msg("Part %d offset %f %f %f\n", partType, vec->x - player->GetAbsOrigin().x, vec->y - player->GetAbsOrigin().y, vec->z - player->GetAbsOrigin().z); //return vec; } @@ -85,7 +85,7 @@ namespace Mod::Perf::CSS_Bot_Vision_Optimize engine->ResetPVS(m_PVS, m_nPVSSize); auto me = reinterpret_cast(this); engine->AddOriginToPVS(me->EyePosition()); - return DETOUR_MEMBER_CALL(CSBot_FindMostDangerousThreat)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CCSBot_IsVisible, CBasePlayer *player, bool testFov, unsigned char *visParts) @@ -149,7 +149,7 @@ namespace Mod::Perf::CSS_Bot_Vision_Optimize // return false; // } // } - auto ret = DETOUR_MEMBER_CALL(CCSBot_IsVisible)(player,testFov,visParts); + auto ret = DETOUR_MEMBER_CALL(player,testFov,visParts); // static int last_tick = 0; // static int visible_potentially = 0; // static int visible_potentially_not = 0; diff --git a/src/mod/perf/filesystem_optimize.cpp b/src/mod/perf/filesystem_optimize.cpp index 1defca42..f0095fa5 100644 --- a/src/mod/perf/filesystem_optimize.cpp +++ b/src/mod/perf/filesystem_optimize.cpp @@ -18,7 +18,7 @@ namespace Mod::Perf::Filesystem_Optimize V_strlower(output + base_path_len); struct stat stats; return stat(output, &stats) == 0; - //return DETOUR_STATIC_CALL(findFileInDirCaseInsensitive)(file, output, bufSize); + //return DETOUR_STATIC_CALL(file, output, bufSize); } diff --git a/src/mod/perf/flame_breakable_collision.cpp b/src/mod/perf/flame_breakable_collision.cpp index 9fd3c82d..10924536 100644 --- a/src/mod/perf/flame_breakable_collision.cpp +++ b/src/mod/perf/flame_breakable_collision.cpp @@ -9,7 +9,7 @@ namespace Mod::Perf::Flame_Breakable_Collision DETOUR_DECL_MEMBER(void, CTFFlameEntity_FlameThink) { SCOPED_INCREMENT(rc_CTFFlameEntity_FlameThink); - DETOUR_MEMBER_CALL(CTFFlameEntity_FlameThink)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(CBaseEntity *, CGlobalEntityList_FindEntityByClassname, CBaseEntity *pStartEntity, const char *szName, IEntityFindFilter *filter) @@ -18,7 +18,7 @@ namespace Mod::Perf::Flame_Breakable_Collision return nullptr; } - return DETOUR_MEMBER_CALL(CGlobalEntityList_FindEntityByClassname)(pStartEntity, szName, filter); + return DETOUR_MEMBER_CALL(pStartEntity, szName, filter); } diff --git a/src/mod/perf/func_optimize.cpp b/src/mod/perf/func_optimize.cpp index 95fc84b5..f5056f4a 100644 --- a/src/mod/perf/func_optimize.cpp +++ b/src/mod/perf/func_optimize.cpp @@ -194,7 +194,7 @@ namespace Mod::Perf::Func_Optimize DETOUR_DECL_MEMBER(int, CTFPlayerShared_GetCarryingRuneType) { return reinterpret_cast(this)->GetCarryingRuneType(); - //return DETOUR_MEMBER_CALL(CTFPlayerShared_GetCarryingRuneType)(); + //return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_ConditionGameRulesThink) @@ -218,12 +218,12 @@ namespace Mod::Perf::Func_Optimize } } } - DETOUR_MEMBER_CALL(CTFPlayerShared_ConditionGameRulesThink)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFConditionList_Add, ETFCond cond, float duration, CTFPlayer *player, CBaseEntity *provider) { - bool success = DETOUR_MEMBER_CALL(CTFConditionList_Add)(cond, duration, player, provider); + bool success = DETOUR_MEMBER_CALL(cond, duration, player, provider); if (success) { player->m_Shared->GetCondData().AddCondBit(cond); } @@ -232,7 +232,7 @@ namespace Mod::Perf::Func_Optimize DETOUR_DECL_MEMBER(bool, CTFConditionList_Remove, ETFCond cond, bool ignore) { - bool success = DETOUR_MEMBER_CALL(CTFConditionList_Remove)(cond, ignore); + bool success = DETOUR_MEMBER_CALL(cond, ignore); if (success) { auto outer = (CTFPlayerShared *)((char *)this - CTFPlayerShared::s_prop_m_ConditionList.GetOffsetDirect()); outer->GetCondData().RemoveCondBit(cond); @@ -257,7 +257,7 @@ namespace Mod::Perf::Func_Optimize uintptr_t GEconItemSchema_addr = 0; DETOUR_DECL_STATIC(CEconItemSchema *, GEconItemSchema) { - schema = DETOUR_STATIC_CALL(GEconItemSchema)(); + schema = DETOUR_STATIC_CALL(); auto addr = (uint8_t*)__builtin_return_address(0); OptimizeGetSchema(schema, addr, GEconItemSchema_addr); // Msg("addr %d %d %d\n", *(addr2-1), AddrManager::GetAddr("GEconItemSchema"), *(addr2-1) + LibMgr::GetInfo(Library::SERVER).GetSeg(Segment::TEXT).AddrBegin()); @@ -276,7 +276,7 @@ namespace Mod::Perf::Func_Optimize uintptr_t GetItemSchema_addr = 0; DETOUR_DECL_STATIC(CEconItemSchema *, GetItemSchema) { - schema = DETOUR_STATIC_CALL(GetItemSchema)(); + schema = DETOUR_STATIC_CALL(); auto addr = (uint8_t*)__builtin_return_address(0); OptimizeGetSchema(schema, addr, GetItemSchema_addr); return schema; @@ -291,7 +291,7 @@ namespace Mod::Perf::Func_Optimize bool useOrig = false; DETOUR_DECL_MEMBER(void, CBasePlayer_EquipWearable, CEconWearable *wearable) { - DETOUR_MEMBER_CALL(CBasePlayer_EquipWearable)(wearable); + DETOUR_MEMBER_CALL(wearable); auto item = wearable->GetItem() ; if (item == nullptr) return; @@ -310,7 +310,7 @@ namespace Mod::Perf::Func_Optimize DETOUR_DECL_MEMBER(void, CTFPlayer_Weapon_Equip, CBaseCombatWeapon *weapon) { - DETOUR_MEMBER_CALL(CTFPlayer_Weapon_Equip)(weapon); + DETOUR_MEMBER_CALL(weapon); auto item = weapon->GetItem() ; if (item == nullptr) return; @@ -330,7 +330,7 @@ namespace Mod::Perf::Func_Optimize DETOUR_DECL_MEMBER(CBaseEntity *, CTFPlayer_GetEntityForLoadoutSlot, int slot) { - if (useOrig) return DETOUR_MEMBER_CALL(CTFPlayer_GetEntityForLoadoutSlot)(slot); + if (useOrig) return DETOUR_MEMBER_CALL(slot); auto player = reinterpret_cast(this); auto data = GetExtraPlayerData(player, false); @@ -338,7 +338,7 @@ namespace Mod::Perf::Func_Optimize auto handle = data->quickItemInLoadoutSlot[slot]; auto ent = handle.Get(); if (handle.IsValid() && (ent == nullptr || ent->GetOwnerEntity() != player)) { - ent = static_cast(DETOUR_MEMBER_CALL(CTFPlayer_GetEntityForLoadoutSlot)(slot)); + ent = static_cast(DETOUR_MEMBER_CALL(slot)); data->quickItemInLoadoutSlot[slot] = ent; } return ent; @@ -364,7 +364,7 @@ namespace Mod::Perf::Func_Optimize if (index != -1 && !IsDynamicModelIndex(index)) { return index; } - return DETOUR_STATIC_CALL(CBaseEntity_PrecacheModel)(model); + return DETOUR_STATIC_CALL(model); } class CModelLoader {}; @@ -376,11 +376,11 @@ namespace Mod::Perf::Func_Optimize if (index != -1) { return index; } - auto ret = DETOUR_MEMBER_CALL(CModelInfoServer_RegisterDynamicModel)(model, isClient); + auto ret = DETOUR_MEMBER_CALL(model, isClient); CModelLoader_FlushDynamicModels(modelloader.GetRef()); return ret; //return CBaseEntity::PrecacheModel(model); - // if (useOrig) return DETOUR_MEMBER_CALL(CModelInfoServer_RegisterDynamicModel)(model, isClient); + // if (useOrig) return DETOUR_MEMBER_CALL(model, isClient); // auto player = reinterpret_cast(this); // auto data = GetExtraPlayerData(player, false); @@ -388,7 +388,7 @@ namespace Mod::Perf::Func_Optimize // auto handle = data->quickItemInLoadoutSlot[slot]; // auto ent = handle.Get(); // if (handle.IsValid() && (ent == nullptr || ent->GetOwnerEntity() != player)) { - // ent = static_cast(DETOUR_MEMBER_CALL(CTFPlayer_GetEntityForLoadoutSlot)(slot)); + // ent = static_cast(DETOUR_MEMBER_CALL(slot)); // data->quickItemInLoadoutSlot[slot] = ent; // } // return ent; @@ -398,19 +398,19 @@ namespace Mod::Perf::Func_Optimize DETOUR_DECL_MEMBER(void, CMDLCache_BeginLock) { AVERAGE_TIME(begin); - DETOUR_MEMBER_CALL(CMDLCache_BeginLock)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CMDLCache_EndLock) { AVERAGE_TIME(end); - DETOUR_MEMBER_CALL(CMDLCache_EndLock)(); + DETOUR_MEMBER_CALL(); } #ifdef SE_IS_TF2 DETOUR_DECL_STATIC(void, CTFPlayer_PrecacheMvM) { - DETOUR_STATIC_CALL(CTFPlayer_PrecacheMvM)(); + DETOUR_STATIC_CALL(); for (int i = 1; i < TF_CLASS_COUNT; i++) { auto hatDef = GetItemSchema()->GetItemDefinitionByName(g_szRomePromoItems_Hat[i]); auto hatModel = hatDef != nullptr ? hatDef->GetKeyValues()->GetString("model_player") : nullptr; @@ -437,7 +437,7 @@ namespace Mod::Perf::Func_Optimize bool ret; { //AVERAGE_TIME2(SpeakConcept); - ret = DETOUR_MEMBER_CALL(CTFPlayer_SpeakConceptIfAllowed)(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); + ret = DETOUR_MEMBER_CALL(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); } return ret; } @@ -464,7 +464,7 @@ namespace Mod::Perf::Func_Optimize // MemProtModifier_RX_RWX((void *)(caller-5), 5); // memcpy((void *)(caller-5), buf.CPtr(), 5); //} - return DETOUR_MEMBER_CALL(CThreadLocalBase_Get)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBot_AvoidPlayers, CUserCmd *cmd) @@ -473,7 +473,7 @@ namespace Mod::Perf::Func_Optimize if ((bot->entindex() + gpGlobals->tickcount) % 8 == 0) { float forwardPre = cmd->forwardmove; float sidePre = cmd->sidemove; - DETOUR_MEMBER_CALL(CTFBot_AvoidPlayers)(cmd); + DETOUR_MEMBER_CALL(cmd); auto data = GetExtraBotData(bot); data->lastForwardMove = cmd->forwardmove - forwardPre; data->lastSideMove = cmd->sidemove - sidePre; @@ -558,7 +558,7 @@ namespace Mod::Perf::Func_Optimize item_name = item; bot_additem = reinterpret_cast(this); bot_classnum = bot_additem->GetPlayerClass()->GetClassIndex(); - DETOUR_MEMBER_CALL(CTFBot_AddItem)(item); + DETOUR_MEMBER_CALL(item); } DETOUR_DECL_MEMBER(void *, CItemGeneration_GenerateRandomItem, void *criteria, const Vector &vec, const QAngle &ang, const char *name) @@ -577,7 +577,7 @@ namespace Mod::Perf::Func_Optimize return ItemGeneration()->SpawnItem(item_def->m_iItemDefIndex,vec, ang, 6, 9999, item_def->GetItemClass()); } } - return DETOUR_MEMBER_CALL(CItemGeneration_GenerateRandomItem)(criteria,vec,ang, name); + return DETOUR_MEMBER_CALL(criteria,vec,ang, name); } std::unordered_map attributeCache; @@ -591,7 +591,7 @@ namespace Mod::Perf::Func_Optimize if (find != attributeCache.end()) { return find->second; } - auto attr = DETOUR_MEMBER_CALL(CEconItemSchema_GetAttributeDefinitionByName)(name); + auto attr = DETOUR_MEMBER_CALL(name); attributeCache[str] = attr; return attr; } @@ -599,12 +599,12 @@ namespace Mod::Perf::Func_Optimize DETOUR_DECL_MEMBER(void, CEconItemSchema_Reset) { attributeCache.clear(); - DETOUR_MEMBER_CALL(CEconItemSchema_Reset)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CEconItemSchema_BInitAttributes, KeyValues *kv, CUtlVector *errors) { - auto ret = DETOUR_MEMBER_CALL(CEconItemSchema_BInitAttributes)(kv, errors); + auto ret = DETOUR_MEMBER_CALL(kv, errors); attributeCache.clear(); return ret; } @@ -642,7 +642,7 @@ namespace Mod::Perf::Func_Optimize restorebot = true; } int preMaxPlayers = gpGlobals->maxClients; - DETOUR_MEMBER_CALL(CLagCompensationManager_StartLagCompensation)(player, cmd); + DETOUR_MEMBER_CALL(player, cmd); if (restorebot) { player->m_fFlags |= FL_FAKECLIENT; restorebot = false; @@ -654,13 +654,13 @@ namespace Mod::Perf::Func_Optimize if (restorebot) { Msg("Backtracking amount %f\n", gpGlobals->curtime - flTargetTime); } - DETOUR_MEMBER_CALL(CLagCompensationManager_BacktrackPlayer)(player, flTargetTime); + DETOUR_MEMBER_CALL(player, flTargetTime); } DETOUR_DECL_MEMBER(void, CLagCompensationManager_FinishLagCompensation, CBasePlayer *player) { int preMaxPlayers = gpGlobals->maxClients; - DETOUR_MEMBER_CALL(CLagCompensationManager_FinishLagCompensation)(player); + DETOUR_MEMBER_CALL(player); } diff --git a/src/mod/perf/hltv_optimize.cpp b/src/mod/perf/hltv_optimize.cpp index bee28cdf..1c2a7dcf 100644 --- a/src/mod/perf/hltv_optimize.cpp +++ b/src/mod/perf/hltv_optimize.cpp @@ -94,7 +94,7 @@ namespace Mod::Perf::HLTV_Optimize } } - DETOUR_MEMBER_CALL(CHLTVServer_RunFrame)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CHLTVServer_UpdateTick) @@ -113,7 +113,7 @@ namespace Mod::Perf::HLTV_Optimize // if (gpGlobals->tickcount % tickcount != 0) // return; } - DETOUR_MEMBER_CALL(CHLTVServer_UpdateTick)(); + DETOUR_MEMBER_CALL(); } int last_restore_tick = -1; @@ -125,7 +125,7 @@ namespace Mod::Perf::HLTV_Optimize //return; //TIME_SCOPE2(RESTORE); - DETOUR_MEMBER_CALL(CHLTVServer_RestoreTick)(time); + DETOUR_MEMBER_CALL(time); last_restore_tick = time; } @@ -150,13 +150,13 @@ namespace Mod::Perf::HLTV_Optimize } } if (hasChanges/*tick == 0 || (last_change > last_restore_tick && last_change <= tick)*/) { - DETOUR_MEMBER_CALL(CNetworkStringTable_RestoreTick)(tick); + DETOUR_MEMBER_CALL(tick); } } DETOUR_DECL_MEMBER(void, CNetworkStringTable_UpdateMirrorTable, int tick) { - DETOUR_MEMBER_CALL(CNetworkStringTable_UpdateMirrorTable)(tick); + DETOUR_MEMBER_CALL(tick); auto table = reinterpret_cast(this); if (table->m_pMirrorTable != nullptr) { @@ -171,7 +171,7 @@ namespace Mod::Perf::HLTV_Optimize if (player->GetTeamNumber() <= TEAM_SPECTATOR && !player->IsAlive() && gpGlobals->curtime - player->GetDeathTime() > 1.0f && gpGlobals->tickcount % 64 != 0) return; - DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_PhysicsSimulate)(); + DETOUR_MEMBER_CALL(); } #endif @@ -183,12 +183,12 @@ namespace Mod::Perf::HLTV_Optimize return; } - DETOUR_MEMBER_CALL(CBasePlayer_PhysicsSimulate)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(CBaseClient *, CBaseServer_GetFreeClient, netadr_t &adr) { - auto result = DETOUR_MEMBER_CALL(CBaseServer_GetFreeClient)(adr); + auto result = DETOUR_MEMBER_CALL(adr); if (create_hltv_bot == -1 && result != nullptr) { create_hltv_bot = result->m_nClientSlot + 1; } @@ -201,32 +201,32 @@ namespace Mod::Perf::HLTV_Optimize auto player = reinterpret_cast(this); auto edict = ft_CPlayer_GetEdict(player); auto cbaseplayer = reinterpret_cast(edict->GetUnknown()); - auto result = DETOUR_MEMBER_CALL(CPlayer_IsSourceTV)(); + auto result = DETOUR_MEMBER_CALL(); return result || (cbaseplayer != nullptr && (create_hltv_bot == edict->m_EdictIndex || cbaseplayer->IsHLTV())); } DETOUR_DECL_MEMBER(void, CHLTVDemoRecorder_RecordStringTables) { recording = true; - DETOUR_MEMBER_CALL(CHLTVDemoRecorder_RecordStringTables)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CHLTVDemoRecorder_StopRecording_clone) { recording = false; - DETOUR_MEMBER_CALL(CHLTVDemoRecorder_StopRecording_clone)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CHLTVDemoRecorder_StopRecording) { recording = false; - DETOUR_MEMBER_CALL(CHLTVDemoRecorder_StopRecording)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CGameClient_ShouldSendMessages) { auto client = reinterpret_cast(this); - if (!client->m_bIsHLTV) return DETOUR_MEMBER_CALL(CGameClient_ShouldSendMessages)(); + if (!client->m_bIsHLTV) return DETOUR_MEMBER_CALL(); static ConVarRef tv_snapshotrate("tv_snapshotrate"); float restore = FLT_MIN; if (hltvServerEmpty && !recording) { @@ -237,7 +237,7 @@ namespace Mod::Perf::HLTV_Optimize restore = tv_snapshotrate.GetFloat(); tv_snapshotrate.SetValue(cvar_rate_between_rounds.GetFloat()); } - auto result = DETOUR_MEMBER_CALL(CGameClient_ShouldSendMessages)(); + auto result = DETOUR_MEMBER_CALL(); if (restore != FLT_MIN) { tv_snapshotrate.SetValue(restore); } diff --git a/src/mod/perf/input_optimize.cpp b/src/mod/perf/input_optimize.cpp index 0b07ef94..0a8fcba6 100644 --- a/src/mod/perf/input_optimize.cpp +++ b/src/mod/perf/input_optimize.cpp @@ -22,7 +22,7 @@ namespace Mod::Perf::Input_Optimize { CFastTimer timer; timer.Start(); - DETOUR_MEMBER_CALL(CEventQueue_ServiceEvents)(); + DETOUR_MEMBER_CALL(); timer.End(); DevMsg("serviceevents %.9f\n", timer.GetDuration().GetSeconds()); } @@ -32,7 +32,7 @@ namespace Mod::Perf::Input_Optimize DETOUR_DECL_MEMBER(void, CBaseEntityOutput_FireOutput, variant_t Value, CBaseEntity *pActivator, CBaseEntity *pCaller, float fDelay) { static ConVarRef developer("developer"); - //DETOUR_MEMBER_CALL(CBaseEntityOutput_FireOutput)(Value, pActivator, pCaller, fDelay); + //DETOUR_MEMBER_CALL(Value, pActivator, pCaller, fDelay); CBaseEntityOutput *output = reinterpret_cast(this); // // Iterate through all eventactions and fire them off. @@ -111,7 +111,7 @@ namespace Mod::Perf::Input_Optimize } } - //DETOUR_MEMBER_CALL(CBaseEntityOutput_FireOutput)(Value, pActivator, pCaller, fDelay); + //DETOUR_MEMBER_CALL(Value, pActivator, pCaller, fDelay); } DETOUR_DECL_MEMBER(bool, CBaseEntity_AcceptInput, const char *szInputName, CBaseEntity *pActivator, CBaseEntity *pCaller, variant_t Value, int outputID) @@ -119,7 +119,7 @@ namespace Mod::Perf::Input_Optimize static ConVarRef developer("developer"); // loop through the data description list, restoring each data desc block //if (!cvar_real_enable.GetBool()) { - //auto ret = DETOUR_MEMBER_CALL(CBaseEntity_AcceptInput)(szInputName, pActivator, pCaller, Value, outputID); + //auto ret = DETOUR_MEMBER_CALL(szInputName, pActivator, pCaller, Value, outputID); //DevMsg("timeacceptinput %.9f\n", timer.GetDuration().GetSeconds()); //return ret; //} diff --git a/src/mod/perf/medigun_shield_damage_events.cpp b/src/mod/perf/medigun_shield_damage_events.cpp index 29624acd..89000ac5 100644 --- a/src/mod/perf/medigun_shield_damage_events.cpp +++ b/src/mod/perf/medigun_shield_damage_events.cpp @@ -40,7 +40,7 @@ namespace Mod::Perf::Medigun_Shield_Damage_Events } } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } diff --git a/src/mod/perf/medigun_shield_damage_interval.cpp b/src/mod/perf/medigun_shield_damage_interval.cpp index 5d686daf..d876985b 100644 --- a/src/mod/perf/medigun_shield_damage_interval.cpp +++ b/src/mod/perf/medigun_shield_damage_interval.cpp @@ -29,7 +29,7 @@ namespace Mod::Perf::Medigun_Shield_Damage_Interval CTakeDamageInfo newInfo = inputInfo; newInfo.ScaleDamage(interval); - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(newInfo); + return DETOUR_MEMBER_CALL(newInfo); } else { return 0; } @@ -38,7 +38,7 @@ namespace Mod::Perf::Medigun_Shield_Damage_Interval } - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(inputInfo); + return DETOUR_MEMBER_CALL(inputInfo); } class CMod : public IMod diff --git a/src/mod/perf/mvm_load_popfile.cpp b/src/mod/perf/mvm_load_popfile.cpp index a1425bc8..06dfd53b 100644 --- a/src/mod/perf/mvm_load_popfile.cpp +++ b/src/mod/perf/mvm_load_popfile.cpp @@ -12,40 +12,40 @@ namespace Mod::Perf::MvM_Load_Popfile { SCOPED_INCREMENT(rc_CPopulationManager_SetPopulationFilename); TFObjectiveResource()->m_iszMvMPopfileName = AllocPooledString(filename); - DETOUR_MEMBER_CALL(CPopulationManager_SetPopulationFilename)(filename); + DETOUR_MEMBER_CALL(filename); } RefCount rc_tf_mvm_popfile; DETOUR_DECL_STATIC(void, tf_mvm_popfile, const CCommand& args) { SCOPED_INCREMENT(rc_tf_mvm_popfile); - DETOUR_STATIC_CALL(tf_mvm_popfile)(args); + DETOUR_STATIC_CALL(args); } DETOUR_DECL_MEMBER(void, CPopulationManager_ResetMap) { if (rc_tf_mvm_popfile > 0 && rc_CPopulationManager_SetPopulationFilename == 0) return; - DETOUR_MEMBER_CALL(CPopulationManager_ResetMap)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CPopulationManager_JumpToWave; DETOUR_DECL_MEMBER(void, CPopulationManager_JumpToWave, unsigned int wave, float f1) { SCOPED_INCREMENT_IF(rc_CPopulationManager_JumpToWave, f1 == 0); - DETOUR_MEMBER_CALL(CPopulationManager_JumpToWave)(wave, f1); + DETOUR_MEMBER_CALL(wave, f1); } RefCount rc_CTFGameRules_SetupOnRoundStart; DETOUR_DECL_MEMBER(void, CTFGameRules_SetupOnRoundStart) { SCOPED_INCREMENT(rc_CTFGameRules_SetupOnRoundStart); - DETOUR_MEMBER_CALL(CTFGameRules_SetupOnRoundStart)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { if (rc_CPopulationManager_JumpToWave > 0 && rc_CTFGameRules_SetupOnRoundStart == 0) return true; - return DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + return DETOUR_MEMBER_CALL(); } class CMod : public IMod diff --git a/src/mod/perf/sendprop_optimize.cpp b/src/mod/perf/sendprop_optimize.cpp index 18be0633..54aa5db8 100644 --- a/src/mod/perf/sendprop_optimize.cpp +++ b/src/mod/perf/sendprop_optimize.cpp @@ -744,7 +744,7 @@ namespace Mod::Perf::SendProp_Optimize RefCount rc_CHLTVClient_SendSnapshot; DETOUR_DECL_MEMBER(void, CHLTVClient_SendSnapshot, CClientFrame *frame) { SCOPED_INCREMENT(rc_CHLTVClient_SendSnapshot); - DETOUR_MEMBER_CALL(CHLTVClient_SendSnapshot)(frame); + DETOUR_MEMBER_CALL(frame); } DETOUR_DECL_STATIC(void, SendTable_WritePropList, const SendTable *pTable, @@ -763,7 +763,7 @@ namespace Mod::Perf::SendProp_Optimize return; } if (prop_write_offset[objectID].empty()) { - DETOUR_STATIC_CALL(SendTable_WritePropList)(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); + DETOUR_STATIC_CALL(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); return; } CDeltaBitsWriter deltaBitsWriter( pOut ); @@ -787,7 +787,7 @@ namespace Mod::Perf::SendProp_Optimize return; } - DETOUR_STATIC_CALL(SendTable_WritePropList)(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); + DETOUR_STATIC_CALL(pTable, pState, nBits, pOut, objectID, pCheckProps, nCheckProps); } DETOUR_DECL_STATIC(int, SendTable_CullPropsFromProxies, @@ -977,7 +977,7 @@ namespace Mod::Perf::SendProp_Optimize // //timer2.End(); // //DevMsg("Timer encode other %s %.9f\n", GetContainingEntity(edict)->GetClassname() ,timer2.GetDuration().GetSeconds()); // } - //DETOUR_MEMBER_CALL(CParallelProcessor_PackWork_t_Run)(work_do.data(), work_do.size(), maxthreads, pool); + //DETOUR_MEMBER_CALL(work_do.data(), work_do.size(), maxthreads, pool); //DevMsg("duration for %d %f\n", maxthreads, timer.GetDuration().GetSeconds()); } @@ -996,7 +996,7 @@ namespace Mod::Perf::SendProp_Optimize { if (rc_SV_ComputeClientPacks) return; - DETOUR_MEMBER_CALL(CGameClient_SetupPackInfo)(snapshot); + DETOUR_MEMBER_CALL(snapshot); } @@ -1004,7 +1004,7 @@ namespace Mod::Perf::SendProp_Optimize { if (rc_SV_ComputeClientPacks) return; - DETOUR_MEMBER_CALL(CGameClient_SetupPrevPackInfo)(); + DETOUR_MEMBER_CALL(); } uint16_t *areasConnected = nullptr; @@ -1198,7 +1198,7 @@ namespace Mod::Perf::SendProp_Optimize continue; } } - //return DETOUR_MEMBER_CALL(CServerGameEnts_CheckTransmit)(pInfo, pEdictIndices, nEdicts); + //return DETOUR_MEMBER_CALL(pInfo, pEdictIndices, nEdicts); } @@ -1213,7 +1213,7 @@ namespace Mod::Perf::SendProp_Optimize if (areasConnected != nullptr) { return areasConnected[area1] == areasConnected[area2]; } - return DETOUR_MEMBER_CALL(CServerGameEnts_CheckTransmit)(area1, area2); + return DETOUR_MEMBER_CALL(area1, area2); } DETOUR_DECL_STATIC(void, SV_ComputeClientPacks, int clientCount, CGameClient **clients, CFrameSnapshot *snapshot) @@ -1239,7 +1239,7 @@ namespace Mod::Perf::SendProp_Optimize } firstTransmit = true; if (!IsParallel()) { - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); if (firstPack && packinfoOffset != 0) { firstPack = false; @@ -1346,7 +1346,7 @@ namespace Mod::Perf::SendProp_Optimize packWorkFinished.wait(false); SCOPED_INCREMENT(rc_SV_ComputeClientPacks); - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); for (int i = 0; i < clientCount; i++) { CGameClient *client = clients[i]; @@ -1392,19 +1392,19 @@ namespace Mod::Perf::SendProp_Optimize return; } - DETOUR_MEMBER_CALL(CParallelProcessor_CGameClient_Run)(clients, items, maxthreads, pool); + DETOUR_MEMBER_CALL(clients, items, maxthreads, pool); } #ifdef SE_IS_TF2 DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CTFPlayer_AddObject, CBaseObject *object) { - DETOUR_MEMBER_CALL(CTFPlayer_AddObject)(object); + DETOUR_MEMBER_CALL(object); reinterpret_cast(this)->NetworkStateChanged(); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveObject, CBaseObject *object) { - DETOUR_MEMBER_CALL(CTFPlayer_RemoveObject)(object); + DETOUR_MEMBER_CALL(object); reinterpret_cast(this)->NetworkStateChanged(); } @@ -1414,7 +1414,7 @@ namespace Mod::Perf::SendProp_Optimize if (pProvider != shared->GetConditionProvider(nCond)) reinterpret_cast(shared->GetOuter())->NetworkStateChanged(); - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } #endif @@ -1422,7 +1422,7 @@ namespace Mod::Perf::SendProp_Optimize { int oldFlags = pOwner->edict()->m_fStateFlags; - DETOUR_MEMBER_CALL(CAnimationLayer_StudioFrameAdvance)(flInterval, pOwner); + DETOUR_MEMBER_CALL(flInterval, pOwner); if (pOwner->IsPlayer()) pOwner->edict()->m_fStateFlags = oldFlags | (pOwner->edict()->m_fStateFlags & ~(FL_FULL_EDICT_CHANGED)); } @@ -1434,7 +1434,7 @@ namespace Mod::Perf::SendProp_Optimize { auto &flags = reinterpret_cast(this)->edict()->m_fStateFlags; int oldFlags = flags; - DETOUR_MEMBER_CALL(CBaseAnimatingOverlay_FastRemoveLayer)(layer); + DETOUR_MEMBER_CALL(layer); if (reinterpret_cast(this)->IsPlayer()) flags = oldFlags | (flags & ~(FL_FULL_EDICT_CHANGED)); } @@ -1442,7 +1442,7 @@ namespace Mod::Perf::SendProp_Optimize {; auto &flags = reinterpret_cast(this)->edict()->m_fStateFlags; int oldFlags = flags; - DETOUR_MEMBER_CALL(CBaseAnimatingOverlay_StudioFrameAdvance)(); + DETOUR_MEMBER_CALL(); if (reinterpret_cast(this)->IsPlayer()) flags = oldFlags | (flags & ~(FL_FULL_EDICT_CHANGED)); } @@ -1450,7 +1450,7 @@ namespace Mod::Perf::SendProp_Optimize { auto &flags = reinterpret_cast(this)->edict()->m_fStateFlags; int oldFlags = flags; - DETOUR_MEMBER_CALL(CBaseAnimatingOverlay_SetLayerCycle)(layer, cycle); + DETOUR_MEMBER_CALL(layer, cycle); if (reinterpret_cast(this)->IsPlayer()) flags = oldFlags | (flags & ~(FL_FULL_EDICT_CHANGED)); } @@ -1459,7 +1459,7 @@ namespace Mod::Perf::SendProp_Optimize { auto &flags = reinterpret_cast(this)->m_pPlayer->edict()->m_fStateFlags; int oldFlags = flags; - DETOUR_MEMBER_CALL(CMultiPlayerAnimState_AddToGestureSlot)(iGestureSlot, iGestureActivity, bAutoKill); + DETOUR_MEMBER_CALL(iGestureSlot, iGestureActivity, bAutoKill); flags = oldFlags | (flags & ~(FL_FULL_EDICT_CHANGED)); } @@ -1467,7 +1467,7 @@ namespace Mod::Perf::SendProp_Optimize { auto &flags = reinterpret_cast(this)->m_pPlayer->edict()->m_fStateFlags; int oldFlags = flags; - DETOUR_MEMBER_CALL(CMultiPlayerAnimState_RestartGesture)(iGestureSlot, iGestureActivity, bAutoKill); + DETOUR_MEMBER_CALL(iGestureSlot, iGestureActivity, bAutoKill); flags = oldFlags | (flags & ~(FL_FULL_EDICT_CHANGED)); } #endif @@ -1481,12 +1481,12 @@ namespace Mod::Perf::SendProp_Optimize prop_value_old[edict->m_EdictIndex].clear(); entity_frame_bit_size[edict->m_EdictIndex] = 0; } - DETOUR_MEMBER_CALL(CBaseEntity_D2)(); + DETOUR_MEMBER_CALL(); } /*DETOUR_DECL_MEMBER(int, SendTable_WriteAllDeltaProps, int iTick, int *iOutProps, int nMaxOutProps) { - int result = DETOUR_MEMBER_CALL(SendTable_WriteAllDeltaProps)(iTick, iOutProps, nMaxOutProps); + int result = DETOUR_MEMBER_CALL(iTick, iOutProps, nMaxOutProps); if (result == -1) result = 0 return result; @@ -1505,7 +1505,7 @@ namespace Mod::Perf::SendProp_Optimize SCOPED_INCREMENT_IF(rc_SendTable_WriteAllDeltaProps, nObjectID != -1); //if (nObjectID != -1) // DevMsg("F %s\n", pTable->GetName()); - return DETOUR_STATIC_CALL(SendTable_WriteAllDeltaProps)(pTable, pFromData, nFromDataBits, pToData, nToDataBits, nObjectID, pBufOut); + return DETOUR_STATIC_CALL(pTable, pFromData, nFromDataBits, pToData, nToDataBits, nObjectID, pBufOut); } DETOUR_DECL_STATIC(IChangeFrameList*, AllocChangeFrameList, int nProperties, int iCurTick) @@ -1518,7 +1518,7 @@ namespace Mod::Perf::SendProp_Optimize #ifdef SE_IS_TF2 DETOUR_DECL_MEMBER(void, CPopulationManager_SetPopulationFilename, const char *filename) { - DETOUR_MEMBER_CALL(CPopulationManager_SetPopulationFilename)(filename); + DETOUR_MEMBER_CALL(filename); // Original function uses MAKE_STRING to set file name, which is bad if (TFObjectiveResource() != nullptr) { TFObjectiveResource()->m_iszMvMPopfileName = AllocPooledString(filename); @@ -1569,14 +1569,14 @@ namespace Mod::Perf::SendProp_Optimize DETOUR_DECL_MEMBER(void, CBasePlayer_Event_Killed, const CTakeDamageInfo& info) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBasePlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); THINK_FUNC_SET(player,SetVisibleStateDelay, gpGlobals->curtime + 0.5f); } DETOUR_DECL_MEMBER(void, CTFWeaponBase_OnActiveStateChanged, int oldState) { auto weapon = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFWeaponBase_OnActiveStateChanged)(oldState); + DETOUR_MEMBER_CALL(oldState); int state = weapon->m_iState; if (state == WEAPON_IS_ACTIVE) { weapon->edict()->m_fStateFlags &= ~FL_EDICT_DONTSEND; @@ -1590,7 +1590,7 @@ namespace Mod::Perf::SendProp_Optimize DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_OnActiveStateChanged, int oldState) { auto weapon = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseCombatWeapon_OnActiveStateChanged)(oldState); + DETOUR_MEMBER_CALL(oldState); int state = weapon->m_iState; if (state == WEAPON_IS_ACTIVE) { weapon->edict()->m_fStateFlags &= ~FL_EDICT_DONTSEND; @@ -1608,7 +1608,7 @@ namespace Mod::Perf::SendProp_Optimize DETOUR_DECL_MEMBER(void, CBasePlayer_Spawn) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBasePlayer_Spawn)(); + DETOUR_MEMBER_CALL(); player->edict()->m_fStateFlags &= ~FL_EDICT_DONTSEND; #ifdef SE_IS_TF2 for (int i = 0; i < player->GetNumWearables(); i++) { diff --git a/src/mod/perf/smokestack_fs_thrash.cpp b/src/mod/perf/smokestack_fs_thrash.cpp index 7a5813c5..9cb5a4a1 100644 --- a/src/mod/perf/smokestack_fs_thrash.cpp +++ b/src/mod/perf/smokestack_fs_thrash.cpp @@ -25,7 +25,7 @@ namespace Mod::Perf::SmokeStack_FS_Thrash return true; } - return DETOUR_MEMBER_CALL(CSmokeStack_KeyValue)(szKeyName, szValue); + return DETOUR_MEMBER_CALL(szKeyName, szValue); } diff --git a/src/mod/perf/squad_escort_optimize.cpp b/src/mod/perf/squad_escort_optimize.cpp index cd7fc0bf..e3d6aefe 100644 --- a/src/mod/perf/squad_escort_optimize.cpp +++ b/src/mod/perf/squad_escort_optimize.cpp @@ -89,7 +89,7 @@ namespace Mod::Perf::Squad_Escort_Optimize auto action = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFBotEscortSquadLeader_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (!updatecall) { if (result.transition == ActionTransition::CONTINUE) @@ -122,14 +122,14 @@ namespace Mod::Perf::Squad_Escort_Optimize { auto ai = reinterpret_cast(this); OnDestroy(ai); - DETOUR_MEMBER_CALL(CTFBotEscortSquadLeader_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBotEscortSquadLeader_dtor2) { auto ai = reinterpret_cast(this); OnDestroy(ai); - DETOUR_MEMBER_CALL(CTFBotEscortSquadLeader_dtor2)(); + DETOUR_MEMBER_CALL(); } class CMod : public IMod, public IModCallbackListener diff --git a/src/mod/perf/virtual_call_optimize.cpp b/src/mod/perf/virtual_call_optimize.cpp index 9250469e..074fb26f 100644 --- a/src/mod/perf/virtual_call_optimize.cpp +++ b/src/mod/perf/virtual_call_optimize.cpp @@ -695,7 +695,7 @@ namespace Mod::Perf::Virtual_Call_Optimize } DETOUR_DECL_MEMBER(void *, CBaseEntity_GetNetworkable) { - void *result = DETOUR_MEMBER_CALL(CBaseEntity_GetNetworkable)(); + void *result = DETOUR_MEMBER_CALL(); auto addr = (uint8_t*)__builtin_return_address(0); if (addr[-3] == 0xFF && addr[-1] == 0x14) { static const uintptr_t offset = (uintptr_t) result - (uintptr_t)this; @@ -705,7 +705,7 @@ namespace Mod::Perf::Virtual_Call_Optimize } DETOUR_DECL_MEMBER(void *, CBaseEntity_GetCollideable) { - void *result = DETOUR_MEMBER_CALL(CBaseEntity_GetCollideable)(); + void *result = DETOUR_MEMBER_CALL(); auto addr = (uint8_t*)__builtin_return_address(0); if (addr[-3] == 0xFF && addr[-1] == 0x10) { static const uintptr_t offset = (uintptr_t) result - (uintptr_t)this; @@ -715,7 +715,7 @@ namespace Mod::Perf::Virtual_Call_Optimize } DETOUR_DECL_MEMBER(void *, CBaseEntity_GetRefEHandle) { - void *result = DETOUR_MEMBER_CALL(CBaseEntity_GetRefEHandle)(); + void *result = DETOUR_MEMBER_CALL(); auto addr = (uint8_t*)__builtin_return_address(0); if (addr[-3] == 0xFF && addr[-1] == 0x0c) { static const uintptr_t offset = (uintptr_t) result - (uintptr_t)this; @@ -731,7 +731,7 @@ namespace Mod::Perf::Virtual_Call_Optimize if (addr[-3] == 0xFF && addr[-1] == 0x08) { OptimizeVirtual(addr, 0x08, 0, 0x0C); } - return DETOUR_MEMBER_CALL(CServerNetworkProperty_GetEdict)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void *, CServerNetworkProperty_GetEntityHandle) { @@ -740,12 +740,12 @@ namespace Mod::Perf::Virtual_Call_Optimize if (addr[-3] == 0xFF && addr[-1] == 0x00) { OptimizeVirtual(addr, 0x00, 0, 0x08); } - return DETOUR_MEMBER_CALL(CServerNetworkProperty_GetEntityHandle)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void *, CServerNetworkProperty_GetServerClass) { //Not optimizable - return DETOUR_MEMBER_CALL(CServerNetworkProperty_GetServerClass)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void *, CServerNetworkProperty_GetBaseEntity) { @@ -753,7 +753,7 @@ namespace Mod::Perf::Virtual_Call_Optimize if (addr[-3] == 0xFF && addr[-1] == 0x1c) { OptimizeVirtual(addr, 0x1c, 0, 0x08); } - return DETOUR_MEMBER_CALL(CServerNetworkProperty_GetBaseEntity)(); + return DETOUR_MEMBER_CALL(); } CProp_DataMap prop_classname("CBaseEntity", "m_iClassname", nullptr); DETOUR_DECL_MEMBER(void *, CServerNetworkProperty_GetClassName) @@ -762,12 +762,12 @@ namespace Mod::Perf::Virtual_Call_Optimize if (addr[-3] == 0xFF && addr[-1] == 0x0c) { OptimizeVirtual(addr, 0x0c, 0, 0x08, prop_classname.GetOffsetDirect()); } - return DETOUR_MEMBER_CALL(CServerNetworkProperty_GetClassName)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void *, CServerNetworkProperty_GetPVSInfo) { - void *result = DETOUR_MEMBER_CALL(CServerNetworkProperty_GetPVSInfo)(); + void *result = DETOUR_MEMBER_CALL(); auto addr = (uint8_t*)__builtin_return_address(0); if (addr[-3] == 0xFF && addr[-1] == 0x20) { @@ -785,26 +785,26 @@ namespace Mod::Perf::Virtual_Call_Optimize if (addr[-3] == 0xFF && addr[-1] == 0x1c) { OptimizeVirtual(addr, 0x1C, 0, prop_model_index.GetOffsetDirect(), INT_MIN, DEREF_SHORT); } - return DETOUR_MEMBER_CALL(CBaseEntity_GetModelIndex)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void *, CCollisionProperty_GetEntityHandle) { OptimizeVirtual((uint8_t*)__builtin_return_address(0), 0x00, 0, 0x04); - void *result = DETOUR_MEMBER_CALL(CCollisionProperty_GetEntityHandle)(); + void *result = DETOUR_MEMBER_CALL(); return result; } DETOUR_DECL_MEMBER(int, CCollisionProperty_GetSolid) { OptimizeVirtual((uint8_t*)__builtin_return_address(0), 0x34, 0, 0x41, INT_MIN, DEREF_BYTE); - return DETOUR_MEMBER_CALL(CCollisionProperty_GetSolid)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CCollisionProperty_GetSolidFlags) { OptimizeVirtual((uint8_t*)__builtin_return_address(0), 0x38, 0, 0x3c, INT_MIN, DEREF_SHORT); - return DETOUR_MEMBER_CALL(CCollisionProperty_GetSolidFlags)(); + return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/pop/ecattr_extensions.cpp b/src/mod/pop/ecattr_extensions.cpp index 624d8a5d..c5c28e00 100644 --- a/src/mod/pop/ecattr_extensions.cpp +++ b/src/mod/pop/ecattr_extensions.cpp @@ -328,7 +328,7 @@ namespace Mod::Pop::ECAttr_Extensions // DevMsg("CTFBot %08x: dtor0, clearing data\n", (uintptr_t)bot); ClearDataForBot(bot, DESTRUCT); - DETOUR_MEMBER_CALL(CTFBot_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBot_dtor2) @@ -338,7 +338,7 @@ namespace Mod::Pop::ECAttr_Extensions // DevMsg("CTFBot %08x: dtor2, clearing data\n", (uintptr_t)bot); ClearDataForBot(bot, DESTRUCT); - DETOUR_MEMBER_CALL(CTFBot_dtor2)(); + DETOUR_MEMBER_CALL(); } @@ -353,7 +353,7 @@ namespace Mod::Pop::ECAttr_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_StateEnter)(nState); + DETOUR_MEMBER_CALL(nState); } DETOUR_DECL_MEMBER(void, CTFPlayer_StateLeave) @@ -368,7 +368,7 @@ namespace Mod::Pop::ECAttr_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_StateLeave)(); + DETOUR_MEMBER_CALL(); } @@ -417,7 +417,7 @@ namespace Mod::Pop::ECAttr_Extensions spawner_ecattr.clear(); - auto result = DETOUR_MEMBER_CALL(CTFBotSpawner_Parse)(kv_orig); + auto result = DETOUR_MEMBER_CALL(kv_orig); CTFBot::EventChangeAttributes_t *default_ecattr = nullptr; for (int i = 0; i < spawner->m_ECAttrs.Count(); i++) { @@ -764,7 +764,7 @@ namespace Mod::Pop::ECAttr_Extensions if (&ecattr != &last_spawner->m_ECAttrs[i] && FStrEq(last_spawner->m_ECAttrs[i].m_strName.Get(), ecattr.m_strName.Get())) { parse_dynamic_index = i + 1; - bool result = Detour_ParseDynamicAttributes(current_spawner->m_ECAttrs[i], kv); + bool result = detour_ns_ParseDynamicAttributes::Detour(current_spawner->m_ECAttrs[i], kv); parse_dynamic_index = 0; return result; @@ -787,7 +787,7 @@ namespace Mod::Pop::ECAttr_Extensions for (int i = 0; i < current_spawner->m_ECAttrs.Count(); i++) { parse_dynamic_index = i + 1; - if (!Detour_ParseDynamicAttributes(current_spawner->m_ECAttrs[i], kv)){ + if (!detour_ns_ParseDynamicAttributes::Detour(current_spawner->m_ECAttrs[i], kv)){ parse_dynamic_index = 0; return false; } @@ -950,7 +950,7 @@ namespace Mod::Pop::ECAttr_Extensions return true; if (!cvar_creators_custom_item.GetBool()) - return DETOUR_STATIC_CALL(ParseDynamicAttributes)(ecattr, kv); + return DETOUR_STATIC_CALL(ecattr, kv); //DevMsg("ParseDynamicAttributesTFBot: \"%s\" \"%s\"\n", kv->GetName(), kv->GetString()); @@ -1042,13 +1042,13 @@ namespace Mod::Pop::ECAttr_Extensions //DevMsg("put event changed attributes data %s %d %d\n",item_name.c_str(), attribs.size(), &ecattr); } //DevMsg(" Passing through to actual ParseDynamicAttributes\n"); - return DETOUR_STATIC_CALL(ParseDynamicAttributes)(ecattr, kv); + return DETOUR_STATIC_CALL(ecattr, kv); } DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { ClearAllData(); - return DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFBotSpawner_ParseEventChangeAttributes, KeyValues *data) @@ -1062,7 +1062,7 @@ namespace Mod::Pop::ECAttr_Extensions default_ecattr = &reinterpret_cast(this)->m_DefaultAttrs; last_ecattr = nullptr; last_spawner = reinterpret_cast(this); - bool result = DETOUR_MEMBER_CALL(CTFBotSpawner_ParseEventChangeAttributes)(data); + bool result = DETOUR_MEMBER_CALL(data); default_ecattr = nullptr; return result; @@ -1396,7 +1396,7 @@ namespace Mod::Pop::ECAttr_Extensions { SCOPED_INCREMENT(rc_CTFBotSpawner_Spawn); auto spawner = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CTFBotSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); // Delay execution of the first event change attributes if (result) { @@ -1484,7 +1484,7 @@ namespace Mod::Pop::ECAttr_Extensions bot->EquipBestWeaponForThreat(nullptr); } - DETOUR_MEMBER_CALL(CTFBot_OnEventChangeAttributes)(ecattr); + DETOUR_MEMBER_CALL(ecattr); if (!rc_CTFBotSpawner_Spawn) @@ -1518,7 +1518,7 @@ namespace Mod::Pop::ECAttr_Extensions DETOUR_DECL_MEMBER(int, CTFItemDefinition_GetLoadoutSlot, int classIndex) { - int slot = DETOUR_MEMBER_CALL(CTFItemDefinition_GetLoadoutSlot)(classIndex); + int slot = DETOUR_MEMBER_CALL(classIndex); return !rc_CTFBot_OnEventChangeAttributes ? slot : LoadoutSlotReplace(slot, reinterpret_cast(this), classIndex); } @@ -1582,7 +1582,7 @@ namespace Mod::Pop::ECAttr_Extensions } else - ret = DETOUR_MEMBER_CALL(CItemGeneration_GenerateRandomItem)(criteria,vec,ang, name); + ret = DETOUR_MEMBER_CALL(criteria,vec,ang, name); } else { if (item_def->m_iItemDefIndex >= 30143 && item_def->m_iItemDefIndex <= 30161 && bot_additem != nullptr && bot_additem->entindex() > MAX_PLAYERS) { @@ -1596,12 +1596,12 @@ namespace Mod::Pop::ECAttr_Extensions return ret; } - return DETOUR_MEMBER_CALL(CItemGeneration_GenerateRandomItem)(criteria,vec,ang, name); + return DETOUR_MEMBER_CALL(criteria,vec,ang, name); } DETOUR_DECL_MEMBER(bool, CTFBot_EquipRequiredWeapon) { - auto result = DETOUR_MEMBER_CALL(CTFBot_EquipRequiredWeapon)(); + auto result = DETOUR_MEMBER_CALL(); if (!result) { auto bot = reinterpret_cast(this); @@ -1622,21 +1622,21 @@ namespace Mod::Pop::ECAttr_Extensions DETOUR_DECL_MEMBER(CEconItemDefinition *, CEconItemSchema_GetItemDefinitionByName, const char *name) { name = Mod::Pop::PopMgr_Extensions::GetCustomWeaponNameOverride(name); - return DETOUR_MEMBER_CALL(CEconItemSchema_GetItemDefinitionByName)(name); + return DETOUR_MEMBER_CALL(name); } DETOUR_DECL_MEMBER(CEconItemDefinition *, CEconItemSchema_GetItemDefinitionByName2, const char *name) { name = Mod::Pop::PopMgr_Extensions::GetCustomWeaponNameOverride(name); - return DETOUR_MEMBER_CALL(CEconItemSchema_GetItemDefinitionByName)(name); + return DETOUR_MEMBER_CALL(name); } // DETOUR_DECL_MEMBER(void *, CSchemaFieldHandle_CEconItemDefinition, const char* name) { // DevMsg("CShemaItemDefHandle 1 %s %d\n",name, rc_CTFBot_OnEventChangeAttributes); - // return DETOUR_MEMBER_CALL(CSchemaFieldHandle_CEconItemDefinition)(name); + // return DETOUR_MEMBER_CALL(name); // } // DETOUR_DECL_MEMBER(void *, CSchemaFieldHandle_CEconItemDefinition2, const char* name) { // DevMsg("CShemaItemDefHandle 2 %s %d\n",name, rc_CTFBot_OnEventChangeAttributes); - // return DETOUR_MEMBER_CALL(CSchemaFieldHandle_CEconItemDefinition2)(name); + // return DETOUR_MEMBER_CALL(name); // } DETOUR_DECL_MEMBER(void, CTFBot_AddItem, const char *item) @@ -1646,7 +1646,7 @@ namespace Mod::Pop::ECAttr_Extensions item_name = item; bot_additem = reinterpret_cast(this); bot_classnum = bot_additem->GetPlayerClass()->GetClassIndex(); - DETOUR_MEMBER_CALL(CTFBot_AddItem)(item); + DETOUR_MEMBER_CALL(item); } bool ShouldRocketJump(CTFBot *bot, EventChangeAttributesData *data, bool release_fire) { @@ -1695,7 +1695,7 @@ namespace Mod::Pop::ECAttr_Extensions aim = subject->EyePosition(); } else - aim = DETOUR_MEMBER_CALL(CTFBotMainAction_SelectTargetPoint)(nextbot,subject); + aim = DETOUR_MEMBER_CALL(nextbot,subject); aim += data->aim_offset; @@ -1722,7 +1722,7 @@ namespace Mod::Pop::ECAttr_Extensions return aim; } } - return DETOUR_MEMBER_CALL(CTFBotMainAction_SelectTargetPoint)(nextbot,subject); + return DETOUR_MEMBER_CALL(nextbot,subject); } ConVar cvar_head_tracking_interval("sig_head_tracking_interval_multiplier", "1", FCVAR_GAMEDLL, @@ -1740,7 +1740,7 @@ namespace Mod::Pop::ECAttr_Extensions return data->tracking_interval; } else - return DETOUR_MEMBER_CALL(CTFBotBody_GetHeadAimTrackingInterval)() * mult; + return DETOUR_MEMBER_CALL() * mult; } @@ -1765,7 +1765,7 @@ namespace Mod::Pop::ECAttr_Extensions if (data != nullptr && data->tracking_interval >= 0.f && data->tracking_interval < 0.05f) return 10000.0f; else - return VHOOK_CALL(PlayerBody_GetMaxHeadAngularVelocity)(); + return VHOOK_CALL(); } DETOUR_DECL_MEMBER(void, CTFBotMainAction_FireWeaponAtEnemy, CTFBot *actor) @@ -1803,7 +1803,7 @@ namespace Mod::Pop::ECAttr_Extensions } } } - DETOUR_MEMBER_CALL(CTFBotMainAction_FireWeaponAtEnemy)(actor); + DETOUR_MEMBER_CALL(actor); if (data != nullptr && data->rocket_jump_type > 0 && weapon != nullptr && !weapon->IsMeleeWeapon()) { const CKnownEntity *threat = actor->GetVisionInterface()->GetPrimaryKnownThreat(false); if (weapon != nullptr && (data->rocket_jump_type == 1 || weapon->m_iClip1 >= weapon->GetMaxClip1()) && threat != nullptr && threat->GetEntity() != nullptr && actor->IsLineOfFireClear( threat->GetEntity()->EyePosition() )/*&& ShouldRocketJump(actor, weapon, data, true)*//*weapon != nullptr*/) { @@ -1864,9 +1864,9 @@ namespace Mod::Pop::ECAttr_Extensions eEntityByName, const char *className, int iForceEdictIndex) { if (rc_CTFBot_AddItem > 0) { - return DETOUR_STATIC_CALL(CreateEntityByName)(TranslateWeaponEntForClass_improved(className,bot_classnum), iForceEdictIndex); + return DETOUR_STATIC_CALL(TranslateWeaponEntForClass_improved(className,bot_classnum), iForceEdictIndex); } - return DETOUR_STATIC_CALL(CreateEntityByName)(className, iForceEdictIndex); + return DETOUR_STATIC_CALL(className, iForceEdictIndex); }*/ bool IsRangeGreaterThan( CBaseEntity *bot, const Vector &pos, float range) @@ -1882,7 +1882,7 @@ namespace Mod::Pop::ECAttr_Extensions bool mannvsmachine = TFGameRules()->IsMannVsMachineMode(); if (!mannvsmachine || threat == nullptr || threat->GetEntity() == nullptr) { - DETOUR_MEMBER_CALL(CTFBot_EquipBestWeaponForThreat)(threat); + DETOUR_MEMBER_CALL(threat); return; } @@ -1926,7 +1926,7 @@ namespace Mod::Pop::ECAttr_Extensions if (use_best_weapon) TFGameRules()->Set_m_bPlayingMannVsMachine(false); - DETOUR_MEMBER_CALL(CTFBot_EquipBestWeaponForThreat)(threat); + DETOUR_MEMBER_CALL(threat); if (use_best_weapon) TFGameRules()->Set_m_bPlayingMannVsMachine(mannvsmachine); @@ -1973,7 +1973,7 @@ namespace Mod::Pop::ECAttr_Extensions } } - return DETOUR_MEMBER_CALL(CTFBotMainAction_SelectMoreDangerousThreatInternal)(nextbot, them, threat1, threat2); + return DETOUR_MEMBER_CALL(nextbot, them, threat1, threat2); } DETOUR_DECL_MEMBER(bool,CTFBotDeliverFlag_UpgradeOverTime, CTFBot *bot) @@ -1982,7 +1982,7 @@ namespace Mod::Pop::ECAttr_Extensions if (data != nullptr && data->no_bomb_upgrade) { return false; } - return DETOUR_MEMBER_CALL(CTFBotDeliverFlag_UpgradeOverTime)(bot); + return DETOUR_MEMBER_CALL(bot); } @@ -1999,7 +1999,7 @@ namespace Mod::Pop::ECAttr_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_PainSound)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CTFPlayer_DeathSound, const CTakeDamageInfo& info) @@ -2015,7 +2015,7 @@ namespace Mod::Pop::ECAttr_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_DeathSound)(info); + DETOUR_MEMBER_CALL(info); } void UpdateAlwaysGlow() @@ -2098,11 +2098,11 @@ namespace Mod::Pop::ECAttr_Extensions } } - return DETOUR_MEMBER_CALL(CTFGameRules_ApplyOnDamageModifyRules)(info, pVictim, b1); + return DETOUR_MEMBER_CALL(info, pVictim, b1); } DETOUR_DECL_MEMBER(CTFProjectile_Rocket *, CTFWeaponBaseGun_FireRocket, CTFPlayer *player, int i1) { - auto proj = DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireRocket)(player, i1); + auto proj = DETOUR_MEMBER_CALL(player, i1); if (proj != nullptr) { auto data = GetDataForBot(proj->GetOwnerEntity()); @@ -2127,7 +2127,7 @@ namespace Mod::Pop::ECAttr_Extensions DETOUR_DECL_MEMBER(void, CTFWeaponBase_ApplyOnHitAttributes, CBaseEntity *ent, CTFPlayer *player, const CTakeDamageInfo& info) { - DETOUR_MEMBER_CALL(CTFWeaponBase_ApplyOnHitAttributes)(ent, player, info); + DETOUR_MEMBER_CALL(ent, player, info); CTFPlayer *victim = ToTFPlayer(ent); CTFBot *attacker = ToTFBot(player); @@ -2145,7 +2145,7 @@ namespace Mod::Pop::ECAttr_Extensions DETOUR_DECL_MEMBER(void, CTFProjectile_Rocket_Spawn) { - DETOUR_MEMBER_CALL(CTFProjectile_Rocket_Spawn)(); + DETOUR_MEMBER_CALL(); auto rocket = reinterpret_cast(this); @@ -2181,9 +2181,9 @@ namespace Mod::Pop::ECAttr_Extensions if (player->IsBot() && HasRobotHumanVoice(player)) { return ""; } - //const char *token=DETOUR_MEMBER_CALL( CTFPlayer_GetSceneSoundToken)(); + //const char *token=DETOUR_MEMBER_CALL(); //DevMsg("CTFPlayer::GetSceneSoundToken %s\n", token); - return DETOUR_MEMBER_CALL( CTFPlayer_GetSceneSoundToken)(); + return DETOUR_MEMBER_CALL(); } // std::string GetStrForEntity(CBaseEntity *ent) @@ -2276,7 +2276,7 @@ namespace Mod::Pop::ECAttr_Extensions hr = &mod->data; } if (hr == nullptr || !hr->enable) { - DETOUR_MEMBER_CALL(CBaseEntity_PerformCustomPhysics)(pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity); + DETOUR_MEMBER_CALL(pNewPosition, pNewVelocity, pNewAngles, pNewAngVelocity); return; } @@ -2384,13 +2384,13 @@ namespace Mod::Pop::ECAttr_Extensions if (data != nullptr) { bool stopproj; bool smacked = false; - TemplateShootSpawn(data->shoot_templ, player, weapon, stopproj, [&](){ smacked = true; DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); return nullptr; }); + TemplateShootSpawn(data->shoot_templ, player, weapon, stopproj, [&](){ smacked = true; DETOUR_MEMBER_CALL(); return nullptr; }); if (stopproj || smacked) { return; } } } - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); + DETOUR_MEMBER_CALL(); } @@ -2402,7 +2402,7 @@ namespace Mod::Pop::ECAttr_Extensions if (data != nullptr) { bool stopproj = false; auto weapon = reinterpret_cast(this); - auto proj = TemplateShootSpawn(data->shoot_templ, player, weapon, stopproj, [&](){ return DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); }); + auto proj = TemplateShootSpawn(data->shoot_templ, player, weapon, stopproj, [&](){ return DETOUR_MEMBER_CALL(player); }); if (proj != nullptr) { return proj; } @@ -2423,7 +2423,7 @@ namespace Mod::Pop::ECAttr_Extensions } } } - return DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); + return DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_WeaponSound, int index, float soundtime) @@ -2439,7 +2439,7 @@ namespace Mod::Pop::ECAttr_Extensions } } } - DETOUR_MEMBER_CALL(CBaseCombatWeapon_WeaponSound)(index, soundtime); + DETOUR_MEMBER_CALL(index, soundtime); } struct NextBotData @@ -2468,7 +2468,7 @@ namespace Mod::Pop::ECAttr_Extensions if (grapplingHook != nullptr) UTIL_Remove(grapplingHook->m_hProjectile); } - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } DETOUR_DECL_MEMBER(void, CTFBot_AvoidPlayers, void *cmd) @@ -2478,37 +2478,37 @@ namespace Mod::Pop::ECAttr_Extensions if (data != nullptr && data->no_pushaway) { return; } - DETOUR_MEMBER_CALL(CTFBot_AvoidPlayers)(cmd); + DETOUR_MEMBER_CALL(cmd); } DETOUR_DECL_MEMBER(float, CTFPlayer_GetHandScaleSpeed) { auto data = GetDataForBot(reinterpret_cast(this)); if (data != nullptr) { - return DETOUR_MEMBER_CALL(CTFPlayer_GetHandScaleSpeed)() * data->scale_speed; + return DETOUR_MEMBER_CALL() * data->scale_speed; } - return DETOUR_MEMBER_CALL(CTFPlayer_GetHandScaleSpeed)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFPlayer_GetHeadScaleSpeed) { auto data = GetDataForBot(reinterpret_cast(this)); if (data != nullptr) { - return DETOUR_MEMBER_CALL(CTFPlayer_GetHeadScaleSpeed)() * data->scale_speed; + return DETOUR_MEMBER_CALL() * data->scale_speed; } - return DETOUR_MEMBER_CALL(CTFPlayer_GetHeadScaleSpeed)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFPlayer_GetTorsoScaleSpeed) { auto data = GetDataForBot(reinterpret_cast(this)); if (data != nullptr) { - return DETOUR_MEMBER_CALL(CTFPlayer_GetTorsoScaleSpeed)() * data->scale_speed; + return DETOUR_MEMBER_CALL() * data->scale_speed; } - return DETOUR_MEMBER_CALL(CTFPlayer_GetTorsoScaleSpeed)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_CTFBotLocomotion_Update; @@ -2516,21 +2516,21 @@ namespace Mod::Pop::ECAttr_Extensions { auto data = GetDataForBot(reinterpret_cast(this)->GetBot()->GetEntity()); SCOPED_INCREMENT_IF(rc_CTFBotLocomotion_Update, data != nullptr && data->no_crouch_button_release); - DETOUR_MEMBER_CALL(CTFBotLocomotion_Update)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, NextBotPlayer_CTFPlayer_PressCrouchButton, float time) { if (rc_CTFBotLocomotion_Update) return; - DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_PressCrouchButton)(time); + DETOUR_MEMBER_CALL(time); } DETOUR_DECL_MEMBER(void, NextBotPlayer_CTFPlayer_ReleaseCrouchButton) { if (rc_CTFBotLocomotion_Update) return; - DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_ReleaseCrouchButton)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFGameRules_PlayerKilled; @@ -2540,7 +2540,7 @@ namespace Mod::Pop::ECAttr_Extensions // DevMsg("CTFGameRules::PlayerKilled\n"); killed = pVictim; SCOPED_INCREMENT(rc_CTFGameRules_PlayerKilled); - DETOUR_MEMBER_CALL(CTFGameRules_PlayerKilled)(pVictim, info); + DETOUR_MEMBER_CALL(pVictim, info); if (TFGameRules()->IsMannVsMachineMode()) { auto *data = GetDataForBot(killed); if (data != nullptr && (data->spell_drop)) { @@ -2571,7 +2571,7 @@ namespace Mod::Pop::ECAttr_Extensions player->EmitSound(data->override_step_sound.c_str()); } } - DETOUR_MEMBER_CALL(CBasePlayer_PlayStepSound)(vecOrigin, psurface, fvol, force); + DETOUR_MEMBER_CALL(vecOrigin, psurface, fvol, force); } RefCount rc_CTFPlayer_OnTakeDamage_Alive; @@ -2581,7 +2581,7 @@ namespace Mod::Pop::ECAttr_Extensions CTFPlayer *player = reinterpret_cast(this); SCOPED_INCREMENT_IF(rc_CTFPlayer_OnTakeDamage_Alive, HasRobotBlood(player)); - auto result = DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage_Alive)(info); + auto result = DETOUR_MEMBER_CALL(info); if (was_bleed) { Vector vDamagePos = info.GetDamagePosition(); @@ -2610,7 +2610,7 @@ namespace Mod::Pop::ECAttr_Extensions auto player = reinterpret_cast(this); SCOPED_INCREMENT_IF(rc_CTFPlayer_Event_Killed, HasRobotBlood(player)); ResetHumanAnimations(ToTFBot(player), GetDataForBot(player)); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_STATIC(void, DispatchParticleEffect, char const *name, Vector vec, QAngle ang, CBaseEntity *entity) @@ -2619,7 +2619,7 @@ namespace Mod::Pop::ECAttr_Extensions was_bleed = true; return; } - DETOUR_STATIC_CALL(DispatchParticleEffect)(name, vec, ang, entity); + DETOUR_STATIC_CALL(name, vec, ang, entity); } DETOUR_DECL_STATIC(void, TE_TFParticleEffect, IRecipientFilter& recipement, float value, char const* name, Vector vector, QAngle angles, CBaseEntity* entity, ParticleAttachment_t attach) @@ -2627,7 +2627,7 @@ namespace Mod::Pop::ECAttr_Extensions if (rc_CTFPlayer_Event_Killed && strcmp(name, "bot_death") == 0) { return; } - DETOUR_STATIC_CALL(TE_TFParticleEffect)(recipement, value, name, vector, angles, entity, attach); + DETOUR_STATIC_CALL(recipement, value, name, vector, angles, entity, attach); } DETOUR_DECL_MEMBER(float, CTFBot_GetDesiredAttackRange) @@ -2641,14 +2641,14 @@ namespace Mod::Pop::ECAttr_Extensions } } - auto result = DETOUR_MEMBER_CALL(CTFBot_GetDesiredAttackRange)(); + auto result = DETOUR_MEMBER_CALL(); return result; } DETOUR_DECL_MEMBER(ActionResult, CTFBotAttack_Update, CTFBot *me, float interval) { - auto result = DETOUR_MEMBER_CALL(CTFBotAttack_Update)(me, interval); + auto result = DETOUR_MEMBER_CALL(me, interval); if (!TFGameRules()->IsMannVsMachineMode()) return result; auto *data = GetDataForBot(me); @@ -2730,7 +2730,7 @@ namespace Mod::Pop::ECAttr_Extensions } } } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } RefCount rc_IVision_IsAbleToSee; @@ -2739,7 +2739,7 @@ namespace Mod::Pop::ECAttr_Extensions if (rc_IVision_IsAbleToSee) { return true; } - return DETOUR_MEMBER_CALL(CNavArea_IsPotentiallyVisible)(area); + return DETOUR_MEMBER_CALL(area); } DETOUR_DECL_MEMBER(bool, IVision_IsAbleToSee, CBaseEntity *subject, int checkFOV, Vector *visibleSpot) @@ -2759,7 +2759,7 @@ namespace Mod::Pop::ECAttr_Extensions } SCOPED_INCREMENT_IF(rc_IVision_IsAbleToSee, wallhack); - return DETOUR_MEMBER_CALL(IVision_IsAbleToSee)(subject,checkFOV, visibleSpot); + return DETOUR_MEMBER_CALL(subject,checkFOV, visibleSpot); } DETOUR_DECL_MEMBER(bool, IVision_IsLineOfSightClearToEntity, CBaseEntity *subject, Vector *visibleSpot) @@ -2767,7 +2767,7 @@ namespace Mod::Pop::ECAttr_Extensions if (rc_IVision_IsAbleToSee) { return true; } - return DETOUR_MEMBER_CALL(IVision_IsLineOfSightClearToEntity)(subject, visibleSpot); + return DETOUR_MEMBER_CALL(subject, visibleSpot); } class CMod : public IMod, public IModCallbackListener, public IFrameUpdatePostEntityThinkListener diff --git a/src/mod/pop/eventpopfile_improvements.cpp b/src/mod/pop/eventpopfile_improvements.cpp index b2e07864..d819a3e1 100644 --- a/src/mod/pop/eventpopfile_improvements.cpp +++ b/src/mod/pop/eventpopfile_improvements.cpp @@ -12,7 +12,7 @@ namespace Mod::Pop::EventPopfile_Improvements DETOUR_DECL_MEMBER(int, CMissionPopulator_UpdateMissionDestroySentries, const Vector& where, CUtlVector> *ents) { SCOPED_INCREMENT(rc_CMissionPopulator_UpdateMissionDestroySentries); - return DETOUR_MEMBER_CALL(CMissionPopulator_UpdateMissionDestroySentries)(where, ents); + return DETOUR_MEMBER_CALL(where, ents); } DETOUR_DECL_MEMBER(void, CTFBot_AddItem, const char *item) @@ -21,13 +21,13 @@ namespace Mod::Pop::EventPopfile_Improvements return; } - DETOUR_MEMBER_CALL(CTFBot_AddItem)(item); + DETOUR_MEMBER_CALL(item); } DETOUR_DECL_MEMBER(void, CPopulationManager_UpdateObjectiveResource) { - DETOUR_MEMBER_CALL(CPopulationManager_UpdateObjectiveResource)(); + DETOUR_MEMBER_CALL(); // ConVarRef tf_forced_holiday("tf_forced_holiday"); // if (TFObjectiveResource()->m_nMvMEventPopfileType != 0u) { @@ -44,7 +44,7 @@ namespace Mod::Pop::EventPopfile_Improvements return true; } - return DETOUR_STATIC_CALL(UTIL_IsHolidayActive)(holiday); + return DETOUR_STATIC_CALL(holiday); } diff --git a/src/mod/pop/extattr/alwaysfireweaponalt.cpp b/src/mod/pop/extattr/alwaysfireweaponalt.cpp index f3e4506a..b00750e7 100644 --- a/src/mod/pop/extattr/alwaysfireweaponalt.cpp +++ b/src/mod/pop/extattr/alwaysfireweaponalt.cpp @@ -15,7 +15,7 @@ namespace Mod::Pop::ExtAttr::AlwaysFireWeaponAlt actor->PressAltFireButton(); } - DETOUR_MEMBER_CALL(CTFBotMainAction_FireWeaponAtEnemy)(actor); + DETOUR_MEMBER_CALL(actor); } diff --git a/src/mod/pop/extattr/ignoretargets.cpp b/src/mod/pop/extattr/ignoretargets.cpp index 36bb301e..633ab2b1 100644 --- a/src/mod/pop/extattr/ignoretargets.cpp +++ b/src/mod/pop/extattr/ignoretargets.cpp @@ -26,7 +26,7 @@ namespace Mod::Pop::ExtAttr::IgnoreTargets return true; } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } diff --git a/src/mod/pop/extattr/parse.cpp b/src/mod/pop/extattr/parse.cpp index cb0e9258..219a9e75 100644 --- a/src/mod/pop/extattr/parse.cpp +++ b/src/mod/pop/extattr/parse.cpp @@ -61,7 +61,7 @@ namespace Mod::Pop::ExtAttr::Parse } //DevMsg(" Passing through to actual ParseDynamicAttributes\n"); - return DETOUR_STATIC_CALL(ParseDynamicAttributes)(ecattr, kv); + return DETOUR_STATIC_CALL(ecattr, kv); } @@ -75,7 +75,7 @@ namespace Mod::Pop::ExtAttr::Parse bot->ExtAttrForModify() = *ext; } - DETOUR_MEMBER_CALL(CTFBot_OnEventChangeAttributes)(ecattr); + DETOUR_MEMBER_CALL(ecattr); } diff --git a/src/mod/pop/extattr/targetstickies.cpp b/src/mod/pop/extattr/targetstickies.cpp index 38142ee1..57e2c09c 100644 --- a/src/mod/pop/extattr/targetstickies.cpp +++ b/src/mod/pop/extattr/targetstickies.cpp @@ -194,7 +194,7 @@ namespace Mod::Pop::ExtAttr::TargetStickies DevMsg("CMissionPopulator::Parse: this = %08x\n", (uintptr_t)this); SCOPED_INCREMENT(rc_CMissionPopulator_Parse); - return DETOUR_MEMBER_CALL(CMissionPopulator_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } DETOUR_DECL_MEMBER(bool, CSpawnLocation_Parse, KeyValues *kv) @@ -215,13 +215,13 @@ namespace Mod::Pop::ExtAttr::TargetStickies } } - return DETOUR_MEMBER_CALL(CSpawnLocation_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } DETOUR_DECL_MEMBER(void, CMissionPopulator_Update) { - DETOUR_MEMBER_CALL(CMissionPopulator_Update)(); + DETOUR_MEMBER_CALL(); CMissionPopulator *realthis = reinterpret_cast(this); @@ -247,7 +247,7 @@ namespace Mod::Pop::ExtAttr::TargetStickies return new CTFBotChaseStickies(); } - return DETOUR_MEMBER_CALL(CTFBotScenarioMonitor_DesiredScenarioAndClassAction)(actor); + return DETOUR_MEMBER_CALL(actor); } @@ -264,7 +264,7 @@ namespace Mod::Pop::ExtAttr::TargetStickies return !FStrEq(ent->GetClassname(), "tf_projectile_pipe_remote"); } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } // DETOUR_DECL_MEMBER(bool, CTFBotVision_IsVisibleEntityNoticed, CBaseEntity *ent) @@ -280,7 +280,7 @@ namespace Mod::Pop::ExtAttr::TargetStickies bool targetsStickies = static_cast(reinterpret_cast(this)->GetBot()->GetEntity())->ExtAttr()[CTFBot::ExtendedAttr::TARGET_STICKIES]; if (!targetsStickies) - DETOUR_MEMBER_CALL(CTFBotVision_CollectPotentiallyVisibleEntities)(ents); + DETOUR_MEMBER_CALL(ents); auto &list = IBaseProjectileAutoList::AutoList(); int list_count = list.Count(); diff --git a/src/mod/pop/kv_conditional.cpp b/src/mod/pop/kv_conditional.cpp index bb41fff0..a2986caf 100644 --- a/src/mod/pop/kv_conditional.cpp +++ b/src/mod/pop/kv_conditional.cpp @@ -19,7 +19,7 @@ namespace Mod::Pop::KV_Conditional DETOUR_DECL_STATIC(bool, EvaluateConditional, const char *str) { - bool result = DETOUR_STATIC_CALL(EvaluateConditional)(str); + bool result = DETOUR_STATIC_CALL(str); if (*str == '[') ++str; bool bNot = (*str == '!'); diff --git a/src/mod/pop/mission_extensions.cpp b/src/mod/pop/mission_extensions.cpp index b1770356..2cd9f58a 100644 --- a/src/mod/pop/mission_extensions.cpp +++ b/src/mod/pop/mission_extensions.cpp @@ -24,7 +24,7 @@ namespace Mod::Pop::Mission_Extensions // DevMsg("CMissionPopulator %08x: dtor0\n", (uintptr_t)mission); missions.erase(mission); - DETOUR_MEMBER_CALL(CMissionPopulator_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CMissionPopulator_dtor2) @@ -34,7 +34,7 @@ namespace Mod::Pop::Mission_Extensions // DevMsg("CMissionPopulator %08x: dtor2\n", (uintptr_t)mission); missions.erase(mission); - DETOUR_MEMBER_CALL(CMissionPopulator_dtor2)(); + DETOUR_MEMBER_CALL(); } @@ -73,7 +73,7 @@ namespace Mod::Pop::Mission_Extensions subkey->deleteThis(); } - return DETOUR_MEMBER_CALL(CMissionPopulator_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } @@ -101,7 +101,7 @@ namespace Mod::Pop::Mission_Extensions SCOPED_INCREMENT(rc_CMissionPopulator_UpdateMissionDestroySentries); current_mission = mission; - auto ret = DETOUR_MEMBER_CALL(CMissionPopulator_UpdateMissionDestroySentries)(); + auto ret = DETOUR_MEMBER_CALL(); for (auto obj : sentriesToRestoreTeam) { obj->SetTeamNumber(obj->GetTeamNumber() == TF_TEAM_RED ? TF_TEAM_BLUE : TF_TEAM_RED); @@ -126,7 +126,7 @@ namespace Mod::Pop::Mission_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayerClassShared_SetCustomModel)(s1, b1); + DETOUR_MEMBER_CALL(s1, b1); } diff --git a/src/mod/pop/nested_complex_spawners.cpp b/src/mod/pop/nested_complex_spawners.cpp index a338f517..31ae8b34 100644 --- a/src/mod/pop/nested_complex_spawners.cpp +++ b/src/mod/pop/nested_complex_spawners.cpp @@ -200,7 +200,7 @@ namespace Mod::Pop::Nested_Complex_Spawners DETOUR_DECL_MEMBER(bool, CWave_Parse, KeyValues *kv) { ++rc_CWave_Parse_actual; - auto result = DETOUR_MEMBER_CALL(CWave_Parse)(kv); + auto result = DETOUR_MEMBER_CALL(kv); --rc_CWave_Parse_actual; if (result) { @@ -215,39 +215,39 @@ namespace Mod::Pop::Nested_Complex_Spawners DETOUR_DECL_MEMBER(void, CWave_AddClassType, string_t icon, int count, unsigned int flags) { if (rc_CWave_Parse_actual > 0) return; - DETOUR_MEMBER_CALL(CWave_AddClassType)(icon, count, flags); + DETOUR_MEMBER_CALL(icon, count, flags); } DETOUR_DECL_MEMBER(string_t, CSquadSpawner_GetClassIcon, int index) { if (rc_CWave_Parse_actual > 0) return NULL_STRING; - return DETOUR_MEMBER_CALL(CSquadSpawner_GetClassIcon)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, CSquadSpawner_IsMiniBoss, int index) { if (rc_CWave_Parse_actual > 0) return false; - return DETOUR_MEMBER_CALL(CSquadSpawner_IsMiniBoss)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, CSquadSpawner_HasAttribute, CTFBot::AttributeType attr, int index) { if (rc_CWave_Parse_actual > 0) return false; - return DETOUR_MEMBER_CALL(CSquadSpawner_HasAttribute)(attr, index); + return DETOUR_MEMBER_CALL(attr, index); } DETOUR_DECL_MEMBER(string_t, CRandomChoiceSpawner_GetClassIcon, int index) { if (rc_CWave_Parse_actual > 0) return NULL_STRING; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_GetClassIcon)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, CRandomChoiceSpawner_IsMiniBoss, int index) { if (rc_CWave_Parse_actual > 0) return false; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_IsMiniBoss)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, CRandomChoiceSpawner_HasAttribute, CTFBot::AttributeType attr, int index) { if (rc_CWave_Parse_actual > 0) return false; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_HasAttribute)(attr, index); + return DETOUR_MEMBER_CALL(attr, index); } diff --git a/src/mod/pop/pointtemplate.cpp b/src/mod/pop/pointtemplate.cpp index e1ccb03f..d63a39ca 100644 --- a/src/mod/pop/pointtemplate.cpp +++ b/src/mod/pop/pointtemplate.cpp @@ -673,7 +673,7 @@ namespace Mod::Pop::PointTemplate DETOUR_DECL_MEMBER(void, CUpgrades_Spawn) { CUpgrades *prev = g_hUpgradeEntity.GetRef(); - DETOUR_MEMBER_CALL(CUpgrades_Spawn)(); + DETOUR_MEMBER_CALL(); if (prev != nullptr && !prev->IsMarkedForDeletion()) { g_hUpgradeEntity.GetRef() = prev; @@ -697,14 +697,14 @@ namespace Mod::Pop::PointTemplate { OnDestroyUpgrades(reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CUpgrades_D2)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CUpgrades_D0) { OnDestroyUpgrades(reinterpret_cast(this)); - DETOUR_MEMBER_CALL(CUpgrades_D0)(); + DETOUR_MEMBER_CALL(); } @@ -749,7 +749,7 @@ namespace Mod::Pop::PointTemplate } } } - DETOUR_MEMBER_CALL(CBaseEntity_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); } CBaseEntity *templateTargetEntity = nullptr; @@ -825,28 +825,28 @@ namespace Mod::Pop::PointTemplate { auto me = reinterpret_cast(this); if (!SpawnOurTemplate(me,me->GetAbsOrigin(),me->GetAbsAngles())){ - DETOUR_MEMBER_CALL(CEnvEntityMaker_InputForceSpawn)(inputdata); + DETOUR_MEMBER_CALL(inputdata); } } DETOUR_DECL_MEMBER(void, CEnvEntityMaker_InputForceSpawnAtEntityOrigin, inputdata_t &inputdata) { auto me = reinterpret_cast(this); templateTargetEntity = servertools->FindEntityByName( NULL, STRING(inputdata.value.StringID()), me, inputdata.pActivator, inputdata.pCaller ); - DETOUR_MEMBER_CALL(CEnvEntityMaker_InputForceSpawnAtEntityOrigin)(inputdata); + DETOUR_MEMBER_CALL(inputdata); templateTargetEntity = nullptr; } DETOUR_DECL_MEMBER(void, CEnvEntityMaker_SpawnEntity, Vector vector, QAngle angles) { auto me = reinterpret_cast(this); if (!SpawnOurTemplate(me,vector,angles)){ - DETOUR_MEMBER_CALL(CEnvEntityMaker_SpawnEntity)(vector,angles); + DETOUR_MEMBER_CALL(vector,angles); } } DETOUR_DECL_MEMBER(void, CBaseEntity_SetParent, CBaseEntity *pParentEntity, int iAttachment) { auto me = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseEntity_SetParent)(pParentEntity,iAttachment); + DETOUR_MEMBER_CALL(pParentEntity,iAttachment); if (me->GetSolid() == SOLID_BBOX && me->GetBaseAnimating() == nullptr && strcmp(STRING(me->GetModelName()), TEMPLATE_BRUSH_MODEL) == 0) { me->CollisionProp()->AddSolidFlags(FSOLID_ROOT_PARENT_ALIGNED); } @@ -855,10 +855,10 @@ namespace Mod::Pop::PointTemplate DETOUR_DECL_MEMBER(void, CCollisionProperty_SetSolid, SolidType_t solid) { CBaseEntity *me = reinterpret_cast(reinterpret_cast(this)->GetEntityHandle()); - if (me == nullptr || WholeMapTriggerModule::List().empty()) { DETOUR_MEMBER_CALL(CCollisionProperty_SetSolid)(solid); return; } + if (me == nullptr || WholeMapTriggerModule::List().empty()) { DETOUR_MEMBER_CALL(solid); return; } auto solidpre = TriggerCollideable(me); - DETOUR_MEMBER_CALL(CCollisionProperty_SetSolid)(solid); + DETOUR_MEMBER_CALL(solid); auto solidnow = TriggerCollideable(me); if (!solidpre && solidnow) { for (auto mod : WholeMapTriggerModule::List()) { @@ -906,7 +906,7 @@ namespace Mod::Pop::PointTemplate DETOUR_DECL_MEMBER(void, CBaseEntity_SetModel, const char *model) { - DETOUR_MEMBER_CALL(CBaseEntity_SetModel)(model); + DETOUR_MEMBER_CALL(model); CheckSetWholeMapTrigger(reinterpret_cast(this)); } @@ -916,14 +916,14 @@ namespace Mod::Pop::PointTemplate DETOUR_DECL_MEMBER(void, CCollisionProperty_SetSolidFlags, int flags) { CBaseEntity *me = reinterpret_cast(reinterpret_cast(this)->GetEntityHandle()); - if (me == nullptr) { DETOUR_MEMBER_CALL(CCollisionProperty_SetSolidFlags)(flags); return; } + if (me == nullptr) { DETOUR_MEMBER_CALL(flags); return; } - if (!cvar_whole_map_trigger_all.GetBool() && WholeMapTriggerModule::List().empty()) { DETOUR_MEMBER_CALL(CCollisionProperty_SetSolidFlags)(flags); return; } + if (!cvar_whole_map_trigger_all.GetBool() && WholeMapTriggerModule::List().empty()) { DETOUR_MEMBER_CALL(flags); return; } SCOPED_INCREMENT(rc_CCollisionProperty_SetSolidFlags); auto solidpre = TriggerCollideable(me); auto triggerpre = me->CollisionProp()->IsSolidFlagSet(FSOLID_TRIGGER); - DETOUR_MEMBER_CALL(CCollisionProperty_SetSolidFlags)(flags); + DETOUR_MEMBER_CALL(flags); //Msg("entity %s %d %d %d\n", me->GetClassname(), me->CollisionProp()->IsSolidFlagSet(FSOLID_TRIGGER), me->CollisionProp()->IsSolidFlagSet(FSOLID_NOT_SOLID), TriggerCollideable(me)); auto solidnow = TriggerCollideable(me); if (!solidpre && solidnow) { @@ -981,7 +981,7 @@ namespace Mod::Pop::PointTemplate SCOPED_INCREMENT(rc_CTFPlayer_Event_Killed); auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); for (auto mod : WholeMapTriggerModule::List()) { if (mod->entity->CollisionProp()->IsSolidFlagSet(FSOLID_TRIGGER)) { mod->entity->EndTouch(player); diff --git a/src/mod/pop/popmgr_extensions.cpp b/src/mod/pop/popmgr_extensions.cpp index ca7f91e3..c7ba1860 100644 --- a/src/mod/pop/popmgr_extensions.cpp +++ b/src/mod/pop/popmgr_extensions.cpp @@ -1205,7 +1205,7 @@ namespace Mod::Pop::PopMgr_Extensions killed = pVictim; bot_killed_check = cvar_send_bots_to_spectator_immediately.GetBool(); SCOPED_INCREMENT(rc_CTFGameRules_PlayerKilled); - DETOUR_MEMBER_CALL(CTFGameRules_PlayerKilled)(pVictim, info); + DETOUR_MEMBER_CALL(pVictim, info); if (state.m_bMinibossSentrySingleKill) { auto object = ToBaseObject(info.GetAttacker()); if (object == nullptr) @@ -1236,7 +1236,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - DETOUR_MEMBER_CALL(CTFGameRules_DropSpellPickup)(where, tier); + DETOUR_MEMBER_CALL(where, tier); } DETOUR_DECL_MEMBER(bool, CTFGameRules_IsUsingSpells) @@ -1248,7 +1248,7 @@ namespace Mod::Pop::PopMgr_Extensions return true; } - return DETOUR_MEMBER_CALL(CTFGameRules_IsUsingSpells)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(CTFReviveMarker *, CTFReviveMarker_Create, CTFPlayer *player) @@ -1257,7 +1257,7 @@ namespace Mod::Pop::PopMgr_Extensions return nullptr; } - return DETOUR_STATIC_CALL(CTFReviveMarker_Create)(player); + return DETOUR_STATIC_CALL(player); } DETOUR_DECL_MEMBER(void, CTFSniperRifle_CreateSniperDot) @@ -1271,21 +1271,21 @@ namespace Mod::Pop::PopMgr_Extensions } } - DETOUR_MEMBER_CALL(CTFSniperRifle_CreateSniperDot)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFSniperRifle_CanFireCriticalShot; DETOUR_DECL_MEMBER(bool, CTFSniperRifle_CanFireCriticalShot, bool bIsHeadshot, CBaseEntity *ent1) { SCOPED_INCREMENT(rc_CTFSniperRifle_CanFireCriticalShot); - return DETOUR_MEMBER_CALL(CTFSniperRifle_CanFireCriticalShot)(bIsHeadshot, ent1); + return DETOUR_MEMBER_CALL(bIsHeadshot, ent1); } RefCount rc_CTFRevolver_CanFireCriticalShot; DETOUR_DECL_MEMBER(bool, CTFRevolver_CanFireCriticalShot, bool bIsHeadshot, CBaseEntity *ent1) { SCOPED_INCREMENT(rc_CTFRevolver_CanFireCriticalShot); - return DETOUR_MEMBER_CALL(CTFRevolver_CanFireCriticalShot)(bIsHeadshot, ent1); + return DETOUR_MEMBER_CALL(bIsHeadshot, ent1); } RefCount rc_CTFWeaponBase_CanFireCriticalShot; @@ -1293,21 +1293,21 @@ namespace Mod::Pop::PopMgr_Extensions { SCOPED_INCREMENT_IF(rc_CTFWeaponBase_CanFireCriticalShot, bIsHeadshot); - return DETOUR_MEMBER_CALL(CTFWeaponBase_CanFireCriticalShot)(bIsHeadshot, ent1); + return DETOUR_MEMBER_CALL(bIsHeadshot, ent1); } RefCount rc_CTFProjectile_Arrow_StrikeTarget; DETOUR_DECL_MEMBER(bool, CTFProjectile_Arrow_StrikeTarget, mstudiobbox_t *bbox, CBaseEntity *ent) { SCOPED_INCREMENT(rc_CTFProjectile_Arrow_StrikeTarget); - return DETOUR_MEMBER_CALL(CTFProjectile_Arrow_StrikeTarget)(bbox, ent); + return DETOUR_MEMBER_CALL(bbox, ent); } RefCount rc_CTFWeaponBase_CalcIsAttackCritical; DETOUR_DECL_MEMBER(void, CTFWeaponBase_CalcIsAttackCritical) { SCOPED_INCREMENT(rc_CTFWeaponBase_CalcIsAttackCritical); - DETOUR_MEMBER_CALL(CTFWeaponBase_CalcIsAttackCritical)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFGameRules_IsPVEModeControlled, CBaseEntity *ent) @@ -1328,7 +1328,7 @@ namespace Mod::Pop::PopMgr_Extensions return false; } - return DETOUR_MEMBER_CALL(CTFGameRules_IsPVEModeControlled)(ent); + return DETOUR_MEMBER_CALL(ent); } DETOUR_DECL_MEMBER(void, CUpgrades_UpgradeTouch, CBaseEntity *pOther) @@ -1340,7 +1340,7 @@ namespace Mod::Pop::PopMgr_Extensions gamehelpers->TextMsg(ENTINDEX(player), TEXTMSG_DEST_CENTER, "The Upgrade Station is disabled for this mission!"); return; } - DETOUR_MEMBER_CALL(CUpgrades_UpgradeTouch)(pOther); + DETOUR_MEMBER_CALL(pOther); } const char *BroadcastSound(const char *sound) { @@ -1359,18 +1359,18 @@ namespace Mod::Pop::PopMgr_Extensions return sound; } - DETOUR_DECL_MEMBER(void, CTFGameRules_BroadcastSound, int iTeam, const char *sound, int iAdditionalSoundFlags) + DETOUR_DECL_MEMBER(void, CTFGameRules_BroadcastSound, int iTeam, const char *sound, int iAdditionalSoundFlags, CBasePlayer *player) { sound = BroadcastSound(sound); - DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_BroadcastSound)(iTeam, sound, iAdditionalSoundFlags); + DETOUR_MEMBER_CALL(iTeam, sound, iAdditionalSoundFlags, player); } - DETOUR_DECL_MEMBER(void, CTeamplayRoundBasedRules_BroadcastSound, int iTeam, const char *sound, int iAdditionalSoundFlags) + DETOUR_DECL_MEMBER(void, CTeamplayRoundBasedRules_BroadcastSound, int iTeam, const char *sound, int iAdditionalSoundFlags, CBasePlayer *player) { sound = BroadcastSound(sound); - DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_BroadcastSound)(iTeam, sound, iAdditionalSoundFlags); + DETOUR_MEMBER_CALL(iTeam, sound, iAdditionalSoundFlags, player); } void ModifyEmitSound(EmitSound_t& params) @@ -1423,13 +1423,13 @@ namespace Mod::Pop::PopMgr_Extensions ModifyEmitSound(es); //CBaseEntity::EmitSound(filter,iEntIndex,es); - DETOUR_STATIC_CALL(CBaseEntity_EmitSound_static_emitsound)(filter, iEntIndex, es); + DETOUR_STATIC_CALL(filter, iEntIndex, es); DevMsg("Blocked sound \"%s\" via CBaseEntity::EmitSound\n", sound); return; } } ModifyEmitSound(params); - DETOUR_STATIC_CALL(CBaseEntity_EmitSound_static_emitsound)(filter, iEntIndex, params); + DETOUR_STATIC_CALL(filter, iEntIndex, params); callfrom = false; } @@ -1453,20 +1453,20 @@ namespace Mod::Pop::PopMgr_Extensions es.m_nFlags = params.m_nFlags; es.m_nPitch = params.m_nPitch; ModifyEmitSound(es); - DETOUR_STATIC_CALL(CBaseEntity_EmitSound_static_emitsound_handle)(filter, iEntIndex, es, handle); + DETOUR_STATIC_CALL(filter, iEntIndex, es, handle); DevMsg("Blocked sound \"%s\" via CBaseEntity::EmitSound\n", sound); return; } } ModifyEmitSound(params); - DETOUR_STATIC_CALL(CBaseEntity_EmitSound_static_emitsound_handle)(filter, iEntIndex, params, handle); + DETOUR_STATIC_CALL(filter, iEntIndex, params, handle); } // RefCount rc_CTFPlayer_GiveDefaultItems; // DETOUR_DECL_MEMBER(void, CTFPlayer_GiveDefaultItems) // { // SCOPED_INCREMENT(rc_CTFPlayer_GiveDefaultItems); -// DETOUR_MEMBER_CALL(CTFPlayer_GiveDefaultItems)(); +// DETOUR_MEMBER_CALL(); // } THINK_FUNC_DECL(UpdateBodySkinPlayerWearable) @@ -1560,7 +1560,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_STATIC(const char *, TranslateWeaponEntForClass, const char *name, int classIndex) { - auto result = DETOUR_STATIC_CALL(TranslateWeaponEntForClass)(name, classIndex); + auto result = DETOUR_STATIC_CALL(name, classIndex); if ((result != nullptr && result[0] == '\0') || classIndex == TF_CLASS_CIVILIAN) { return TranslateWeaponEntForClass_improved(name, classIndex); } @@ -1571,14 +1571,14 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(CBaseEntity *, CTFPlayer_GetEntityForLoadoutSlot, int slot, bool flag) { SCOPED_INCREMENT(rc_GetEntityForLoadoutSlot); - return DETOUR_MEMBER_CALL(CTFPlayer_GetEntityForLoadoutSlot)(slot, flag); + return DETOUR_MEMBER_CALL(slot, flag); } RefCount rc_CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot; DETOUR_DECL_MEMBER(CEconItemView *, CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot, CTFPlayer *player, int slot, CBaseEntity &entity) { SCOPED_INCREMENT(rc_CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot); - return DETOUR_MEMBER_CALL(CTFPlayerSharedUtils_GetEconItemViewByLoadoutSlot)(player, slot, entity); + return DETOUR_MEMBER_CALL(player, slot, entity); } RefCount rc_CTFPlayer_GiveDefaultItems; @@ -1603,7 +1603,7 @@ namespace Mod::Pop::PopMgr_Extensions } } } - DETOUR_MEMBER_CALL(CTFPlayer_GiveDefaultItems)(); + DETOUR_MEMBER_CALL(); if (!player->IsBot()) { ApplyOrClearRobotModel(player); } @@ -1628,12 +1628,12 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(CEconItemView *, CTFInventoryManager_GetBaseItemForClass, int pclass, int slot) { SCOPED_INCREMENT(rc_CTFInventoryManager_GetBaseItemForClass); - return DETOUR_MEMBER_CALL(CTFInventoryManager_GetBaseItemForClass)(pclass, slot); + return DETOUR_MEMBER_CALL(pclass, slot); } DETOUR_DECL_MEMBER(int, CTFItemDefinition_GetLoadoutSlot, int classIndex) { - int slot = DETOUR_MEMBER_CALL(CTFItemDefinition_GetLoadoutSlot)(classIndex); + int slot = DETOUR_MEMBER_CALL(classIndex); auto item_def = reinterpret_cast(this); return slot == -1 && !loadout_slot_replace_disabled && classIndex != TF_CLASS_UNDEFINED && item_def->m_iItemDefIndex != 0 ? LoadoutSlotReplace(slot, item_def, classIndex) : slot; } @@ -1641,7 +1641,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_ValidateWeapons, TFPlayerClassData_t *pData, bool bResetWeapons) { SCOPED_INCREMENT(rc_CTFPlayer_ValidateWeapons); - DETOUR_MEMBER_CALL(CTFPlayer_ValidateWeapons)(pData, bResetWeapons); + DETOUR_MEMBER_CALL(pData, bResetWeapons); } DETOUR_DECL_MEMBER(CEconItemView *, CTFPlayerInventory_GetItemInLoadout, int pclass, int slot) @@ -1672,7 +1672,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - auto result = DETOUR_MEMBER_CALL(CTFPlayerInventory_GetItemInLoadout)(pclass, slot); + auto result = DETOUR_MEMBER_CALL(pclass, slot); //Msg("Item in loadout %d %d %d %s\n", pclass, slot, result != nullptr ? result->GetItem()->m_iItemDefinitionIndex.Get() : -1, result != nullptr ? GetItemNameForDisplay(result->GetItem()), "no"); if (result != nullptr && result->GetItemDefinition() != nullptr && IsMannVsMachineMode() && player != nullptr) { @@ -1765,7 +1765,7 @@ namespace Mod::Pop::PopMgr_Extensions // DevMsg("[%s] GiveNamedItem(\"%s\"): provisionally allowed\n", player->GetPlayerName(), classname); - //CBaseEntity *entity = DETOUR_MEMBER_CALL(CTFPlayer_GiveNamedItem)(classname, i1, item_view, b1); + //CBaseEntity *entity = DETOUR_MEMBER_CALL(classname, i1, item_view, b1); // Disable cosmetics on robots, if player animations are not enabled /*if (PlayerUsesRobotModel(player) && item_view != nullptr && item_view->GetItemDefinition() != nullptr) { @@ -1788,7 +1788,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_PickupWeaponFromOther, void *weapon) { SCOPED_INCREMENT(rc_CTFPlayer_PickupWeaponFromOther); - DETOUR_MEMBER_CALL(CTFPlayer_PickupWeaponFromOther)(weapon); + DETOUR_MEMBER_CALL(weapon); } DETOUR_DECL_MEMBER(CBaseEntity *, CTFPlayer_GiveNamedItem, const char *classname, int i1, const CEconItemView *item_view, bool b1) @@ -1827,7 +1827,7 @@ namespace Mod::Pop::PopMgr_Extensions } - CBaseEntity *entity = DETOUR_MEMBER_CALL(CTFPlayer_GiveNamedItem)(classname, i1, item_view, b1); + CBaseEntity *entity = DETOUR_MEMBER_CALL(classname, i1, item_view, b1); // Loadout replacement items need to be validated manually if (entity != nullptr && !is_item_replacement.empty()) { @@ -1860,7 +1860,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - DETOUR_MEMBER_CALL(CUpgrades_GrantOrRemoveAllUpgrades)(player, remove, refund); + DETOUR_MEMBER_CALL(player, remove, refund); // Reapply attributes to custom weapons, as if they come with attributes used by upgrades, those attributes will be removed ForEachTFPlayerEconEntity(player, [&](CEconEntity *entity) { @@ -1938,7 +1938,7 @@ namespace Mod::Pop::PopMgr_Extensions } } int origItemDefId = ReplaceEconItemViewDefId(item_view); - DETOUR_MEMBER_CALL(CTFPlayer_ReapplyItemUpgrades)(item_view); + DETOUR_MEMBER_CALL(item_view); RestoreEconItemViewDefId(item_view, origItemDefId); } @@ -1956,7 +1956,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - return DETOUR_MEMBER_CALL(CTFPlayer_ItemIsAllowed)(item_view); + return DETOUR_MEMBER_CALL(item_view); } #endif @@ -1971,7 +1971,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - return DETOUR_MEMBER_CALL(CCaptureFlag_GetMaxReturnTime)(); + return DETOUR_MEMBER_CALL(); } @@ -1979,7 +1979,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFGameRules_ctor) { SCOPED_INCREMENT(rc_CTFGameRules_ctor); - DETOUR_MEMBER_CALL(CTFGameRules_ctor)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFGameRules_SetWinningTeam; @@ -1987,7 +1987,7 @@ namespace Mod::Pop::PopMgr_Extensions { SCOPED_INCREMENT(rc_CTFGameRules_SetWinningTeam); - DETOUR_MEMBER_CALL(CTFGameRules_SetWinningTeam)(team, iWinReason, bForceMapReset, bSwitchTeams, bDontAddScore, bFinal); + DETOUR_MEMBER_CALL(team, iWinReason, bForceMapReset, bSwitchTeams, bDontAddScore, bFinal); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_AddCond, ETFCond nCond, float flDuration, CBaseEntity *pProvider) @@ -1996,7 +1996,7 @@ namespace Mod::Pop::PopMgr_Extensions { return; } - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } bool rc_CTeamplayRoundBasedRules_State_Enter = false; @@ -2092,7 +2092,7 @@ namespace Mod::Pop::PopMgr_Extensions scriptManager->CallGlobalCallback("OnWaveInit", 1, 0); } } - DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_State_Enter)(newState); + DETOUR_MEMBER_CALL(newState); if (startBonusTimer) { g_pPopulationManager->GetCurrentWave()->m_GetUpgradesAlertTimer.Start(3.0f); @@ -2116,7 +2116,7 @@ namespace Mod::Pop::PopMgr_Extensions scriptManager->CallGlobalCallback(success ? "OnWaveSuccess" : "OnWaveFail", 1, 0); } - DETOUR_MEMBER_CALL(CMannVsMachineStats_RoundEvent_WaveEnd)(success); + DETOUR_MEMBER_CALL(success); } #define CONVAR_SCOPE_VALUE(name, value) \ static ConVarRef convarScopedRef_##name(#name); \ @@ -2209,7 +2209,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_HandleCommand_JoinClass, const char *pClassName, bool b1) { if (!IsMannVsMachineMode()) { - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinClass)(pClassName, b1); + DETOUR_MEMBER_CALL(pClassName, b1); return; } SCOPED_INCREMENT(rc_CTFPlayer_HandleCommand_JoinClass); @@ -2240,7 +2240,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinClass)(pClassName, b1); + DETOUR_MEMBER_CALL(pClassName, b1); void *menu = nullptr; if (menus->GetDefaultStyle()->GetClientMenu(ENTINDEX(player), &menu) == MenuSource_BaseMenu && menu != nullptr) { @@ -2258,14 +2258,14 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CBasePlayer_ChangeTeam, int iTeamNum, bool b1, bool b2, bool b3) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBasePlayer_ChangeTeam)(iTeamNum, b1, b2, b3); + DETOUR_MEMBER_CALL(iTeamNum, b1, b2, b3); if (!player->IsBot()) { ApplyOrClearRobotModel(player); } } DETOUR_DECL_MEMBER(void, CTFPlayer_ChangeTeam, int iTeamNum, bool b1, bool b2, bool b3) { - DETOUR_MEMBER_CALL(CTFPlayer_ChangeTeam)(iTeamNum, b1, b2, b3); + DETOUR_MEMBER_CALL(iTeamNum, b1, b2, b3); auto player = reinterpret_cast(this); if (player->GetTeamNumber() >= TF_TEAM_RED) CheckPlayerClassLimit(player); @@ -2374,7 +2374,7 @@ namespace Mod::Pop::PopMgr_Extensions && TFGameRules()->State_Get() == GR_STATE_RND_RUNNING) { player->SetDeathTime(gpGlobals->curtime); } - DETOUR_MEMBER_CALL(CTFGameRules_OnPlayerSpawned)(player); + DETOUR_MEMBER_CALL(player); //CTFBot *bot = ToTFBot(player); //if (bot != nullptr) @@ -2451,7 +2451,7 @@ namespace Mod::Pop::PopMgr_Extensions /*DETOUR_DECL_MEMBER(void, CTFWeaponBase_UpdateHands) { - DETOUR_MEMBER_CALL(CTFWeaponBase_UpdateHands)(); + DETOUR_MEMBER_CALL(); auto weapon = reinterpret_cast(this); auto owner = weapon->GetTFPlayerOwner(); if (owner != nullptr && state.m_HandModelOverride[owner->GetPlayerClass()->GetClassIndex()] != 0) { @@ -2471,7 +2471,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CBaseCombatWeapon_SetViewModel) { - DETOUR_MEMBER_CALL(CBaseCombatWeapon_SetViewModel)(); + DETOUR_MEMBER_CALL(); auto weapon = reinterpret_cast(this); auto owner = weapon->GetTFPlayerOwner(); if (owner != nullptr && state.m_HandModelOverride[owner->GetPlayerClass()->GetClassIndex()] != 0) { @@ -2495,7 +2495,7 @@ namespace Mod::Pop::PopMgr_Extensions if (!state.m_HandModelOverride[shared->GetClassIndex()].empty() && Mod::Attr::Custom_Attributes::IsCustomViewmodelAllowed(shared->GetOuter())) { return state.m_HandModelOverride[shared->GetClassIndex()].c_str(); } - return DETOUR_MEMBER_CALL(CTFPlayerClassShared_GetHandModelName)(handIndex); + return DETOUR_MEMBER_CALL(handIndex); } @@ -2519,13 +2519,13 @@ namespace Mod::Pop::PopMgr_Extensions } } player_killer = ToTFPlayer(info.GetAttacker()); - DETOUR_MEMBER_CALL(CTFPlayer_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); player_killer = nullptr; } DETOUR_DECL_MEMBER(void, CTFPlayer_InputSetCustomModel, inputdata_t data) { - DETOUR_MEMBER_CALL(CTFPlayer_InputSetCustomModel)(data); + DETOUR_MEMBER_CALL(data); if (state.m_bFixSetCustomModelInput) { auto player = reinterpret_cast(this); player->GetPlayerClass()->m_bUseClassAnimations=true; @@ -2539,7 +2539,7 @@ namespace Mod::Pop::PopMgr_Extensions if (!player->IsBot() && ((state.m_bRedPlayersRobots && player->GetTeamNumber() == TF_TEAM_RED))) { return "MVM.BotStep"; } - const char *sound = DETOUR_MEMBER_CALL( CTFPlayer_GetOverrideStepSound)(pszBaseStepSoundName); + const char *sound = DETOUR_MEMBER_CALL(pszBaseStepSoundName); if( (FStrEq("MVM.BotStep", sound) && (!player->IsBot() && player->GetTeamNumber() == TF_TEAM_BLUE && !state.m_bBluPlayersRobots)) || cvar_bots_are_humans.GetBool()) { return pszBaseStepSoundName; } @@ -2555,9 +2555,9 @@ namespace Mod::Pop::PopMgr_Extensions else if((!player->IsBot() && player->GetTeamNumber() == TF_TEAM_BLUE)) { return ""; } - //const char *token=DETOUR_MEMBER_CALL( CTFPlayer_GetSceneSoundToken)(); + //const char *token=DETOUR_MEMBER_CALL(); //DevMsg("CTFPlayer::GetSceneSoundToken %s\n", token); - return DETOUR_MEMBER_CALL( CTFPlayer_GetSceneSoundToken)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_DeathSound, const CTakeDamageInfo& info) @@ -2571,16 +2571,16 @@ namespace Mod::Pop::PopMgr_Extensions else if (!state.m_bBluPlayersRobots && player->GetTeamNumber() == TF_TEAM_BLUE) { player->SetTeamNumber(TF_TEAM_RED); } - DETOUR_MEMBER_CALL(CTFPlayer_DeathSound)(info); + DETOUR_MEMBER_CALL(info); player->SetTeamNumber(teamnum); } else - DETOUR_MEMBER_CALL(CTFPlayer_DeathSound)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CTFPowerup_Spawn) { - DETOUR_MEMBER_CALL(CTFPowerup_Spawn)(); + DETOUR_MEMBER_CALL(); if (state.m_bNoHolidayHealthPack) { auto powerup = reinterpret_cast(this); powerup->SetModelIndexOverride( VISION_MODE_PYRO, 0 ); @@ -2590,7 +2590,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(CBaseObject *, CTFBot_GetNearestKnownSappableTarget) { - CBaseObject *ret = DETOUR_MEMBER_CALL(CTFBot_GetNearestKnownSappableTarget)(); + CBaseObject *ret = DETOUR_MEMBER_CALL(); if (ret != nullptr && (ret->GetMoveParent() != nullptr || (state.m_bSpyNoSapUnownedBuildings && ret->GetBuilder() == nullptr))) { return nullptr; @@ -2605,12 +2605,12 @@ namespace Mod::Pop::PopMgr_Extensions // return CollectPlayers_RedAndBlue_IsBot(playerVector, team, isAlive, shouldAppend); // } - // return DETOUR_STATIC_CALL(CollectPlayers_CTFPlayer)(playerVector, team, isAlive, shouldAppend); + // return DETOUR_STATIC_CALL(playerVector, team, isAlive, shouldAppend); // } /*DETOUR_DECL_MEMBER(bool, IVision_IsAbleToSee, CBaseEntity *ent, Vector *vec) { DevMsg ("abletosee1\n"); - bool ret = DETOUR_MEMBER_CALL(IVision_IsAbleToSee)(ent,vec); + bool ret = DETOUR_MEMBER_CALL(ent,vec); if (ret && ent != nullptr) { CTFBot *bot = ToTFBot(reinterpret_cast(this)->GetBot()->GetEntity()); @@ -2634,7 +2634,7 @@ namespace Mod::Pop::PopMgr_Extensions return true; } } - return DETOUR_MEMBER_CALL(CTFBotVision_IsIgnored)(ent); + return DETOUR_MEMBER_CALL(ent); } @@ -2646,7 +2646,7 @@ namespace Mod::Pop::PopMgr_Extensions me->m_enemySentry = nullptr; } } - return DETOUR_MEMBER_CALL(CTFBotSpyInfiltrate_Update)(me,interval); + return DETOUR_MEMBER_CALL(me,interval); } DETOUR_DECL_MEMBER(ActionResult, CTFBotSpyLurk_Update, CTFBot *me, float interval) @@ -2657,12 +2657,12 @@ namespace Mod::Pop::PopMgr_Extensions me->m_enemySentry = nullptr; } } - return DETOUR_MEMBER_CALL(CTFBotSpyLurk_Update)(me,interval); + return DETOUR_MEMBER_CALL(me,interval); } DETOUR_DECL_MEMBER(void, CPopulationManager_AdjustMinPlayerSpawnTime) { - DETOUR_MEMBER_CALL(CPopulationManager_AdjustMinPlayerSpawnTime)(); + DETOUR_MEMBER_CALL(); if (state.m_flRespawnWaveTimeBlue >= 0.0f) { float time = state.m_flRespawnWaveTimeBlue; @@ -2688,7 +2688,7 @@ namespace Mod::Pop::PopMgr_Extensions return false; } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } DETOUR_DECL_MEMBER(float, CTeamplayRoundBasedRules_GetMinTimeWhenPlayerMaySpawn, CBasePlayer *player) @@ -2696,12 +2696,12 @@ namespace Mod::Pop::PopMgr_Extensions if (state.m_iPlayerMiniBossMinRespawnTime >= 0 && !player->IsFakeClient() && ToTFPlayer(player)->IsMiniBoss() && !player->IsBot()) return player->GetDeathTime() + state.m_iPlayerMiniBossMinRespawnTime; - return DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_GetMinTimeWhenPlayerMaySpawn)(player); + return DETOUR_MEMBER_CALL(player); } DETOUR_DECL_MEMBER(bool, CTFBotTacticalMonitor_ShouldOpportunisticallyTeleport, CTFBot *bot) { - return DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_ShouldOpportunisticallyTeleport)(bot) && cvar_use_teleport.GetBool() && !bot->HasItem(); + return DETOUR_MEMBER_CALL(bot) && cvar_use_teleport.GetBool() && !bot->HasItem(); } // CBaseAnimating * TemplateShootSpawn(CTFPlayer *player, CTFWeaponBase *weapon, bool &stopproj, std::function origShootFunc) @@ -2757,12 +2757,12 @@ namespace Mod::Pop::PopMgr_Extensions if (IsMannVsMachineMode() && player != nullptr && !player->IsFakeClient()) { bool stopproj; bool smacked = false; - TemplateShootSpawn(state.m_ShootTemplates, player, weapon, stopproj, [&](){ smacked = true; DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); return nullptr; }); + TemplateShootSpawn(state.m_ShootTemplates, player, weapon, stopproj, [&](){ smacked = true; DETOUR_MEMBER_CALL(); return nullptr; }); if (stopproj || smacked) { return; } } - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); + DETOUR_MEMBER_CALL(); } @@ -2771,7 +2771,7 @@ namespace Mod::Pop::PopMgr_Extensions if (IsMannVsMachineMode() && !player->IsFakeClient()) { auto weapon = reinterpret_cast(this); bool stopproj; - auto proj = TemplateShootSpawn(state.m_ShootTemplates, player, weapon, stopproj, [&](){ return DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); }); + auto proj = TemplateShootSpawn(state.m_ShootTemplates, player, weapon, stopproj, [&](){ return DETOUR_MEMBER_CALL(player); }); if (proj != nullptr) { return proj; } @@ -2792,17 +2792,17 @@ namespace Mod::Pop::PopMgr_Extensions } } - return DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); + return DETOUR_MEMBER_CALL(player); } DETOUR_DECL_STATIC(int, GetBotEscortCount, int team) { - return DETOUR_STATIC_CALL(GetBotEscortCount)(team) - state.m_iEscortBotCountOffset; + return DETOUR_STATIC_CALL(team) - state.m_iEscortBotCountOffset; } /*DETOUR_DECL_MEMBER(bool, CObjectSentrygun_FireRocket) { firerocket_sentrygun = reinterpret_cast(this); - bool ret = DETOUR_MEMBER_CALL(CObjectSentrygun_FireRocket)(); + bool ret = DETOUR_MEMBER_CALL(); firerocket_sentrygun = nullptr; return ret; }*/ @@ -2838,7 +2838,7 @@ namespace Mod::Pop::PopMgr_Extensions CTFWearable *wearable = reinterpret_cast(this); THINK_FUNC_SET(wearable, RemoveCosmeticDelay, gpGlobals->curtime); - DETOUR_MEMBER_CALL(CTFWearable_Equip)(player); + DETOUR_MEMBER_CALL(player); if (ToTFBot(player) == nullptr) { for (auto &info : state.m_WeaponSpawnTemplates) { @@ -2893,13 +2893,13 @@ namespace Mod::Pop::PopMgr_Extensions if (owner != nullptr && owner->GetActiveWeapon() != wep) { return wep->SetTransmitState(FL_EDICT_DONTSEND); } - return DETOUR_MEMBER_CALL(CBaseCombatWeapon_UpdateTransmitState)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_Deploy) { auto wep = reinterpret_cast(this); - auto ret = DETOUR_MEMBER_CALL(CTFWeaponBase_Deploy)(); + auto ret = DETOUR_MEMBER_CALL(); if (ret) { if (!state.m_WeaponDeploySpawnTemplates.empty()) { auto owner = wep->GetOwnerEntity(); @@ -2923,7 +2923,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(bool, CTFWeaponBase_Holster, CBaseCombatWeapon *pSwitchingTo) { auto wep = reinterpret_cast(this); - auto ret = DETOUR_MEMBER_CALL(CTFWeaponBase_Holster)(pSwitchingTo); + auto ret = DETOUR_MEMBER_CALL(pSwitchingTo); if (ret) { if (!state.m_WeaponDeployTemplates.empty()) { auto range = state.m_WeaponDeployTemplates.equal_range(wep); @@ -2946,7 +2946,7 @@ namespace Mod::Pop::PopMgr_Extensions if (player != nullptr && ent->m_nCustomViewmodelModelIndex == 0 && !state.m_HandModelOverride[player->GetPlayerClass()->GetClassIndex()].empty() && Mod::Attr::Custom_Attributes::IsCustomViewmodelAllowed(player) && ent->m_nViewModelIndex == 0 && ent->GetItem() != nullptr && ent->GetItem()->GetItemDefinition()->GetKeyValues()->GetInt("attach_to_hands", 0) != 0 ) { ent->SetCustomViewModel(state.m_HandModelOverride[player->GetPlayerClass()->GetClassIndex()].c_str()); } - DETOUR_MEMBER_CALL(CBaseCombatWeapon_Equip)(owner); + DETOUR_MEMBER_CALL(owner); if (!state.m_WeaponSpawnTemplates.empty() && rc_CTFPlayer_Spawn == 0) { if (ToTFBot(owner) == nullptr) { if (state.m_ItemEquipTemplates.find(ent) == state.m_ItemEquipTemplates.end()) { @@ -2967,7 +2967,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFPlayerClassShared_SetCustomModel, const char *s1, bool b1) { - DETOUR_MEMBER_CALL(CTFPlayerClassShared_SetCustomModel)(s1, b1); + DETOUR_MEMBER_CALL(s1, b1); if (s1 != nullptr) { CTFPlayer *player = reinterpret_cast(this)->GetOuter(); if (PlayerUsesRobotModel(player)) { @@ -2998,7 +2998,7 @@ namespace Mod::Pop::PopMgr_Extensions } SCOPED_INCREMENT(rc_CTFPlayer_Spawn); - DETOUR_MEMBER_CALL(CTFPlayer_Spawn)(); + DETOUR_MEMBER_CALL(); if (ToTFBot(player) == nullptr && !state.m_WeaponSpawnTemplates.empty()) { ForEachTFPlayerEconEntity(player, [&](CEconEntity *entity) { if (!entity->IsMarkedForDeletion()) { @@ -3033,7 +3033,7 @@ namespace Mod::Pop::PopMgr_Extensions } state.m_WeaponDeployTemplates.erase(entity); } - DETOUR_MEMBER_CALL(CEconEntity_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFSpellBook_RollNewSpell; @@ -3042,13 +3042,13 @@ namespace Mod::Pop::PopMgr_Extensions SCOPED_INCREMENT(rc_CTFSpellBook_RollNewSpell); auto entity = reinterpret_cast(this); state.m_SpellBookNextRollTier[entity] = tier; - DETOUR_MEMBER_CALL(CTFSpellBook_RollNewSpell)(tier, forceReroll); + DETOUR_MEMBER_CALL(tier, forceReroll); } DETOUR_DECL_MEMBER(void, CTFSpellBook_SetSelectedSpell, int spell) { if (rc_CTFSpellBook_RollNewSpell) { - DETOUR_MEMBER_CALL(CTFSpellBook_SetSelectedSpell)(spell); + DETOUR_MEMBER_CALL(spell); return; } @@ -3057,18 +3057,18 @@ namespace Mod::Pop::PopMgr_Extensions if (tier == 0 && !state.m_SpellBookNormalRoll.empty()) { spell = RandomInt(0, state.m_SpellBookNormalRoll.size() - 1); - //DETOUR_MEMBER_CALL(CTFSpellBook_SetSelectedSpell)(state.m_SpellBookRareRoll[spell].first); + //DETOUR_MEMBER_CALL(state.m_SpellBookRareRoll[spell].first); entity->m_iSelectedSpellIndex = state.m_SpellBookNormalRoll[spell].first; entity->m_iSpellCharges = state.m_SpellBookNormalRoll[spell].second; } else if (tier == 1 && !state.m_SpellBookRareRoll.empty()) { spell = RandomInt(0, state.m_SpellBookRareRoll.size() - 1); - //DETOUR_MEMBER_CALL(CTFSpellBook_SetSelectedSpell)(state.m_SpellBookRareRoll[spell].first); + //DETOUR_MEMBER_CALL(state.m_SpellBookRareRoll[spell].first); entity->m_iSelectedSpellIndex = state.m_SpellBookRareRoll[spell].first; entity->m_iSpellCharges = state.m_SpellBookRareRoll[spell].second; } else { - DETOUR_MEMBER_CALL(CTFSpellBook_SetSelectedSpell)(spell); + DETOUR_MEMBER_CALL(spell); } state.m_SpellBookNextRollTier.erase(entity); } @@ -3175,7 +3175,7 @@ namespace Mod::Pop::PopMgr_Extensions return false; } - return DETOUR_MEMBER_CALL(CTFGameRules_CanUpgradeWithAttrib)(player, slot, defindex, upgrade); + return DETOUR_MEMBER_CALL(player, slot, defindex, upgrade); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, void, CUpgrades_PlayerPurchasingUpgrade, CTFPlayer *player, int itemslot, int upgradeslot, bool sell, bool free, bool b3) @@ -3189,12 +3189,12 @@ namespace Mod::Pop::PopMgr_Extensions } } } - DETOUR_MEMBER_CALL(CUpgrades_PlayerPurchasingUpgrade)(player, itemslot, upgradeslot, sell, free, b3); + DETOUR_MEMBER_CALL(player, itemslot, upgradeslot, sell, free, b3); } DETOUR_DECL_MEMBER(bool, CObjectSentrygun_FindTarget) { - bool ret{DETOUR_MEMBER_CALL(CObjectSentrygun_FindTarget)()}; + bool ret{DETOUR_MEMBER_CALL()}; if(state.m_bNoWranglerShield){ CObjectSentrygun* sentry{reinterpret_cast(this)}; sentry->m_nShieldLevel = 0; @@ -4261,13 +4261,13 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_ModifyOrAppendCriteria, void *criteria) { SCOPED_INCREMENT_IF(rc_CTFPlayer_ModifyOrAppendCriteria, IsMannVsMachineMode() && state.m_bNoThrillerTaunt); - DETOUR_MEMBER_CALL(CTFPlayer_ModifyOrAppendCriteria)(criteria); + DETOUR_MEMBER_CALL(criteria); } DETOUR_DECL_MEMBER(void, CTFAmmoPack_InitAmmoPack, CTFPlayer * player, CTFWeaponBase *weapon, int i1, bool b1, bool b2, float f1) { SCOPED_INCREMENT_IF(rc_CTFPlayer_ModifyOrAppendCriteria, IsMannVsMachineMode() && state.m_bNoCritPumpkin); - DETOUR_MEMBER_CALL(CTFAmmoPack_InitAmmoPack)(player, weapon, i1, b1, b2, f1); + DETOUR_MEMBER_CALL(player, weapon, i1, b1, b2, f1); } DETOUR_DECL_STATIC(bool, TF_IsHolidayActive) @@ -4276,13 +4276,13 @@ namespace Mod::Pop::PopMgr_Extensions if (rc_CTFPlayer_ModifyOrAppendCriteria) return false; else - return DETOUR_STATIC_CALL(TF_IsHolidayActive)(); + return DETOUR_STATIC_CALL(); } DETOUR_DECL_MEMBER(void, CTFGameRules_BetweenRounds_Think) { float time_to_start = TFGameRules()->GetRestartRoundTime(); - DETOUR_MEMBER_CALL(CTFGameRules_BetweenRounds_Think)(); + DETOUR_MEMBER_CALL(); if (state.m_flRestartRoundTime != -1.0f && TFGameRules()->GetRestartRoundTime() != -1.0f && TFGameRules()->GetRestartRoundTime() != time_to_start) { TFGameRules()->SetRestartRoundTime(gpGlobals->curtime + state.m_flRestartRoundTime); } @@ -4293,7 +4293,7 @@ namespace Mod::Pop::PopMgr_Extensions if (state.m_iLoseTime != -1) { return state.m_iLoseTime; } - return DETOUR_MEMBER_CALL(CTFGameRules_GetBonusRoundTime)(); + return DETOUR_MEMBER_CALL(); } @@ -4309,7 +4309,7 @@ namespace Mod::Pop::PopMgr_Extensions strtol(sound + 1, &pos, 10); sound = pos + 1; } - return DETOUR_MEMBER_CALL(CEngineSoundServer_PrecacheSound)(sound, flag1, flag2); + return DETOUR_MEMBER_CALL(sound, flag1, flag2); } int event_popfile = 0; @@ -4319,7 +4319,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CPopulationManager_UpdateObjectiveResource) { - DETOUR_MEMBER_CALL(CPopulationManager_UpdateObjectiveResource)(); + DETOUR_MEMBER_CALL(); event_popfile = TFObjectiveResource()->m_nMvMEventPopfileType; if (state.m_bZombiesNoWave666) TFObjectiveResource()->m_nMvMEventPopfileType = 0; @@ -4334,7 +4334,7 @@ namespace Mod::Pop::PopMgr_Extensions } } - return DETOUR_MEMBER_CALL(NextBotManager_ShouldUpdate)(bot); + return DETOUR_MEMBER_CALL(bot); } DETOUR_DECL_MEMBER(void, CPopulationManager_StartCurrentWave) @@ -4346,7 +4346,7 @@ namespace Mod::Pop::PopMgr_Extensions } }); - DETOUR_MEMBER_CALL(CPopulationManager_StartCurrentWave)(); + DETOUR_MEMBER_CALL(); if (state.m_ScriptManager != nullptr) { ConColorMsg(Color(0xff, 0x00, 0x00, 0xff), "Wave #%d started\n", TFObjectiveResource()->m_nMannVsMachineWaveCount.Get()); @@ -4366,7 +4366,7 @@ namespace Mod::Pop::PopMgr_Extensions //DevMsg("Stop Spawn\n"); return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_IsReadyToSpawn)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayer_ShouldGainInstantSpawn) @@ -4377,7 +4377,7 @@ namespace Mod::Pop::PopMgr_Extensions //DevMsg("Stop Spawn\n"); return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_ShouldGainInstantSpawn)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CHeadlessHatmanAttack_RecomputeHomePosition) @@ -4385,7 +4385,7 @@ namespace Mod::Pop::PopMgr_Extensions if (state.m_bHHHNoControlPointLogic) { return; } - DETOUR_MEMBER_CALL(CHeadlessHatmanAttack_RecomputeHomePosition)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveCurrency, int amount) @@ -4393,7 +4393,7 @@ namespace Mod::Pop::PopMgr_Extensions if (rc_CTFPlayer_Event_Killed && state.m_DeathPenalty.Get() != 0 && TFGameRules()->State_Get() != GR_STATE_RND_RUNNING) { return; } - DETOUR_MEMBER_CALL(CTFPlayer_RemoveCurrency)(amount); + DETOUR_MEMBER_CALL(amount); } DETOUR_DECL_MEMBER(void, CTFPlayer_EndPurchasableUpgrades) @@ -4403,7 +4403,7 @@ namespace Mod::Pop::PopMgr_Extensions reset = true; TFObjectiveResource()->m_nMannVsMachineWaveCount = 2; } - DETOUR_MEMBER_CALL(CTFPlayer_EndPurchasableUpgrades)(); + DETOUR_MEMBER_CALL(); if (reset) { TFObjectiveResource()->m_nMannVsMachineWaveCount = 1; } @@ -4450,13 +4450,13 @@ namespace Mod::Pop::PopMgr_Extensions // VectorCopy( angMoveAngle, cmd->viewangles ); // } - DETOUR_MEMBER_CALL(CTFPlayer_PlayerRunCommand)(cmd, moveHelper); + DETOUR_MEMBER_CALL(cmd, moveHelper); } DETOUR_DECL_MEMBER(void, CTFGameMovement_PreventBunnyJumping) { if(!state.m_iBunnyHop){ - DETOUR_MEMBER_CALL(CTFGameMovement_PreventBunnyJumping)(); + DETOUR_MEMBER_CALL(); } } @@ -4465,7 +4465,7 @@ namespace Mod::Pop::PopMgr_Extensions if (state.m_bHHHNonSolidToPlayers && entity->IsPlayer()) { return false; } - return DETOUR_MEMBER_CALL(CHeadlessHatmanLocomotion_ShouldCollideWith)(entity); + return DETOUR_MEMBER_CALL(entity); } RefCount rc_CHeadlessHatmanAttack_AttackTarget; @@ -4474,7 +4474,7 @@ namespace Mod::Pop::PopMgr_Extensions { SCOPED_INCREMENT(rc_CHeadlessHatmanAttack_AttackTarget); hatman_target = target; - DETOUR_MEMBER_CALL(CHeadlessHatmanAttack_AttackTarget)( hatman, target, range); + DETOUR_MEMBER_CALL( hatman, target, range); } DETOUR_DECL_STATIC(void, CalculateMeleeDamageForce, CTakeDamageInfo *info, Vector &vecMeleeDir, const Vector &vecForceOrigin, float flScale ) @@ -4484,7 +4484,7 @@ namespace Mod::Pop::PopMgr_Extensions hatman_target->SetAbsVelocity(hatman_target->GetAbsVelocity() + Vector(0,0,460)); } /*DevMsg("MeleeDaamgeForce %f %d\n", vecMeleeDir.z, rc_CHeadlessHatmanAttack_AttackTarget);*/ - DETOUR_STATIC_CALL(CalculateMeleeDamageForce)(info, vecMeleeDir, vecForceOrigin, flScale); + DETOUR_STATIC_CALL(info, vecMeleeDir, vecForceOrigin, flScale); } DETOUR_DECL_MEMBER(void, CBasePlayer_ShowViewPortPanel, const char *name, bool show, KeyValues *kv) @@ -4494,14 +4494,14 @@ namespace Mod::Pop::PopMgr_Extensions player->HandleCommand_JoinClass(g_aRawPlayerClassNames[state.m_bSingleClassAllowed]); return; } - DETOUR_MEMBER_CALL(CBasePlayer_ShowViewPortPanel)( name, show, kv); + DETOUR_MEMBER_CALL( name, show, kv); } RefCount rc_CZombieBehavior_OnKilled; DETOUR_DECL_MEMBER(EventDesiredResult< CZombie >, CZombieBehavior_OnKilled, CZombie *zombie, const CTakeDamageInfo &info) { SCOPED_INCREMENT_IF(rc_CZombieBehavior_OnKilled, IsMannVsMachineMode() && state.m_bNoSkeletonSplit) - return DETOUR_MEMBER_CALL(CZombieBehavior_OnKilled)( zombie, info); + return DETOUR_MEMBER_CALL( zombie, info); } DETOUR_DECL_STATIC(CBaseEntity*, CreateSpellSpawnZombie, CBaseCombatCharacter *pCaster, const Vector& vSpawnPosition, int nSkeletonType) @@ -4509,18 +4509,18 @@ namespace Mod::Pop::PopMgr_Extensions if (rc_CZombieBehavior_OnKilled) { return nullptr; } - return DETOUR_STATIC_CALL(CreateSpellSpawnZombie)(pCaster, vSpawnPosition, nSkeletonType); + return DETOUR_STATIC_CALL(pCaster, vSpawnPosition, nSkeletonType); } RefCount rc_ILocomotion_StuckMonitor; DETOUR_DECL_MEMBER(void, ILocomotion_StuckMonitor) { SCOPED_INCREMENT(rc_ILocomotion_StuckMonitor); - DETOUR_MEMBER_CALL(ILocomotion_StuckMonitor)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, PlayerLocomotion_GetDesiredSpeed) { - float ret = DETOUR_MEMBER_CALL(PlayerLocomotion_GetDesiredSpeed)(); + float ret = DETOUR_MEMBER_CALL(); if (rc_ILocomotion_StuckMonitor) { ret *= state.m_fStuckTimeMult; } @@ -4529,7 +4529,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_STATIC(void, CPopulationManager_FindDefaultPopulationFileShortNames, CUtlVector &vec) { - DETOUR_STATIC_CALL(CPopulationManager_FindDefaultPopulationFileShortNames)(vec); + DETOUR_STATIC_CALL(vec); KeyValues *kv = new KeyValues("kv"); if (kv->LoadFromFile(filesystem, cvar_banned_missions_file.GetString())) { @@ -4546,7 +4546,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CMannVsMachineChangeChallengeIssue_ExecuteCommand) { vote_tf_mvm_popfile_time = gpGlobals->curtime; - DETOUR_MEMBER_CALL(CMannVsMachineChangeChallengeIssue_ExecuteCommand)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(void, tf_mvm_popfile, const CCommand& args) @@ -4559,7 +4559,7 @@ namespace Mod::Pop::PopMgr_Extensions return; } } - DETOUR_STATIC_CALL(tf_mvm_popfile)(args); + DETOUR_STATIC_CALL(args); } DETOUR_DECL_MEMBER(void, CTFPlayer_DropCurrencyPack, int pack, int amount, bool forcedistribute, CTFPlayer *moneymaker ) @@ -4576,7 +4576,7 @@ namespace Mod::Pop::PopMgr_Extensions moneymaker = (CTFPlayer *) TFTeamMgr()->GetTeam(creditTeam)->GetPlayer(RandomInt(0, TFTeamMgr()->GetTeam(creditTeam)->GetNumPlayers() - 1)); } - DETOUR_MEMBER_CALL(CTFPlayer_DropCurrencyPack)(pack, amount, forcedistribute, moneymaker); + DETOUR_MEMBER_CALL(pack, amount, forcedistribute, moneymaker); } @@ -4585,7 +4585,7 @@ namespace Mod::Pop::PopMgr_Extensions if (state.m_bNoCreditsVelocity && rtti_cast(reinterpret_cast(this)) != nullptr) { velocity.Init(); } - DETOUR_MEMBER_CALL(CTFPowerup_DropSingleInstance)(velocity, owner, flThrowerTouchDelay, flResetTime); + DETOUR_MEMBER_CALL(velocity, owner, flThrowerTouchDelay, flResetTime); } DETOUR_DECL_MEMBER(void, CCurrencyPack_Spawn) @@ -4605,12 +4605,12 @@ namespace Mod::Pop::PopMgr_Extensions currency->DistributedBy(player_killer); } - DETOUR_MEMBER_CALL(CCurrencyPack_Spawn)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CTFGameRules_ApplyOnDamageAliveModifyRules, CTakeDamageInfo &info, CBaseEntity *entity, void *extra) { - float damage = DETOUR_MEMBER_CALL(CTFGameRules_ApplyOnDamageAliveModifyRules)(info, entity, extra); + float damage = DETOUR_MEMBER_CALL(info, entity, extra); if (damage < 0.0f && entity->IsPlayer() && state.m_bRestoreNegativeDamageHealing) { HealPlayer(ToTFPlayer(entity), ToTFPlayer(info.GetAttacker()), rtti_cast(info.GetWeapon()), -damage, true, state.m_bRestoreNegativeDamageOverheal ? DMG_IGNORE_MAXHEALTH : DMG_GENERIC); } @@ -4619,7 +4619,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CPopulationManager_RestoreCheckpoint) { - DETOUR_MEMBER_CALL(CPopulationManager_RestoreCheckpoint)(); + DETOUR_MEMBER_CALL(); // Reset bought loadout items ForEachTFPlayer([](CTFPlayer *player) { CSteamID steamid; @@ -4642,7 +4642,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CPopulationManager_SetCheckpoint, int wave) { - DETOUR_MEMBER_CALL(CPopulationManager_SetCheckpoint)(wave); + DETOUR_MEMBER_CALL(wave); // Save bought items ForEachTFPlayer([](CTFPlayer *player) { CSteamID steamid; @@ -4686,36 +4686,36 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_STATIC(void, DispatchParticleEffect_2, const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity, int iAttachmentPoint, bool bResetAllParticlesOnEntity) { OverrideParticle(pszParticleName); - DETOUR_STATIC_CALL(DispatchParticleEffect_2)(pszParticleName, iAttachType, pEntity, iAttachmentPoint, bResetAllParticlesOnEntity); + DETOUR_STATIC_CALL(pszParticleName, iAttachType, pEntity, iAttachmentPoint, bResetAllParticlesOnEntity); } DETOUR_DECL_STATIC(void, DispatchParticleEffect_6, const char *pszParticleName, ParticleAttachment_t iAttachType, CBaseEntity *pEntity, const char *pszAttachmentName, Vector vecColor1, Vector vecColor2, bool bUseColors, bool bResetAllParticlesOnEntity) { OverrideParticle(pszParticleName); - DETOUR_STATIC_CALL(DispatchParticleEffect_6)(pszParticleName, iAttachType, pEntity, pszAttachmentName, vecColor1, vecColor2, bUseColors, bResetAllParticlesOnEntity); + DETOUR_STATIC_CALL(pszParticleName, iAttachType, pEntity, pszAttachmentName, vecColor1, vecColor2, bUseColors, bResetAllParticlesOnEntity); } DETOUR_DECL_STATIC(void, DispatchParticleEffect_3, const char *pszParticleName, Vector vecOrigin, QAngle vecAngles, CBaseEntity *pEntity) { OverrideParticle(pszParticleName); - DETOUR_STATIC_CALL(DispatchParticleEffect_3)(pszParticleName, vecOrigin, vecAngles, pEntity); + DETOUR_STATIC_CALL(pszParticleName, vecOrigin, vecAngles, pEntity); } DETOUR_DECL_STATIC(void, DispatchParticleEffect_4, const char *pszParticleName, Vector vecOrigin, Vector vecStart, QAngle vecAngles, CBaseEntity *pEntity) { OverrideParticle(pszParticleName); - DETOUR_STATIC_CALL(DispatchParticleEffect_4)(pszParticleName, vecOrigin, vecStart, vecAngles, pEntity); + DETOUR_STATIC_CALL(pszParticleName, vecOrigin, vecStart, vecAngles, pEntity); } DETOUR_DECL_STATIC(void, DispatchParticleEffect_7, const char *pszParticleName, Vector vecOrigin, QAngle vecAngles, Vector vecColor1, Vector vecColor2, bool bUseColors, CBaseEntity *pEntity, ParticleAttachment_t iAttachType) { OverrideParticle(pszParticleName); - DETOUR_STATIC_CALL(DispatchParticleEffect_7)(pszParticleName, vecOrigin, vecAngles, vecColor1, vecColor2, bUseColors, pEntity, iAttachType); + DETOUR_STATIC_CALL(pszParticleName, vecOrigin, vecAngles, vecColor1, vecColor2, bUseColors, pEntity, iAttachType); } DETOUR_DECL_MEMBER(void, CBaseObject_StartBuilding, CBaseEntity *builder) { - DETOUR_MEMBER_CALL(CBaseObject_StartBuilding)(builder); + DETOUR_MEMBER_CALL(builder); auto obj = reinterpret_cast(this); CTFPlayer *owner = obj->GetBuilder(); if (owner != nullptr) { @@ -4806,7 +4806,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(bool, CTFBotSpawner_Spawn, const Vector& where, CUtlVector> *ents) { - auto result = DETOUR_MEMBER_CALL(CTFBotSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (result && ents != nullptr && state.m_ScriptManager != nullptr) { auto player = ToTFBot(ents->Tail()); if (player != nullptr) { @@ -4828,7 +4828,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(bool, CTankSpawner_Spawn, const Vector& where, CUtlVector> *ents) { - auto result = DETOUR_MEMBER_CALL(CTankSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (result && ents != nullptr && state.m_ScriptManager != nullptr) { auto entity = ents->Tail(); if (entity != nullptr) { @@ -4866,7 +4866,7 @@ namespace Mod::Pop::PopMgr_Extensions } return found; } - return DETOUR_MEMBER_CALL(CBaseObject_FindSnapToBuildPos)(pObjectOverride); + return DETOUR_MEMBER_CALL(pObjectOverride); } class CTFNavAreaIncursionLess @@ -5006,12 +5006,12 @@ namespace Mod::Pop::PopMgr_Extensions Msg("Not found\n"); return SPAWN_LOCATION_NOT_FOUND; } - return DETOUR_MEMBER_CALL(CSpawnLocation_FindSpawnLocation)(vSpawnPosition); + return DETOUR_MEMBER_CALL(vSpawnPosition); } DETOUR_DECL_MEMBER(void, CDynamicProp_Spawn) { - DETOUR_MEMBER_CALL(CDynamicProp_Spawn)(); + DETOUR_MEMBER_CALL(); if (state.m_NoRomevisionCosmetics.Get()) { auto entity = reinterpret_cast(this); if (FStrEq(STRING(entity->GetModelName()), "models/bots/boss_bot/carrier_parts.mdl")) { @@ -5023,14 +5023,14 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_RememberUpgrade, int iPlayerClass, CEconItemView *pItem, int iUpgrade, int nCost, bool bDowngrade ) { int origItemDefId = ReplaceEconItemViewDefId(pItem); - DETOUR_MEMBER_CALL(CTFPlayer_RememberUpgrade)(iPlayerClass, pItem, iUpgrade, nCost, bDowngrade); + DETOUR_MEMBER_CALL(iPlayerClass, pItem, iUpgrade, nCost, bDowngrade); RestoreEconItemViewDefId(pItem, origItemDefId); } DETOUR_DECL_MEMBER(void, CTFPlayer_ForgetFirstUpgradeForItem, CEconItemView *pItem) { int origItemDefId = ReplaceEconItemViewDefId(pItem); - DETOUR_MEMBER_CALL(CTFPlayer_RememberUpgrade)(pItem); + DETOUR_MEMBER_CALL(pItem); RestoreEconItemViewDefId(pItem, origItemDefId); } @@ -5055,7 +5055,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void, CCaptureFlag_PickUp, CTFPlayer *player, bool invisible) { - DETOUR_MEMBER_CALL(CCaptureFlag_PickUp)(player, invisible); + DETOUR_MEMBER_CALL(player, invisible); auto flag = reinterpret_cast(this); if (player->GetItem() == flag && player->IsRealPlayer() && state.m_bPlayerBombCarrierBuffs) { auto mod = flag->GetOrCreateEntityModule("flagupgrademodule"); @@ -5082,7 +5082,7 @@ namespace Mod::Pop::PopMgr_Extensions { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_Taunt)(index, taunt_concept); + DETOUR_MEMBER_CALL(index, taunt_concept); if (player->GetItem() != nullptr && player->IsRealPlayer() && state.m_bPlayerBombCarrierBuffs && player->m_Shared->InCond(TF_COND_TAUNTING)) { player->SetCustomVariable("taunttime", Variant(gpGlobals->curtime)); @@ -5091,7 +5091,7 @@ namespace Mod::Pop::PopMgr_Extensions DETOUR_DECL_MEMBER(void *, CPlayerInventory_GetInventoryItemByItemID, unsigned long long param1, int* itemid) { - auto result = DETOUR_MEMBER_CALL(CPlayerInventory_GetInventoryItemByItemID)(param1, itemid); + auto result = DETOUR_MEMBER_CALL(param1, itemid); if (result == nullptr) { auto find = state.m_ExtraLoadoutItemsIDs.find(param1); if (find != state.m_ExtraLoadoutItemsIDs.end()) { @@ -5138,7 +5138,7 @@ namespace Mod::Pop::PopMgr_Extensions } else { data.name = value; - return DETOUR_MEMBER_CALL(CSpawnLocation_Parse)(kv); + return DETOUR_MEMBER_CALL(kv); } } return false; @@ -5147,7 +5147,7 @@ namespace Mod::Pop::PopMgr_Extensions // DETOUR_DECL_STATIC(void, MessageWriteString,const char *name) // { // DevMsg("MessageWriteString %s\n",name); - // DETOUR_STATIC_CALL(MessageWriteString)(name); + // DETOUR_STATIC_CALL(name); // } // RefCount rc_CTFGameRules_FireGameEvent_teamplay_round_start; @@ -5155,7 +5155,7 @@ namespace Mod::Pop::PopMgr_Extensions // { // SCOPED_INCREMENT_IF(rc_CTFGameRules_FireGameEvent_teamplay_round_start, FStrEq(event->GetName(), "teamplay_round_start")); // -// DETOUR_MEMBER_CALL(CTFGameRules_FireGameEvent)(event); +// DETOUR_MEMBER_CALL(event); // } // // DETOUR_DECL_MEMBER(void, CTFPlayer_ChangeTeam, int iTeamNum, bool b1, bool b2, bool b3) @@ -5168,13 +5168,13 @@ namespace Mod::Pop::PopMgr_Extensions // return; // } // -// DETOUR_MEMBER_CALL(CTFPlayer_ChangeTeam)(iTeamNum, b1, b2, b3); +// DETOUR_MEMBER_CALL(iTeamNum, b1, b2, b3); // } // DETOUR_DECL_MEMBER(void, CPopulationManager_PostInitialize) // { -// DETOUR_MEMBER_CALL(CPopulationManager_PostInitialize)(); +// DETOUR_MEMBER_CALL(); // } void Parse_DisallowedUpgrade(KeyValues *kv) { @@ -6011,7 +6011,7 @@ namespace Mod::Pop::PopMgr_Extensions }*/ /*DETOUR_DECL_MEMBER(void, CTFPlayer_ReapplyPlayerUpgrades) { - DETOUR_MEMBER_CALL(CTFPlayer_ReapplyPlayerUpgrades)(); + DETOUR_MEMBER_CALL(); auto player = reinterpret_cast(this); DevMsg("Adding attributes\n"); for(auto it = state.m_PlayerAttributes.begin(); it != state.m_PlayerAttributes.end(); ++it){ @@ -6033,7 +6033,7 @@ namespace Mod::Pop::PopMgr_Extensions pop_parse_successful = false; int state = TFGameRules()->State_Get(); - DETOUR_MEMBER_CALL(CPopulationManager_JumpToWave)(wave, f1); + DETOUR_MEMBER_CALL(wave, f1); DevMsg("[%8.3f] JumpToWave %d %d\n", gpGlobals->curtime, TFGameRules()->State_Get(), pop_parse_successful); @@ -6116,7 +6116,7 @@ namespace Mod::Pop::PopMgr_Extensions if (state.m_ScriptManager != nullptr) { state.m_ScriptManager->Remove(); } - DETOUR_MEMBER_CALL(CPopulationManager_ResetMap)(); + DETOUR_MEMBER_CALL(); } bool reading_popfile = false; @@ -6183,7 +6183,7 @@ namespace Mod::Pop::PopMgr_Extensions SCOPED_INCREMENT(rc_CPopulationManager_Parse); reading_popfile = true; - bool ret = DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + bool ret = DETOUR_MEMBER_CALL(); reading_popfile = false; state.ResetCVars(false); @@ -6326,14 +6326,14 @@ namespace Mod::Pop::PopMgr_Extensions } } - DETOUR_MEMBER_CALL(KeyValues_RecursiveMergeKeyValues)(included); + DETOUR_MEMBER_CALL(included); } DETOUR_DECL_MEMBER(bool, KeyValues_LoadFromBuffer, char const *resourceName, CUtlBuffer &buf, IBaseFileSystem* pFileSystem, const char *pPathID) { SCOPED_INCREMENT(rc_KeyValues_LoadFromBuffer); lastMergedKeyValues = nullptr; - return DETOUR_MEMBER_CALL(KeyValues_LoadFromBuffer)(resourceName, buf, pFileSystem, pPathID); + return DETOUR_MEMBER_CALL(resourceName, buf, pFileSystem, pPathID); } RefCount rc_CPopulationManager_IsValidPopfile; @@ -6341,7 +6341,7 @@ namespace Mod::Pop::PopMgr_Extensions { SCOPED_INCREMENT(rc_CPopulationManager_IsValidPopfile); return true; - //return DETOUR_MEMBER_CALL(CPopulationManager_IsValidPopfile)(name); + //return DETOUR_MEMBER_CALL(name); } bool changelevel_maxplayers = false; @@ -6904,7 +6904,7 @@ namespace Mod::Pop::PopMgr_Extensions kv->SetNextKey(loadKeyvaluesOverride); return true; } - return DETOUR_MEMBER_CALL(CBaseFileSystem_LoadKeyValues)(kv, type, filename, pPathID); + return DETOUR_MEMBER_CALL(kv, type, filename, pPathID); } @@ -6915,7 +6915,7 @@ namespace Mod::Pop::PopMgr_Extensions ++rc_KeyValues_LoadFromFile; - auto result = DETOUR_MEMBER_CALL(KeyValues_LoadFromFile)(filesystem, resourceName, pathID, refreshCache); + auto result = DETOUR_MEMBER_CALL(filesystem, resourceName, pathID, refreshCache); --rc_KeyValues_LoadFromFile; if (result && rc_CPopulationManager_Parse > 0 && rc_KeyValues_LoadFromFile == 0 && rc_CPopulationManager_IsValidPopfile == 0 && rc_Parse_Popfile == 0) { diff --git a/src/mod/pop/tank_extensions.cpp b/src/mod/pop/tank_extensions.cpp index 5224e38b..505bf066 100644 --- a/src/mod/pop/tank_extensions.cpp +++ b/src/mod/pop/tank_extensions.cpp @@ -93,7 +93,7 @@ namespace Mod::Pop::Tank_Extensions spawners.erase(spawner); - DETOUR_MEMBER_CALL(CTankSpawner_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTankSpawner_dtor2) @@ -104,7 +104,7 @@ namespace Mod::Pop::Tank_Extensions spawners.erase(spawner); - DETOUR_MEMBER_CALL(CTankSpawner_dtor2)(); + DETOUR_MEMBER_CALL(); } void Parse_Model(KeyValues *kv, SpawnerData &spawner) { @@ -366,7 +366,7 @@ namespace Mod::Pop::Tank_Extensions subkey->deleteThis(); } - auto result = DETOUR_MEMBER_CALL(CTankSpawner_Parse)(kv); + auto result = DETOUR_MEMBER_CALL(kv); if (loaded_from_template) { kv->deleteThis(); @@ -458,7 +458,7 @@ namespace Mod::Pop::Tank_Extensions SCOPED_INCREMENT(rc_CTankSpawner_Spawn); current_spawner = spawner; - auto result = DETOUR_MEMBER_CALL(CTankSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (result && ents != nullptr && !ents->IsEmpty()) { @@ -568,7 +568,7 @@ namespace Mod::Pop::Tank_Extensions } SCOPED_INCREMENT(rc_CTFTankBoss_TankBossThink); - DETOUR_MEMBER_CALL(CTFTankBoss_TankBossThink)(); + DETOUR_MEMBER_CALL(); if (data != nullptr && data->immobile) { tank->SetAbsOrigin(vec); @@ -606,8 +606,8 @@ namespace Mod::Pop::Tank_Extensions if (ent == tank) { if ((data->force_romevision && index == VISION_MODE_ROME) || (sig_no_romevision_cosmetics.GetBool() && index == VISION_MODE_NONE)) { - DETOUR_MEMBER_CALL(CBaseEntity_SetModelIndexOverride)(VISION_MODE_NONE, nValue); - DETOUR_MEMBER_CALL(CBaseEntity_SetModelIndexOverride)(VISION_MODE_ROME, nValue); + DETOUR_MEMBER_CALL(VISION_MODE_NONE, nValue); + DETOUR_MEMBER_CALL(VISION_MODE_ROME, nValue); } set = true; } @@ -627,8 +627,8 @@ namespace Mod::Pop::Tank_Extensions health_threshold -= health_per_model; } DevMsg("Health stage %d %d\n", data->custom_model[health_stage], health_stage); - DETOUR_MEMBER_CALL(CBaseEntity_SetModelIndexOverride)(VISION_MODE_NONE, data->custom_model[health_stage]); - DETOUR_MEMBER_CALL(CBaseEntity_SetModelIndexOverride)(VISION_MODE_ROME, data->custom_model[health_stage]); + DETOUR_MEMBER_CALL(VISION_MODE_NONE, data->custom_model[health_stage]); + DETOUR_MEMBER_CALL(VISION_MODE_ROME, data->custom_model[health_stage]); set = true; } // if (ent->GetMoveParent() == tank && ent->ClassMatches("prop_dynamic")) { @@ -640,7 +640,7 @@ namespace Mod::Pop::Tank_Extensions return; } - DETOUR_MEMBER_CALL(CBaseEntity_SetModelIndexOverride)(index, nValue); + DETOUR_MEMBER_CALL(index, nValue); } @@ -662,7 +662,7 @@ namespace Mod::Pop::Tank_Extensions } } - return DETOUR_MEMBER_CALL(CBaseAnimating_LookupAttachment)(szName); + return DETOUR_MEMBER_CALL(szName); } VHOOK_DECL(float, CTFBaseBossLocomotion_GetGravity) @@ -672,7 +672,7 @@ namespace Mod::Pop::Tank_Extensions return thinking_tank_data->gravity; } } - return VHOOK_CALL(CTFBaseBossLocomotion_GetGravity)(); + return VHOOK_CALL(); } VHOOK_DECL(bool, CTFBaseBossLocomotion_IsOnGround) @@ -682,7 +682,7 @@ namespace Mod::Pop::Tank_Extensions return true; } } - return VHOOK_CALL(CTFBaseBossLocomotion_IsOnGround)(); + return VHOOK_CALL(); } DETOUR_DECL_MEMBER(float, CTFBaseBossLocomotion_GetStepHeight) @@ -692,7 +692,7 @@ namespace Mod::Pop::Tank_Extensions return 0.0f; } } - return DETOUR_MEMBER_CALL(CTFBaseBossLocomotion_GetStepHeight)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, NextBotGroundLocomotion_Update) @@ -722,7 +722,7 @@ namespace Mod::Pop::Tank_Extensions prev_posz += move.z * loco->GetRunSpeed() * loco->GetUpdateInterval(); } } - DETOUR_MEMBER_CALL(NextBotGroundLocomotion_Update)(); + DETOUR_MEMBER_CALL(); if (rc_CTFTankBoss_TankBossThink && thinking_tank_data != nullptr) { if (thinking_tank_data->gravity == 0.0f && thinking_tank_data->gravity_set) @@ -759,7 +759,7 @@ namespace Mod::Pop::Tank_Extensions tf_base_boss_max_turn_rate.Set(data->max_turn_rate); } - DETOUR_MEMBER_CALL(CTFBaseBossLocomotion_FaceTowards)(vec); + DETOUR_MEMBER_CALL(vec); tf_base_boss_max_turn_rate.Reset(); } @@ -775,7 +775,7 @@ namespace Mod::Pop::Tank_Extensions return data->icon; } - return DETOUR_MEMBER_CALL(CTankSpawner_GetClassIcon)(index); + return DETOUR_MEMBER_CALL(index); } int restOfCurrency = -1; @@ -796,7 +796,7 @@ namespace Mod::Pop::Tank_Extensions restOfCurrency = MIN(1500, currency); SCOPED_INCREMENT(rc_CTFTankBoss_Event_Killed); - DETOUR_MEMBER_CALL(CTFTankBoss_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); restOfCurrency = -1; } @@ -811,7 +811,7 @@ namespace Mod::Pop::Tank_Extensions return data->is_miniboss; } - return DETOUR_MEMBER_CALL(CTankSpawner_IsMiniBoss)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, IPopulationSpawner_HasAttribute, CTFBot::AttributeType attr, int index) @@ -827,7 +827,7 @@ namespace Mod::Pop::Tank_Extensions } } - return DETOUR_MEMBER_CALL(IPopulationSpawner_HasAttribute)(attr, index); + return DETOUR_MEMBER_CALL(attr, index); } RefCount rc_CTFTankBoss_UpdatePingSound; @@ -836,7 +836,7 @@ namespace Mod::Pop::Tank_Extensions { SCOPED_INCREMENT(rc_CTFTankBoss_UpdatePingSound); - DETOUR_MEMBER_CALL(CTFTankBoss_UpdatePingSound)(); + DETOUR_MEMBER_CALL(); } RefCount rc_CTFTankBoss_Spawn; @@ -844,7 +844,7 @@ namespace Mod::Pop::Tank_Extensions { SCOPED_INCREMENT(rc_CTFTankBoss_Spawn); - DETOUR_MEMBER_CALL(CTFTankBoss_Spawn)(); + DETOUR_MEMBER_CALL(); } @@ -861,7 +861,7 @@ namespace Mod::Pop::Tank_Extensions sound = data->sound_start.c_str(); } } - DETOUR_MEMBER_CALL(CBaseEntity_EmitSound)(sound, start, duration); + DETOUR_MEMBER_CALL(sound, start, duration); } DETOUR_DECL_STATIC(void, CBaseEntity_EmitSound2, IRecipientFilter& filter, int iEntIndex, const char *sound, const Vector *pOrigin, float start, float *duration ) @@ -874,7 +874,7 @@ namespace Mod::Pop::Tank_Extensions sound = data->sound_engine_loop.c_str(); } } - DETOUR_STATIC_CALL(CBaseEntity_EmitSound2)(filter, iEntIndex, sound, pOrigin, start, duration); + DETOUR_STATIC_CALL(filter, iEntIndex, sound, pOrigin, start, duration); } RefCount rc_CTFTankBoss_Explode; @@ -886,12 +886,12 @@ namespace Mod::Pop::Tank_Extensions return nullptr; } } - return DETOUR_STATIC_CALL(CreateEntityByName)(className, iForceEdictIndex); + return DETOUR_STATIC_CALL(className, iForceEdictIndex); } DETOUR_DECL_MEMBER(void, CTFTankDestruction_Spawn) { - DETOUR_MEMBER_CALL(CTFTankDestruction_Spawn)(); + DETOUR_MEMBER_CALL(); auto destruction = reinterpret_cast(this); if (thinking_tank_data != nullptr && thinking_tank_data->model_destruction != -1) { for (int i = 0; i < MAX_VISION_MODES; ++i) { @@ -913,7 +913,7 @@ namespace Mod::Pop::Tank_Extensions } ++rc_CTFTankBoss_Explode; - DETOUR_MEMBER_CALL(CTFTankBoss_Explode)(); + DETOUR_MEMBER_CALL(); --rc_CTFTankBoss_Explode; if (thinking_tank_data != nullptr) { @@ -944,13 +944,13 @@ namespace Mod::Pop::Tank_Extensions } } - DETOUR_MEMBER_CALL(CTFTankBoss_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); } CBaseEntity *entityOnFireCollide; DETOUR_DECL_MEMBER(float, CTFFlameManager_GetFlameDamageScale, void * point, CTFPlayer * player) { - float ret = DETOUR_MEMBER_CALL(CTFFlameManager_GetFlameDamageScale)(point, player); + float ret = DETOUR_MEMBER_CALL(point, player); bool istank = entityOnFireCollide != nullptr && strcmp(entityOnFireCollide->GetClassname(),"tank_boss") == 0; if (istank) { ret+=0.04f; @@ -966,7 +966,7 @@ namespace Mod::Pop::Tank_Extensions DETOUR_DECL_MEMBER(void, CTFFlameManager_OnCollide, CBaseEntity* entity, int value) { entityOnFireCollide = entity; - DETOUR_MEMBER_CALL(CTFFlameManager_OnCollide)(entity, value); + DETOUR_MEMBER_CALL(entity, value); entityOnFireCollide = nullptr; } @@ -977,7 +977,7 @@ namespace Mod::Pop::Tank_Extensions auto tank = reinterpret_cast(this); SCOPED_INCREMENT(rc_CTFBaseBoss_OnTakeDamage); SCOPED_INCREMENT_IF(rc_CTFBaseBoss_OnTakeDamage_SameTeam, info.GetAttacker() != nullptr && info.GetAttacker()->GetTeamNumber() == tank->GetTeamNumber()); - return DETOUR_MEMBER_CALL(CTFBaseBoss_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } class CTakeDamageInfoTF2 : public CTakeDamageInfo @@ -988,7 +988,7 @@ namespace Mod::Pop::Tank_Extensions DETOUR_DECL_MEMBER(int, CTFGameRules_ApplyOnDamageModifyRules, CTakeDamageInfo& info, CBaseEntity *pVictim, bool b1) { - int result = DETOUR_MEMBER_CALL(CTFGameRules_ApplyOnDamageModifyRules)(info, pVictim, b1); + int result = DETOUR_MEMBER_CALL(info, pVictim, b1); if (rc_CTFBaseBoss_OnTakeDamage) { auto tank = reinterpret_cast(pVictim); SpawnerData *data = FindSpawnerDataForTank(tank); @@ -1009,7 +1009,7 @@ namespace Mod::Pop::Tank_Extensions if (data != nullptr && data->trigger_destroy_fix) { return; } - DETOUR_MEMBER_CALL(CTFBaseBoss_Touch)(toucher); + DETOUR_MEMBER_CALL(toucher); } RefCount rc_CTFBaseBoss_ResolvePlayerCollision; @@ -1017,7 +1017,7 @@ namespace Mod::Pop::Tank_Extensions { SpawnerData *data = FindSpawnerDataForBoss(reinterpret_cast(this)); SCOPED_INCREMENT_IF(rc_CTFBaseBoss_ResolvePlayerCollision, data != nullptr && data->no_crush_damage); - DETOUR_MEMBER_CALL(CTFBaseBoss_ResolvePlayerCollision)(toucher); + DETOUR_MEMBER_CALL(toucher); } DETOUR_DECL_MEMBER(int, CTFPlayer_OnTakeDamage, const CTakeDamageInfo& info) @@ -1026,7 +1026,7 @@ namespace Mod::Pop::Tank_Extensions if (rc_CTFBaseBoss_ResolvePlayerCollision || (rc_CTFTankBoss_TankBossThink && thinking_tank_data != nullptr&& thinking_tank_data->no_crush_damage) ) { return 0; } - return DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(uint, CTFTankBossBody_GetSolidMask) @@ -1035,7 +1035,7 @@ namespace Mod::Pop::Tank_Extensions if (data != nullptr && data->solid_to_brushes) { return CONTENTS_SOLID | CONTENTS_WINDOW | CONTENTS_MOVEABLE; } - return DETOUR_MEMBER_CALL(CTFTankBossBody_GetSolidMask)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(void, UTIL_ScreenShake, const Vector ¢er, float amplitude, float frequency, float duration, float radius, int eCommand, bool bAirShake) @@ -1043,19 +1043,19 @@ namespace Mod::Pop::Tank_Extensions if (rc_CTFTankBoss_TankBossThink && thinking_tank_data != nullptr && thinking_tank_data->no_screen_shake) { return; } - return DETOUR_STATIC_CALL(UTIL_ScreenShake)(center, amplitude, frequency, duration, radius, eCommand, bAirShake); + return DETOUR_STATIC_CALL(center, amplitude, frequency, duration, radius, eCommand, bAirShake); } DETOUR_DECL_STATIC(void, HandleRageGain, CTFPlayer *pPlayer, unsigned int iRequiredBuffFlags, float flDamage, float fInverseRageGainScale) { if (rc_CTFBaseBoss_OnTakeDamage_SameTeam) return; - DETOUR_STATIC_CALL(HandleRageGain)(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); + DETOUR_STATIC_CALL(pPlayer, iRequiredBuffFlags, flDamage, fInverseRageGainScale); } DETOUR_DECL_MEMBER(int, CTFTankBoss_GetCurrencyValue) { if (rc_CTFTankBoss_Event_Killed && restOfCurrency != -1) return restOfCurrency; - auto result = DETOUR_MEMBER_CALL(CTFTankBoss_GetCurrencyValue)(); + auto result = DETOUR_MEMBER_CALL(); return result; } diff --git a/src/mod/pop/tfbot_extensions.cpp b/src/mod/pop/tfbot_extensions.cpp index d8ca4fe6..9edeb072 100644 --- a/src/mod/pop/tfbot_extensions.cpp +++ b/src/mod/pop/tfbot_extensions.cpp @@ -359,7 +359,7 @@ namespace Mod::Pop::TFBot_Extensions // DevMsg("CTFBotSpawner %08x: dtor0, clearing data\n", (uintptr_t)spawner); RemoveSpawner(spawner); - DETOUR_MEMBER_CALL(CTFBotSpawner_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBotSpawner_dtor2) @@ -369,7 +369,7 @@ namespace Mod::Pop::TFBot_Extensions // DevMsg("CTFBotSpawner %08x: dtor2, clearing data\n", (uintptr_t)spawner); RemoveSpawner(spawner); - DETOUR_MEMBER_CALL(CTFBotSpawner_dtor2)(); + DETOUR_MEMBER_CALL(); } @@ -440,7 +440,7 @@ namespace Mod::Pop::TFBot_Extensions // DevMsg("CTFBot %08x: dtor0, clearing data\n", (uintptr_t)bot); ClearDataForBot(bot); - DETOUR_MEMBER_CALL(CTFBot_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFBot_dtor2) @@ -450,7 +450,7 @@ namespace Mod::Pop::TFBot_Extensions // DevMsg("CTFBot %08x: dtor2, clearing data\n", (uintptr_t)bot); ClearDataForBot(bot); - DETOUR_MEMBER_CALL(CTFBot_dtor2)(); + DETOUR_MEMBER_CALL(); } THINK_FUNC_DECL(HideBossBar) @@ -474,7 +474,7 @@ namespace Mod::Pop::TFBot_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_StateEnter)(nState); + DETOUR_MEMBER_CALL(nState); } DETOUR_DECL_MEMBER(void, CTFPlayer_StateLeave) @@ -515,7 +515,7 @@ namespace Mod::Pop::TFBot_Extensions } } - DETOUR_MEMBER_CALL(CTFPlayer_StateLeave)(); + DETOUR_MEMBER_CALL(); } void Parse_Action(SpawnerData &data, const char *value) @@ -715,7 +715,7 @@ namespace Mod::Pop::TFBot_Extensions subkey->deleteThis(); } - bool result = DETOUR_MEMBER_CALL(CTFBotSpawner_Parse)(kv); + bool result = DETOUR_MEMBER_CALL(kv); // delete the temporary copy of the KV subtree kv->deleteThis(); @@ -748,7 +748,7 @@ namespace Mod::Pop::TFBot_Extensions // { // DevMsg("Fired eventbef"); // DevMsg("Fired event"); - // DETOUR_STATIC_CALL(FireEvent)(info, name); + // DETOUR_STATIC_CALL(info, name); // } void TeleportToHint(CTFBot *actor,bool force) { if (!force && actor->IsPlayerClass(TF_CLASS_ENGINEER)) @@ -956,7 +956,7 @@ namespace Mod::Pop::TFBot_Extensions { if (FindTeleporter(STRING(spawnEnt->GetEntityName()), vSpawnPosition, true)) return SPAWN_LOCATION_TELEPORTER; - return DETOUR_STATIC_CALL(DoTeleporterOverride)(spawnEnt, vSpawnPosition, bClosestPointOnNav); + return DETOUR_STATIC_CALL(spawnEnt, vSpawnPosition, bClosestPointOnNav); } ConVar sig_pop_extra_bots_reserved_slots("sig_pop_extra_bots_reserved_slots", "8", FCVAR_NOTIFY | FCVAR_GAMEDLL, "Reserve this many regual slots for giants/preferred bots when extra player slots is enabled"); @@ -1012,7 +1012,7 @@ namespace Mod::Pop::TFBot_Extensions vec[i] = swap; } } - auto result = DETOUR_MEMBER_CALL(CTFBotSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (result && it != spawners.end()) { OnBotSpawn(spawner,ents, (*it).second); } @@ -1039,7 +1039,7 @@ namespace Mod::Pop::TFBot_Extensions g_pPopulationManager->PauseSpawning(); paused_wave_time = gpGlobals->tickcount; - return DETOUR_MEMBER_CALL(CTFGameRules_ClientConnected)(pEntity, pszName, pszAddress, reject, maxrejectlen); + return DETOUR_MEMBER_CALL(pEntity, pszName, pszAddress, reject, maxrejectlen); } DETOUR_DECL_MEMBER(Action *, CTFBotScenarioMonitor_InitialContainedAction, CTFBot *actor) @@ -1052,7 +1052,7 @@ namespace Mod::Pop::TFBot_Extensions actor->GetPlayerClass()->SetClassIndex(TF_CLASS_MEDIC); } } - auto *action = DETOUR_MEMBER_CALL(CTFBotScenarioMonitor_InitialContainedAction)(actor); + auto *action = DETOUR_MEMBER_CALL(actor); if (restoreClass != -1) { actor->GetPlayerClass()->SetClassIndex(restoreClass); } @@ -1118,7 +1118,7 @@ namespace Mod::Pop::TFBot_Extensions } //if (actor->m_nBotAttrs & CTFBot::AttributeType::ATTR_TELEPORT_TO_HINT) // TeleportToHint(actor,data != nullptr && data->action != ACTION_Default); - Action *action = DETOUR_MEMBER_CALL(CTFBotScenarioMonitor_DesiredScenarioAndClassAction)(actor); + Action *action = DETOUR_MEMBER_CALL(actor); /*if (data != nullptr && action != nullptr && data->action == ACTION_DestroySentries) { DevMsg("CTFBotSpawner: got bomber \n"); @@ -1162,7 +1162,7 @@ namespace Mod::Pop::TFBot_Extensions return EventDesiredResult::SuspendFor(reinterpret_cast(action)->InitialContainedActionTactical(actor), "Switch to a different action"); } - return VHOOK_CALL(CTFBotScenarioMonitor_OnCommandString)(actor, cmd); + return VHOOK_CALL(actor, cmd); } @@ -1174,14 +1174,14 @@ namespace Mod::Pop::TFBot_Extensions if (data != nullptr && data->action != ACTION_Default) return; - DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_AvoidBumpingEnemies)(actor); + DETOUR_MEMBER_CALL(actor); } RefCount rc_CTFBotScenarioMonitor_Update; DETOUR_DECL_MEMBER(ActionResult, CTFBotScenarioMonitor_Update, CTFBot *actor, float dt) { SCOPED_INCREMENT(rc_CTFBotScenarioMonitor_Update); - return DETOUR_MEMBER_CALL(CTFBotScenarioMonitor_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } RefCount rc_CTFBot_GetFlagToFetch; @@ -1216,7 +1216,7 @@ namespace Mod::Pop::TFBot_Extensions if (IsEngineer) { bot->GetPlayerClass()->SetClassIndex(TF_CLASS_SOLDIER); } - auto result = DETOUR_MEMBER_CALL(CTFBot_GetFlagToFetch)(); + auto result = DETOUR_MEMBER_CALL(); if (IsEngineer) { bot->GetPlayerClass()->SetClassIndex(TF_CLASS_ENGINEER); } @@ -1239,7 +1239,7 @@ namespace Mod::Pop::TFBot_Extensions // return false; // } - auto result = DETOUR_MEMBER_CALL(CTFPlayer_IsPlayerClass)(iClass); + auto result = DETOUR_MEMBER_CALL(iClass); if (rc_CTFBot_GetFlagToFetch > 0 && result && iClass == TF_CLASS_ENGINEER) { auto data = GetDataForBot(player); @@ -1264,7 +1264,7 @@ namespace Mod::Pop::TFBot_Extensions auto me = reinterpret_cast(this); DevMsg("executed suicide bomber%d %d\n",me->m_bDetReachedGoal, me->m_bDetonating ); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_OnStart)(actor, action); + auto result = DETOUR_MEMBER_CALL(actor, action); if (me->m_hTarget == nullptr && targets_sentrybuster.find(actor) != targets_sentrybuster.end()){ CBaseEntity *target = targets_sentrybuster[actor]; me->m_hTarget = target; @@ -1314,7 +1314,7 @@ namespace Mod::Pop::TFBot_Extensions me->m_nConsecutivePathFailures = 0; //DevMsg("\n[Update]\n"); //DevMsg("reached goal %d,detonating %d,failures %d, %d %f %f\n",me->m_bDetReachedGoal, me->m_bDetonating ,me->m_nConsecutivePathFailures,ENTINDEX(me->m_hTarget), me->m_vecDetonatePos.x, me->m_vecTargetPos.x); - auto result = DETOUR_MEMBER_CALL(CTFBotMissionSuicideBomber_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); return result; } @@ -1337,7 +1337,7 @@ namespace Mod::Pop::TFBot_Extensions return nullptr; } - return DETOUR_MEMBER_CALL(CTFBot_GetFlagCaptureZone)(); + return DETOUR_MEMBER_CALL(); } bool IsRangeLessThan( CBaseEntity *bot, const Vector &pos, float range) @@ -1359,7 +1359,7 @@ namespace Mod::Pop::TFBot_Extensions bool mannvsmachine = TFGameRules()->IsMannVsMachineMode(); if (!mannvsmachine) { - DETOUR_MEMBER_CALL(CTFBot_EquipBestWeaponForThreat)(threat); + DETOUR_MEMBER_CALL(threat); return; } @@ -1387,7 +1387,7 @@ namespace Mod::Pop::TFBot_Extensions } if (!set) - DETOUR_MEMBER_CALL(CTFBot_EquipBestWeaponForThreat)(threat); + DETOUR_MEMBER_CALL(threat); } // // TEST! REMOVE ME! @@ -1418,7 +1418,7 @@ namespace Mod::Pop::TFBot_Extensions SCOPED_INCREMENT(rc_CTFBot_ShouldFireCompressionBlast); if (!TFGameRules()->IsMannVsMachineMode() || !improved_airblast.GetBool()) - return DETOUR_MEMBER_CALL(CTFBot_ShouldFireCompressionBlast)(); + return DETOUR_MEMBER_CALL(); auto bot = reinterpret_cast(this); @@ -1522,7 +1522,7 @@ namespace Mod::Pop::TFBot_Extensions bot_shouldfirecompressionblast_difficulty = data->difficulty; //DevMsg("skill %d\n", bot_shouldfirecompressionblast_difficulty); } - bool ret = DETOUR_MEMBER_CALL(CTFBot_ShouldFireCompressionBlast)(); + bool ret = DETOUR_MEMBER_CALL(); bot_shouldfirecompressionblast = nullptr; return ret;*/ @@ -1536,16 +1536,16 @@ namespace Mod::Pop::TFBot_Extensions DevMsg("Unsee\n"); return false; } - bool ret = DETOUR_MEMBER_CALL(IVision_IsLineOfSightClear)(corrected); + bool ret = DETOUR_MEMBER_CALL(corrected); DevMsg("Can Reflect: %d \n", ret); return ret; } - return DETOUR_MEMBER_CALL(IVision_IsLineOfSightClear)(pos); + return DETOUR_MEMBER_CALL(pos); } DETOUR_DECL_MEMBER(void, CBaseProjectile_Spawn) { - DETOUR_MEMBER_CALL(CBaseProjectile_Spawn)(); + DETOUR_MEMBER_CALL(); auto projectile = reinterpret_cast(this); //DevMsg("SetBlockLos\n"); } @@ -1553,7 +1553,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(void, ISpatialPartition_EnumerateElementsInSphere, SpatialPartitionListMask_t listMask, const Vector& origin, float radius, bool coarseTest, IPartitionEnumerator *pIterator) { DevMsg("Radius: %f %f %f %f\n", radius, origin.x, origin.y, origin.z); - DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInSphere)(listMask, origin, radius, coarseTest, pIterator); + DETOUR_MEMBER_CALL(listMask, origin, radius, coarseTest, pIterator); } DETOUR_DECL_MEMBER(bool, CTFBot_IsBarrageAndReloadWeapon, CTFWeaponBase *gun) @@ -1563,7 +1563,7 @@ namespace Mod::Pop::TFBot_Extensions CALL_ATTRIB_HOOK_INT_ON_OTHER(gun, fire_when_full, auto_fires_full_clip); return fire_when_full == 0; } - return DETOUR_MEMBER_CALL(CTFBot_IsBarrageAndReloadWeapon)(gun); + return DETOUR_MEMBER_CALL(gun); } bool rc_CTFBotMainAction_Update = false; @@ -1575,7 +1575,7 @@ namespace Mod::Pop::TFBot_Extensions rc_CTFBotMainAction_Update = true; actor->SetTeamNumber(TF_TEAM_BLUE); } - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } ConVar sig_no_bot_partner_taunt("sig_no_bot_partner_taunt", "1", FCVAR_NONE, "Disable bots answering to partner taunts"); @@ -1590,7 +1590,7 @@ namespace Mod::Pop::TFBot_Extensions if (sig_no_bot_partner_taunt.GetBool() && player->IsBot()) return nullptr; - return DETOUR_MEMBER_CALL(CTFPlayer_FindPartnerTauntInitiator)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_CTFBotEscortFlagCarrier_Update; @@ -1598,7 +1598,7 @@ namespace Mod::Pop::TFBot_Extensions { auto data = GetDataForBot(actor); SCOPED_INCREMENT_IF(rc_CTFBotEscortFlagCarrier_Update, data != nullptr && data->action == ACTION_EscortFlag); - return DETOUR_MEMBER_CALL(CTFBotEscortFlagCarrier_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } RefCount rc_CTFBotAttackFlagDefenders_Update; @@ -1606,7 +1606,7 @@ namespace Mod::Pop::TFBot_Extensions { auto data = GetDataForBot(actor); SCOPED_INCREMENT_IF(rc_CTFBotAttackFlagDefenders_Update, data != nullptr && data->action == ACTION_EscortFlag); - return DETOUR_MEMBER_CALL(CTFBotAttackFlagDefenders_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } DETOUR_DECL_STATIC(int, GetBotEscortCount, int team) @@ -1614,7 +1614,7 @@ namespace Mod::Pop::TFBot_Extensions if (rc_CTFBotEscortFlagCarrier_Update > 0 || rc_CTFBotAttackFlagDefenders_Update > 0) return 0; - return DETOUR_STATIC_CALL(GetBotEscortCount)(team); + return DETOUR_STATIC_CALL(team); } bool is_this_map_ignoring_cannot_pickup = false; @@ -1625,26 +1625,26 @@ namespace Mod::Pop::TFBot_Extensions int cannotPickupInteligence = 0; CALL_ATTRIB_HOOK_INT_ON_OTHER(actor, cannotPickupInteligence, cannot_pick_up_intelligence); SCOPED_INCREMENT_IF(rc_CTFBotFetchFlag_Update, cannotPickupInteligence > 0 && !is_this_map_ignoring_cannot_pickup); - return DETOUR_MEMBER_CALL(CTFBotFetchFlag_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } DETOUR_DECL_MEMBER(void, CCaptureFlag_PickUp, CTFPlayer *player, bool invisible) { if (rc_CTFBotFetchFlag_Update) return; - DETOUR_MEMBER_CALL(CCaptureFlag_PickUp)(player, invisible); + DETOUR_MEMBER_CALL(player, invisible); } DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { ClearAllData(); - return DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayer_CanMoveDuringTaunt) { //CBaseClient *client = reinterpret_cast(this); - bool result = DETOUR_MEMBER_CALL(CTFPlayer_CanMoveDuringTaunt)(); + bool result = DETOUR_MEMBER_CALL(); CTFPlayer *player = reinterpret_cast(this); bool movetaunt = player->m_bAllowMoveDuringTaunt; float movespeed = player->m_flCurrentTauntMoveSpeed; @@ -1657,7 +1657,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_ParseSharedTauntDataFromEconItemView, CEconItemView *item) { - DETOUR_MEMBER_CALL(CTFPlayer_ParseSharedTauntDataFromEconItemView)(item); + DETOUR_MEMBER_CALL(item); auto player = reinterpret_cast(this); if (player->IsBot()) { @@ -1674,7 +1674,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(bool, CRandomChoiceSpawner_Parse, KeyValues *kv) { spawner_failed = false; - auto result = DETOUR_MEMBER_CALL(CRandomChoiceSpawner_Parse)(kv); + auto result = DETOUR_MEMBER_CALL(kv); if (spawner_failed) return false; return result; @@ -1682,7 +1682,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_STATIC(IPopulationSpawner *, IPopulationSpawner_ParseSpawner, IPopulator *populator, KeyValues *data) { - auto result = DETOUR_STATIC_CALL(IPopulationSpawner_ParseSpawner)(populator, data); + auto result = DETOUR_STATIC_CALL(populator, data); spawner_failed |= result == nullptr; @@ -1692,7 +1692,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(void, CTFBotDeliverFlag_OnEnd, CTFBot *me, Action< CTFBot > *nextAction) { CTFBot::AttributeType has_attr = me->m_nBotAttrs; - DETOUR_MEMBER_CALL(CTFBotDeliverFlag_OnEnd)(me, nextAction); + DETOUR_MEMBER_CALL(me, nextAction); static auto tf_mvm_bot_allow_flag_carrier_to_fight = ConVarRef("tf_mvm_bot_allow_flag_carrier_to_fight"); if (tf_mvm_bot_allow_flag_carrier_to_fight.IsValid() && tf_mvm_bot_allow_flag_carrier_to_fight.GetBool()) { me->m_nBotAttrs = has_attr; @@ -1713,7 +1713,7 @@ namespace Mod::Pop::TFBot_Extensions // DevMsg(" nextaction: %s", nextaction->GetName()); // } // DevMsg("\n"); - // DETOUR_MEMBER_CALL(Action_CTFBot_InvokeOnEnd)(actor, behavior, nextaction); + // DETOUR_MEMBER_CALL(actor, behavior, nextaction); // } DETOUR_DECL_MEMBER(EventDesiredResult, Action_CTFBot_OnKilled, CTFBot *actor, const CTakeDamageInfo& info) @@ -1721,7 +1721,7 @@ namespace Mod::Pop::TFBot_Extensions auto action = reinterpret_cast *>(this); DevMsg("OnKilled %s %s\n", actor->GetPlayerName(), action->GetName()); - return DETOUR_MEMBER_CALL(Action_CTFBot_OnKilled)(actor, info); + return DETOUR_MEMBER_CALL(actor, info); } DETOUR_DECL_MEMBER(void, CTFBotEscortSquadLeader_OnEnd, CTFBot *actor, Action *nextaction) @@ -1732,7 +1732,7 @@ namespace Mod::Pop::TFBot_Extensions action->m_actionToDoAfterSquadDisbands = nullptr; } - DETOUR_MEMBER_CALL(CTFBotEscortSquadLeader_OnEnd)(actor, nextaction); + DETOUR_MEMBER_CALL(actor, nextaction); } DETOUR_DECL_MEMBER(bool, CSquadSpawner_Parse, KeyValues *kv_orig) @@ -1777,7 +1777,7 @@ namespace Mod::Pop::TFBot_Extensions subkey->deleteThis(); } - auto result = DETOUR_MEMBER_CALL(CSquadSpawner_Parse)(kv_orig); + auto result = DETOUR_MEMBER_CALL(kv_orig); for (auto bot_spawner : spawner->m_SubSpawners) { auto find = spawners.find(static_cast(bot_spawner)); @@ -1794,7 +1794,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(ActionResult, CTFBotTacticalMonitor_Update, CTFBot *actor, float dt) { bot_tactical_monitor = actor; - auto result = DETOUR_MEMBER_CALL(CTFBotTacticalMonitor_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); bot_tactical_monitor = nullptr; return result; } @@ -1806,13 +1806,13 @@ namespace Mod::Pop::TFBot_Extensions if (data != nullptr && data->no_wait_for_formation) return false; } - return DETOUR_MEMBER_CALL(CTFBotSquad_ShouldSquadLeaderWaitForFormation)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CSquadSpawner_Spawn, const Vector& where, CUtlVector> *ents) { auto spawner = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CSquadSpawner_Spawn)(where, ents); + auto result = DETOUR_MEMBER_CALL(where, ents); if (result) { for (int i = 0; i < ents->Count(); i++) { CTFBot *bot = ToTFBot(ents->Element(i)); @@ -1832,7 +1832,7 @@ namespace Mod::Pop::TFBot_Extensions if (spawners[current_spawner].no_idle_sound) return; - DETOUR_MEMBER_CALL(CTFBot_StartIdleSound)(); + DETOUR_MEMBER_CALL(); } @@ -1840,7 +1840,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(void, CTFPlayer_Regenerate, bool ammo) { SCOPED_INCREMENT_IF(rc_CTFPlayer_Regenerate,TFGameRules()->IsMannVsMachineMode() && reinterpret_cast(this)->IsBot()); - DETOUR_MEMBER_CALL(CTFPlayer_Regenerate)(ammo); + DETOUR_MEMBER_CALL(ammo); } DETOUR_DECL_MEMBER(void, CTFPlayer_GiveDefaultItems) @@ -1848,7 +1848,7 @@ namespace Mod::Pop::TFBot_Extensions if (rc_CTFPlayer_Regenerate) return; - DETOUR_MEMBER_CALL(CTFPlayer_GiveDefaultItems)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CSpawnLocation_FindSpawnLocation, Vector& vSpawnPosition) @@ -1861,7 +1861,7 @@ namespace Mod::Pop::TFBot_Extensions } } - return DETOUR_MEMBER_CALL(CSpawnLocation_FindSpawnLocation)(vSpawnPosition); + return DETOUR_MEMBER_CALL(vSpawnPosition); } DETOUR_DECL_MEMBER(bool, CBaseCombatCharacter_Weapon_Detach, CBaseCombatWeapon *weapon) @@ -1869,14 +1869,14 @@ namespace Mod::Pop::TFBot_Extensions if (weapon == nullptr) return false; - return DETOUR_MEMBER_CALL(CBaseCombatCharacter_Weapon_Detach)(weapon); + return DETOUR_MEMBER_CALL(weapon); } RefCount rc_CBasePlayer_ChangeTeam; DETOUR_DECL_MEMBER(void, CBasePlayer_ChangeTeam, int iTeamNum, bool b1, bool b2, bool b3) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBasePlayer_ChangeTeam)(iTeamNum, b1, b2, b3); + DETOUR_MEMBER_CALL(iTeamNum, b1, b2, b3); SCOPED_INCREMENT(rc_CBasePlayer_ChangeTeam); } @@ -1886,7 +1886,7 @@ namespace Mod::Pop::TFBot_Extensions // Msg("FireGameEvent\n"); // if (rc_CBasePlayer_ChangeTeam) return; - // DETOUR_MEMBER_CALL(CQuestItemTracker_FireGameEvent)(event); + // DETOUR_MEMBER_CALL(event); } DETOUR_DECL_MEMBER(void, CQuestItemTracker_FireGameEvent_NonVirtual, IGameEvent* event) { @@ -1894,7 +1894,7 @@ namespace Mod::Pop::TFBot_Extensions //Msg("FireGameEvent\n"); // if (rc_CBasePlayer_ChangeTeam) return; - // DETOUR_MEMBER_CALL(CQuestItemTracker_FireGameEvent_NonVirtual)(event); + // DETOUR_MEMBER_CALL(event); } DETOUR_DECL_MEMBER(bool, CBasePlayer_GetSteamID, CSteamID *pID) @@ -1902,7 +1902,7 @@ namespace Mod::Pop::TFBot_Extensions auto ptr = reinterpret_cast(this); if (ptr == nullptr) return false; - return DETOUR_MEMBER_CALL(CBasePlayer_GetSteamID)(pID); + return DETOUR_MEMBER_CALL(pID); } RefCount rc_IVision_IsAbleToSee; @@ -1920,7 +1920,7 @@ namespace Mod::Pop::TFBot_Extensions vision_subject = subject; auto entity = reinterpret_cast(this)->GetBot()->GetEntity(); vision_entity_melee = entity->GetActiveWeapon() != nullptr && entity->GetActiveWeapon()->IsMeleeWeapon(); - bool ret = DETOUR_MEMBER_CALL(IVision_IsAbleToSee)(subject,checkFOV, visibleSpot); + bool ret = DETOUR_MEMBER_CALL(subject,checkFOV, visibleSpot); vision_subject = nullptr; vision_entity_melee = false; @@ -1953,7 +1953,7 @@ namespace Mod::Pop::TFBot_Extensions if (rc_IVision_IsAbleToSee && vision_subject != nullptr && !vision_entity_melee && vision_subject->IsPlayer() && ToTFPlayer(vision_subject)->IsRealPlayer()) { return true; } - bool ret = DETOUR_MEMBER_CALL(CNavArea_IsPotentiallyVisible)(area); + bool ret = DETOUR_MEMBER_CALL(area); if (!ret && rc_IVision_IsAbleToSee && !vision_entity_melee && vision_subject != nullptr && !IsOnNav(vision_subject, 20, 4)) { return true; } @@ -1962,7 +1962,7 @@ namespace Mod::Pop::TFBot_Extensions // DETOUR_DECL_MEMBER(const CKnownEntity *, CTFBotMainAction_SelectCloserThreat, CTFBot *me, const CKnownEntity *threat1, const CKnownEntity *threat2) // { - // auto closer = DETOUR_MEMBER_CALL(CTFBotMainAction_SelectCloserThreat)(me, threat1, threat2); + // auto closer = DETOUR_MEMBER_CALL(me, threat1, threat2); // if (me->GetActiveTFWeapon() != nullptr && me->GetActiveTFWeapon()->IsMeleeWeapon()) { // float meleeRange = 48 * me->GetModelScale(); // float maxZ = me->EyePosition().z - me->GetAbsOrigin().z + meleeRange; @@ -1995,7 +1995,7 @@ namespace Mod::Pop::TFBot_Extensions } } - return DETOUR_MEMBER_CALL(CTFPlayer_ShouldDropAmmoPack)(); + return DETOUR_MEMBER_CALL(); } RefCount rc_CTFPlayer_DropAmmoPack; @@ -2003,7 +2003,7 @@ namespace Mod::Pop::TFBot_Extensions { SCOPED_INCREMENT(rc_CTFPlayer_DropAmmoPack); - DETOUR_MEMBER_CALL(CTFPlayer_DropAmmoPack)(info, b1, b2); + DETOUR_MEMBER_CALL(info, b1, b2); } DETOUR_DECL_STATIC(CTFAmmoPack *, CTFAmmoPack_Create, const Vector& vecOrigin, const QAngle& vecAngles, CBaseEntity *pOwner, const char *pszModelName) @@ -2015,7 +2015,7 @@ namespace Mod::Pop::TFBot_Extensions return nullptr; } - return DETOUR_STATIC_CALL(CTFAmmoPack_Create)(vecOrigin, vecAngles, pOwner, pszModelName); + return DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pszModelName); } DETOUR_DECL_STATIC(CTFDroppedWeapon *, CTFDroppedWeapon_Create, CTFPlayer *pOwner, const Vector& vecOrigin, const QAngle& vecAngles, const char *pszModelName, const CEconItemView *pItemView) @@ -2033,7 +2033,7 @@ namespace Mod::Pop::TFBot_Extensions TFGameRules()->Set_m_bPlayingMannVsMachine(is_mvm_mode && !(data != nullptr && data->drop_weapon) && !(dropped_weapon_val != 0.0f)); - auto result = DETOUR_STATIC_CALL(CTFDroppedWeapon_Create)(pOwner, vecOrigin, vecAngles, pszModelName, pItemView); + auto result = DETOUR_STATIC_CALL(pOwner, vecOrigin, vecAngles, pszModelName, pItemView); if (result != nullptr) { CAttributeList &list = result->m_Item->GetAttributeList(); @@ -2061,7 +2061,7 @@ namespace Mod::Pop::TFBot_Extensions auto mod = me->GetOrCreateEntityModule("teleportwhere"); mod->teleportWhere.insert(szValue); } - return VHOOK_CALL(CObjectTeleporter_KeyValue)(szKeyName, szValue); + return VHOOK_CALL(szKeyName, szValue); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CBaseObject_FindBuildPointOnPlayer, CTFPlayer *pTFPlayer, CBasePlayer *pBuilder, float &flNearestPoint, Vector &vecNearestBuildPoint) @@ -2070,7 +2070,7 @@ namespace Mod::Pop::TFBot_Extensions CBaseEntity *oldBuildOnEntity = object->GetBuiltOnEntity(); float oldNearestPoint = flNearestPoint; Vector oldNearestBuildPoint = vecNearestBuildPoint; - auto result = DETOUR_MEMBER_CALL(CBaseObject_FindBuildPointOnPlayer)(pTFPlayer, pBuilder, flNearestPoint, vecNearestBuildPoint); + auto result = DETOUR_MEMBER_CALL(pTFPlayer, pBuilder, flNearestPoint, vecNearestBuildPoint); if (result && oldBuildOnEntity != nullptr && oldNearestPoint != 9999) { Vector forward; AngleVectors(pBuilder->EyeAngles(), &forward); @@ -2087,7 +2087,7 @@ namespace Mod::Pop::TFBot_Extensions DETOUR_DECL_MEMBER(bool,CTFBotDeliverFlag_UpgradeOverTime, CTFBot *bot) { SCOPED_INCREMENT(rc_CTFBotDeliverFlag_UpgradeOverTime); - auto result = DETOUR_MEMBER_CALL(CTFBotDeliverFlag_UpgradeOverTime)(bot); + auto result = DETOUR_MEMBER_CALL(bot); return result; } @@ -2096,14 +2096,14 @@ namespace Mod::Pop::TFBot_Extensions { if (rc_CTFBotDeliverFlag_UpgradeOverTime && nCond == TF_COND_CRITBOOSTED) nCond = TF_COND_CRITBOOSTED_USER_BUFF; - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } int current_ai_team_num = -1; DETOUR_DECL_MEMBER(void, NextBotPlayer_CTFPlayer_Update) { current_ai_team_num = reinterpret_cast(this)->GetTeamNumber(); - DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_Update)(); + DETOUR_MEMBER_CALL(); current_ai_team_num = -1; } @@ -2114,14 +2114,14 @@ namespace Mod::Pop::TFBot_Extensions if (entity != nullptr && entity->IsCombatItem() && current_ai_team_num == entity->GetTeamNumber()) return false; - return DETOUR_STATIC_CALL(IgnoreActorsTraceFilterFunction)(entity, contents); + return DETOUR_STATIC_CALL(entity, contents); } DETOUR_DECL_MEMBER(void, CTFBot_Spawn) { auto bot = reinterpret_cast(this); bot->m_pWaveSpawnPopulator = nullptr; - DETOUR_MEMBER_CALL(CTFBot_Spawn)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_RemoveOwnedProjectiles) @@ -2149,7 +2149,7 @@ namespace Mod::Pop::TFBot_Extensions } } } - DETOUR_MEMBER_CALL(CTFPlayer_RemoveOwnedProjectiles)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CTFKnife_CanPerformBackstabAgainstTarget, CTFPlayer *target ) @@ -2160,7 +2160,7 @@ namespace Mod::Pop::TFBot_Extensions if (sappedNotStunned) target->m_Shared->GetCondData().RemoveCondBit(TF_COND_SAPPED); } - bool ret = DETOUR_MEMBER_CALL(CTFKnife_CanPerformBackstabAgainstTarget)(target); + bool ret = DETOUR_MEMBER_CALL(target); if (sappedNotStunned) { target->m_Shared->GetCondData().AddCondBit(TF_COND_SAPPED); @@ -2182,7 +2182,7 @@ namespace Mod::Pop::TFBot_Extensions cmd->mousedx = 0; cmd->mousedy = 0; } - DETOUR_MEMBER_CALL(CTFPlayer_PlayerRunCommand)(cmd, moveHelper); + DETOUR_MEMBER_CALL(cmd, moveHelper); } DETOUR_DECL_MEMBER(void, PlayerBody_Upkeep) @@ -2191,7 +2191,7 @@ namespace Mod::Pop::TFBot_Extensions auto player = static_cast(body->GetBot()->GetEntity()); if (player->m_Shared->InCond(TF_COND_FREEZE_INPUT)) return; if (!player->m_bAllowMoveDuringTaunt && player->m_Shared->InCond(TF_COND_TAUNTING)) return; - DETOUR_MEMBER_CALL(PlayerBody_Upkeep)(); + DETOUR_MEMBER_CALL(); } class TeleportEffectModule : public EntityModule, public AutoList @@ -2225,7 +2225,7 @@ namespace Mod::Pop::TFBot_Extensions particles->AddEntityModule("tpeffects", new TeleportEffectModule(particles)); player->SetCustomVariable("tpparticles", Variant((CBaseEntity *)particles)); } - DETOUR_MEMBER_CALL(CTFPlayerShared_OnConditionAdded)(cond); + DETOUR_MEMBER_CALL(cond); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_OnConditionRemoved, ETFCond cond) @@ -2237,7 +2237,7 @@ namespace Mod::Pop::TFBot_Extensions value.Entity()->Remove(); } } - DETOUR_MEMBER_CALL(CTFPlayerShared_OnConditionRemoved)(cond); + DETOUR_MEMBER_CALL(cond); } class CMod : public IMod, public IModCallbackListener, public IFrameUpdatePostEntityThinkListener diff --git a/src/mod/pop/wave_extensions.cpp b/src/mod/pop/wave_extensions.cpp index db9bd512..e56afe8c 100644 --- a/src/mod/pop/wave_extensions.cpp +++ b/src/mod/pop/wave_extensions.cpp @@ -195,7 +195,7 @@ namespace Mod::Pop::Wave_Extensions WaveCleanup(wave); waves.erase(wave); - DETOUR_MEMBER_CALL(CWave_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CWave_dtor2) @@ -205,7 +205,7 @@ namespace Mod::Pop::Wave_Extensions // DevMsg("CWave %08x: dtor2\n", (uintptr_t)wave); waves.erase(wave); - DETOUR_MEMBER_CALL(CWave_dtor2)(); + DETOUR_MEMBER_CALL(); } @@ -479,7 +479,7 @@ namespace Mod::Pop::Wave_Extensions DETOUR_DECL_MEMBER(bool, CPopulationManager_Parse) { waves_vec.clear(); - return DETOUR_MEMBER_CALL(CPopulationManager_Parse)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CWave_Parse, KeyValues *kv) @@ -546,7 +546,7 @@ namespace Mod::Pop::Wave_Extensions subkey->deleteThis(); } - auto ret = DETOUR_MEMBER_CALL(CWave_Parse)(kv); + auto ret = DETOUR_MEMBER_CALL(kv); return ret; } @@ -781,7 +781,7 @@ namespace Mod::Pop::Wave_Extensions { auto player = reinterpret_cast(this); bool show_wave_expl = !player->IsBot() && player->GetPlayerClass()->GetClassIndex() == TF_CLASS_UNDEFINED; - DETOUR_MEMBER_CALL(CTFPlayer_HandleCommand_JoinClass)(pClassName, b1); + DETOUR_MEMBER_CALL(pClassName, b1); if (show_wave_expl && TFGameRules()->IsMannVsMachineMode()) THINK_FUNC_SET(player, DelayExplaination, gpGlobals->curtime + 2.0f); } @@ -829,7 +829,7 @@ namespace Mod::Pop::Wave_Extensions DevMsg("[%8.3f] JumpToWave\n", gpGlobals->curtime); rc_JumpToWave++; - DETOUR_MEMBER_CALL(CPopulationManager_JumpToWave)(wave, f1); + DETOUR_MEMBER_CALL(wave, f1); rc_JumpToWave--; OnWaveBegin(false); @@ -841,13 +841,13 @@ namespace Mod::Pop::Wave_Extensions CWave *wave = g_pPopulationManager->GetCurrentWave(); if (wave != nullptr) WaveCleanup(wave); - DETOUR_MEMBER_CALL(CPopulationManager_WaveEnd)(b1); + DETOUR_MEMBER_CALL(b1); OnWaveBegin(true); } DETOUR_DECL_MEMBER(void, CMannVsMachineStats_RoundEvent_WaveEnd, bool success) { - DETOUR_MEMBER_CALL(CMannVsMachineStats_RoundEvent_WaveEnd)(success); + DETOUR_MEMBER_CALL(success); if (!success && rc_JumpToWave == 0) { //DevMsg("[%8.3f] RoundEvent_WaveEnd\n", gpGlobals->curtime); OnWaveBegin(false); @@ -992,7 +992,7 @@ namespace Mod::Pop::Wave_Extensions auto it = waves.find(wave); if (it == waves.end()) { - DETOUR_MEMBER_CALL(CWave_ActiveWaveUpdate)(); + DETOUR_MEMBER_CALL(); return; } WaveData& data = (*it).second; @@ -1077,7 +1077,7 @@ namespace Mod::Pop::Wave_Extensions // ^^^^ PRE-DETOUR =================================================== - DETOUR_MEMBER_CALL(CWave_ActiveWaveUpdate)(); + DETOUR_MEMBER_CALL(); // vvvv POST-DETOUR =================================================== @@ -1110,7 +1110,7 @@ namespace Mod::Pop::Wave_Extensions DETOUR_DECL_MEMBER(bool, CWave_IsDoneWithNonSupportWaves) { - bool done = DETOUR_MEMBER_CALL(CWave_IsDoneWithNonSupportWaves)(); + bool done = DETOUR_MEMBER_CALL(); auto wave = reinterpret_cast(this); @@ -1199,7 +1199,7 @@ namespace Mod::Pop::Wave_Extensions StopSoundLoop(); } - DETOUR_MEMBER_CALL(CTeamplayRoundBasedRules_State_Enter)(newState); + DETOUR_MEMBER_CALL(newState); } BossInfo *GetBossInfo(CBaseEntity *entity) @@ -1217,7 +1217,7 @@ namespace Mod::Pop::Wave_Extensions /* block attempts by MONOCULUS to switch to CEyeballBossTeleport */ DETOUR_DECL_MEMBER(ActionResult, CEyeballBossIdle_Update, CEyeballBoss *actor, float dt) { - auto result = DETOUR_MEMBER_CALL(CEyeballBossIdle_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (result.transition == ActionTransition::CHANGE_TO && strcmp(result.reason, "Moving...") == 0) { if (TFGameRules()->IsMannVsMachineMode() && GetBossInfo(actor) != nullptr) { @@ -1239,7 +1239,7 @@ namespace Mod::Pop::Wave_Extensions SCOPED_INCREMENT_IF(rc_CEyeballBossDead_Update__and_is_from_spawner, (TFGameRules()->IsMannVsMachineMode() && GetBossInfo(actor) != nullptr)); - return DETOUR_MEMBER_CALL(CEyeballBossDead_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } /* prevent MONOCULUS's death from spawning a teleport vortex */ @@ -1249,7 +1249,7 @@ namespace Mod::Pop::Wave_Extensions return nullptr; } - return DETOUR_STATIC_CALL(CBaseEntity_Create)(szName, vecOrigin, vecAngles, pOwner); + return DETOUR_STATIC_CALL(szName, vecOrigin, vecAngles, pOwner); } /* set MONOCULUS's lifetime from the spawner parameter instead of from the global convars */ @@ -1257,7 +1257,7 @@ namespace Mod::Pop::Wave_Extensions { auto me = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CEyeballBossIdle_OnStart)(actor, action); + auto result = DETOUR_MEMBER_CALL(actor, action); if (TFGameRules()->IsMannVsMachineMode()) { auto *info = GetBossInfo(actor); @@ -1271,7 +1271,7 @@ namespace Mod::Pop::Wave_Extensions DETOUR_DECL_MEMBER(void, CUpgrades_GrantOrRemoveAllUpgrades, CTFPlayer * player, bool remove, bool refund) { - DETOUR_MEMBER_CALL(CUpgrades_GrantOrRemoveAllUpgrades)(player, remove, refund); + DETOUR_MEMBER_CALL(player, remove, refund); WaveData *data = GetCurrentWaveData(); if (data == nullptr) return; @@ -1301,7 +1301,7 @@ namespace Mod::Pop::Wave_Extensions } } } - DETOUR_MEMBER_CALL(CTFPlayer_ReapplyItemUpgrades)(item_view); + DETOUR_MEMBER_CALL(item_view); } DETOUR_DECL_STATIC(void, SV_ComputeClientPacks, int clientCount, void **clients, void *snapshot) @@ -1319,7 +1319,7 @@ namespace Mod::Pop::Wave_Extensions TFObjectiveResource()->m_nMannVsMachineMaxWaveCount = data->custom_max_wave_number; } } - DETOUR_STATIC_CALL(SV_ComputeClientPacks)(clientCount, clients, snapshot); + DETOUR_STATIC_CALL(clientCount, clients, snapshot); if (wave_number != INT_MIN) { TFObjectiveResource()->m_nMannVsMachineWaveCount = wave_number; } diff --git a/src/mod/pop/wavespawn_extensions.cpp b/src/mod/pop/wavespawn_extensions.cpp index a5a694f6..c71058b1 100644 --- a/src/mod/pop/wavespawn_extensions.cpp +++ b/src/mod/pop/wavespawn_extensions.cpp @@ -539,7 +539,7 @@ namespace Mod::Pop::WaveSpawn_Extensions // DevMsg("CWaveSpawnPopulator %08x: dtor0\n", (uintptr_t)wavespawn); wavespawns.erase(wavespawn); - DETOUR_MEMBER_CALL(CWaveSpawnPopulator_dtor0)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CWaveSpawnPopulator_dtor2) @@ -549,7 +549,7 @@ namespace Mod::Pop::WaveSpawn_Extensions // DevMsg("CWaveSpawnPopulator %08x: dtor2\n", (uintptr_t)wavespawn); wavespawns.erase(wavespawn); - DETOUR_MEMBER_CALL(CWaveSpawnPopulator_dtor2)(); + DETOUR_MEMBER_CALL(); } void DisplayMessages(std::vector &messages ) { @@ -601,7 +601,7 @@ namespace Mod::Pop::WaveSpawn_Extensions { auto wave = wave_parsing = reinterpret_cast(this); - auto ret = DETOUR_MEMBER_CALL(CWave_Parse)(kv); + auto ret = DETOUR_MEMBER_CALL(kv); wave_parsing = nullptr; SetWaveSpawnWait(wave, false); @@ -676,7 +676,7 @@ namespace Mod::Pop::WaveSpawn_Extensions auto statePre = wavespawn->m_state; updatingWaveSpawn = wavespawn; - DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Update)(); + DETOUR_MEMBER_CALL(); // CWaveSpawnPopulator::SetState got partially inlined (for other states than done and wait for dead), need to manually check for changes if (statePre != wavespawn->m_state && wavespawn->m_state != CWaveSpawnPopulator::DONE && wavespawn->m_state != CWaveSpawnPopulator::WAIT_FOR_ALL_DEAD) { StateChanged(wavespawn, wavespawn->m_state); @@ -698,7 +698,7 @@ namespace Mod::Pop::WaveSpawn_Extensions // DevMsg("CWaveSpawnPopulator %08x: dtor2\n", (uintptr_t)wavespawn); - DETOUR_MEMBER_CALL(CWaveSpawnPopulator_SetState)(state); + DETOUR_MEMBER_CALL(state); } DETOUR_DECL_STATIC(IPopulationSpawner *, IPopulationSpawner_ParseSpawner, IPopulator *populator, KeyValues *data) @@ -739,7 +739,7 @@ namespace Mod::Pop::WaveSpawn_Extensions return spawner; } - auto result = DETOUR_STATIC_CALL(IPopulationSpawner_ParseSpawner)(populator, data); + auto result = DETOUR_STATIC_CALL(populator, data); return result; } @@ -833,7 +833,7 @@ namespace Mod::Pop::WaveSpawn_Extensions subkey->deleteThis(); } - bool result = DETOUR_MEMBER_CALL(CWaveSpawnPopulator_Parse)(kv); + bool result = DETOUR_MEMBER_CALL(kv); // delete the temporary copy of the KV subtree kv->deleteThis(); @@ -860,7 +860,7 @@ namespace Mod::Pop::WaveSpawn_Extensions DETOUR_DECL_MEMBER(void, CWave_AddClassType, string_t icon, int count, unsigned int flags) { if (last_wavespawn_hidden && wave_parsing != nullptr) return; - DETOUR_MEMBER_CALL(CWave_AddClassType)(icon, count, flags); + DETOUR_MEMBER_CALL(icon, count, flags); } ConVar sig_pop_wavespawn_spawnbot_stall_fix("sig_pop_wavespawn_spawnbot_stall_fix", "0", FCVAR_GAMEDLL, "Mod: Fix wavespawn reserving slots even when spawnbot is disabled"); @@ -868,7 +868,7 @@ namespace Mod::Pop::WaveSpawn_Extensions DETOUR_DECL_MEMBER(int, CSpawnLocation_FindSpawnLocation, Vector& vSpawnPosition) { - auto result = DETOUR_MEMBER_CALL(CSpawnLocation_FindSpawnLocation)(vSpawnPosition); + auto result = DETOUR_MEMBER_CALL(vSpawnPosition); if (sig_pop_wavespawn_spawnbot_stall_fix.GetBool() && result == SPAWN_LOCATION_NOT_FOUND && updatingWaveSpawn != nullptr) { if (updatingWaveSpawn != nullptr && updatingWaveSpawn->m_bHasTFBotSpawner) @@ -983,7 +983,7 @@ namespace Mod::Pop::WaveSpawn_Extensions { auto wave = reinterpret_cast(this); allWaiting = true; - DETOUR_MEMBER_CALL(CWave_ActiveWaveUpdate)(); + DETOUR_MEMBER_CALL(); if (wave->IsDoneWithNonSupportWaves()) { RemoveAllWaveEntities(true, false); } @@ -1013,7 +1013,7 @@ namespace Mod::Pop::WaveSpawn_Extensions /* block attempts by MONOCULUS to switch to CEyeballBossTeleport */ DETOUR_DECL_MEMBER(ActionResult, CEyeballBossIdle_Update, CEyeballBoss *actor, float dt) { - auto result = DETOUR_MEMBER_CALL(CEyeballBossIdle_Update)(actor, dt); + auto result = DETOUR_MEMBER_CALL(actor, dt); if (result.transition == ActionTransition::CHANGE_TO && strcmp(result.reason, "Moving...") == 0) { if (TFGameRules()->IsMannVsMachineMode() && GetBossInfo(actor) != nullptr) { @@ -1035,7 +1035,7 @@ namespace Mod::Pop::WaveSpawn_Extensions SCOPED_INCREMENT_IF(rc_CEyeballBossDead_Update__and_is_from_spawner, (TFGameRules()->IsMannVsMachineMode() && GetBossInfo(actor) != nullptr)); - return DETOUR_MEMBER_CALL(CEyeballBossDead_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } /* prevent MONOCULUS's death from spawning a teleport vortex */ @@ -1045,7 +1045,7 @@ namespace Mod::Pop::WaveSpawn_Extensions return nullptr; } - return DETOUR_STATIC_CALL(CBaseEntity_Create)(szName, vecOrigin, vecAngles, pOwner); + return DETOUR_STATIC_CALL(szName, vecOrigin, vecAngles, pOwner); } /* set MONOCULUS's lifetime from the spawner parameter instead of from the global convars */ @@ -1053,7 +1053,7 @@ namespace Mod::Pop::WaveSpawn_Extensions { auto me = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CEyeballBossIdle_OnStart)(actor, action); + auto result = DETOUR_MEMBER_CALL(actor, action); if (TFGameRules()->IsMannVsMachineMode()) { auto *info = GetBossInfo(actor); @@ -1079,19 +1079,19 @@ namespace Mod::Pop::WaveSpawn_Extensions DETOUR_DECL_MEMBER(float, CZombieLocomotion_GetRunSpeed) { float speed = GetSpeed(reinterpret_cast(this)); - return speed != FLT_MAX ? speed : DETOUR_MEMBER_CALL(CZombieLocomotion_GetRunSpeed)(); + return speed != FLT_MAX ? speed : DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CHeadlessHatmanLocomotion_GetRunSpeed) { float speed = GetSpeed(reinterpret_cast(this)); - return speed != FLT_MAX ? speed : DETOUR_MEMBER_CALL(CHeadlessHatmanLocomotion_GetRunSpeed)(); + return speed != FLT_MAX ? speed : DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(float, CMerasmusLocomotion_GetRunSpeed) { float speed = GetSpeed(reinterpret_cast(this)); - return speed != FLT_MAX ? speed : DETOUR_MEMBER_CALL(CMerasmusLocomotion_GetRunSpeed)(); + return speed != FLT_MAX ? speed : DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CEyeballBossLocomotion_Approach, const Vector &goal, float goalweight) @@ -1104,7 +1104,7 @@ namespace Mod::Pop::WaveSpawn_Extensions old_speed = tf_eyeball_boss_acceleration.GetFloat(); tf_eyeball_boss_acceleration.SetValue(speed); } - DETOUR_MEMBER_CALL(CEyeballBossLocomotion_Approach)(goal, goalweight); + DETOUR_MEMBER_CALL(goal, goalweight); if (speed != FLT_MAX) { tf_eyeball_boss_acceleration.SetValue(old_speed); } @@ -1112,14 +1112,14 @@ namespace Mod::Pop::WaveSpawn_Extensions DETOUR_DECL_MEMBER(float, NextBotGroundLocomotion_GetMaxAcceleration) { - float default_speed = DETOUR_MEMBER_CALL(NextBotGroundLocomotion_GetMaxAcceleration)(); + float default_speed = DETOUR_MEMBER_CALL(); float speed = GetSpeed(reinterpret_cast(this)); return speed != FLT_MAX ? Max(speed * 4, default_speed) : default_speed; } DETOUR_DECL_MEMBER(float, NextBotGroundLocomotion_GetMaxDeceleration) { - float default_speed = DETOUR_MEMBER_CALL(NextBotGroundLocomotion_GetMaxDeceleration)(); + float default_speed = DETOUR_MEMBER_CALL(); float speed = GetSpeed(reinterpret_cast(this)); return speed != FLT_MAX ? Max(speed * 4, default_speed) : default_speed; } @@ -1127,7 +1127,7 @@ namespace Mod::Pop::WaveSpawn_Extensions DETOUR_DECL_MEMBER(int, CZombie_OnTakeDamage_Alive, const CTakeDamageInfo& info) { - int dmg = DETOUR_MEMBER_CALL(CZombie_OnTakeDamage_Alive)(info); + int dmg = DETOUR_MEMBER_CALL(info); auto zombie = reinterpret_cast(this); if (dmg > 0) { IGameEvent *event = gameeventmanager->CreateEvent("npc_hurt"); @@ -1176,7 +1176,7 @@ namespace Mod::Pop::WaveSpawn_Extensions } } - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(bool, CRandomChoiceSpawner_Parse, KeyValues *kv_orig) @@ -1219,7 +1219,7 @@ namespace Mod::Pop::WaveSpawn_Extensions subkey->deleteThis(); } - auto result = DETOUR_MEMBER_CALL(CRandomChoiceSpawner_Parse)(kv); + auto result = DETOUR_MEMBER_CALL(kv); if (result && shuffle) { if (currentWaveSpawn != nullptr) { spawnerToShuffle = random; @@ -1330,7 +1330,7 @@ namespace Mod::Pop::WaveSpawn_Extensions DeleteNPC(inst, spawner); it = bot_npc_spawners.erase(it); } - DETOUR_MEMBER_CALL(CMannVsMachineStats_RoundEvent_WaveEnd)(success); + DETOUR_MEMBER_CALL(success); } struct NextBotData @@ -1349,7 +1349,7 @@ namespace Mod::Pop::WaveSpawn_Extensions if (data != nullptr && data->fast_update) { reinterpret_cast(actor->MyNextBotPointer())->m_bScheduledForNextTick = true; } - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); }*/ /*DETOUR_DECL_MEMBER(bool, NextBotManager_ShouldUpdate, INextBot *bot) @@ -1362,38 +1362,38 @@ namespace Mod::Pop::WaveSpawn_Extensions } } - return DETOUR_MEMBER_CALL(NextBotManager_ShouldUpdate)(bot); + return DETOUR_MEMBER_CALL(bot); }*/ DETOUR_DECL_MEMBER(string_t, CRandomChoiceSpawner_GetClassIcon, int index) { auto spawner = reinterpret_cast(this); if (spawner->m_SubSpawners.IsEmpty()) return NULL_STRING; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_GetClassIcon)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, CRandomChoiceSpawner_IsMiniBoss, int index) { auto spawner = reinterpret_cast(this); if (spawner->m_SubSpawners.IsEmpty()) return false; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_IsMiniBoss)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(bool, CRandomChoiceSpawner_HasAttribute, CTFBot::AttributeType attr, int index) { auto spawner = reinterpret_cast(this); if (spawner->m_SubSpawners.IsEmpty()) return false; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_HasAttribute)(attr, index); + return DETOUR_MEMBER_CALL(attr, index); } DETOUR_DECL_MEMBER(int, CRandomChoiceSpawner_GetClass, int index) { auto spawner = reinterpret_cast(this); if (spawner->m_SubSpawners.IsEmpty()) return false; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_GetClass)(index); + return DETOUR_MEMBER_CALL(index); } DETOUR_DECL_MEMBER(int, CRandomChoiceSpawner_GetHealth, int index) { auto spawner = reinterpret_cast(this); if (spawner->m_SubSpawners.IsEmpty()) return false; - return DETOUR_MEMBER_CALL(CRandomChoiceSpawner_GetHealth)(index); + return DETOUR_MEMBER_CALL(index); } class CMod : public IMod, public IModCallbackListener, IFrameUpdatePostEntityThinkListener diff --git a/src/mod/prof/attr_munge.cpp b/src/mod/prof/attr_munge.cpp index 9a4de37e..267929ab 100644 --- a/src/mod/prof/attr_munge.cpp +++ b/src/mod/prof/attr_munge.cpp @@ -91,78 +91,78 @@ namespace Mod::Prof::Attr_Munge DETOUR_DECL_STATIC(int, CAttributeManager_AttribHookValue_int, int value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) { VPROF_BUDGET("CAttributeManager::AttribHookValue", "Attributes"); - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_int)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } DETOUR_DECL_STATIC(float, CAttributeManager_AttribHookValue_float, float value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) { VPROF_BUDGET("CAttributeManager::AttribHookValue", "Attributes"); - return DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_float)(value, attr, ent, vec, b1); + return DETOUR_STATIC_CALL(value, attr, ent, vec, b1); } DETOUR_DECL_STATIC(void, GlobalAttrModifier_TFHalloweenAttribHookMunger, const char *in, CUtlConstStringBase *out) { VPROF_BUDGET("GlobalAttrModifier_TFHalloweenAttribHookMunger", "Mungers"); - DETOUR_STATIC_CALL(GlobalAttrModifier_TFHalloweenAttribHookMunger)(in, out); + DETOUR_STATIC_CALL(in, out); } DETOUR_DECL_STATIC(void, GlobalAttrModifier_MvMAttribHookMunger, const char *in, CUtlConstStringBase *out) { VPROF_BUDGET("GlobalAttrModifier_MvMAttribHookMunger", "Mungers"); - DETOUR_STATIC_CALL(GlobalAttrModifier_MvMAttribHookMunger)(in, out); + DETOUR_STATIC_CALL(in, out); } DETOUR_DECL_STATIC(int, V_vsnprintfRet, char *pDest, int maxLenInCharacters, const char *pFormat, va_list params, bool *pbTruncated) { VPROF_BUDGET("V_vsnprintfRet", "Strings"); - return DETOUR_STATIC_CALL(V_vsnprintfRet)(pDest, maxLenInCharacters, pFormat, params, pbTruncated); + return DETOUR_STATIC_CALL(pDest, maxLenInCharacters, pFormat, params, pbTruncated); } DETOUR_DECL_MEMBER(void, CUtlConstStringBase_char_Set, const char *pValue) { VPROF_BUDGET("CUtlConstStringBase::Set", "Strings"); - DETOUR_MEMBER_CALL(CUtlConstStringBase_char_Set)(pValue); + DETOUR_MEMBER_CALL(pValue); } DETOUR_DECL_MEMBER(void *, IMemAlloc_Alloc, size_t nSize) { VPROF_BUDGET("IMemAlloc::Alloc", "Memory"); - return DETOUR_MEMBER_CALL(IMemAlloc_Alloc)(nSize); + return DETOUR_MEMBER_CALL(nSize); } DETOUR_DECL_MEMBER(void *, IMemAlloc_Realloc, void *pMem, size_t nSize) { VPROF_BUDGET("IMemAlloc::Realloc", "Memory"); - return DETOUR_MEMBER_CALL(IMemAlloc_Realloc)(pMem, nSize); + return DETOUR_MEMBER_CALL(pMem, nSize); } DETOUR_DECL_MEMBER(void, IMemAlloc_Free, void *pMem) { VPROF_BUDGET("IMemAlloc::Free", "Memory"); - DETOUR_MEMBER_CALL(IMemAlloc_Free)(pMem); + DETOUR_MEMBER_CALL(pMem); } DETOUR_DECL_STATIC(char *, d_strdup, const char *s) { VPROF_BUDGET("strdup", "glibc"); - return DETOUR_STATIC_CALL(d_strdup)(s); + return DETOUR_STATIC_CALL(s); } DETOUR_DECL_STATIC(void *, d_malloc, size_t size) { VPROF_BUDGET("malloc", "glibc"); - return DETOUR_STATIC_CALL(d_malloc)(size); + return DETOUR_STATIC_CALL(size); } DETOUR_DECL_STATIC(void, d_free, void *ptr) { VPROF_BUDGET("free", "glibc"); - DETOUR_STATIC_CALL(d_free)(ptr); + DETOUR_STATIC_CALL(ptr); } diff --git a/src/mod/prof/debug_overlay.cpp b/src/mod/prof/debug_overlay.cpp index 8e26217e..9ddf6a3f 100644 --- a/src/mod/prof/debug_overlay.cpp +++ b/src/mod/prof/debug_overlay.cpp @@ -9,84 +9,84 @@ namespace Mod::Prof::Debug_Overlay DETOUR_DECL_MEMBER(void, CDebugOverlay_Paint) { VPROF_BUDGET("CDebugOverlay::Paint", "DebugOverlayRender"); - DETOUR_MEMBER_CALL(CDebugOverlay_Paint)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(void, CDebugOverlay_DrawAllOverlays) { VPROF_BUDGET("CDebugOverlay::DrawAllOverlays", "DebugOverlayRender"); - DETOUR_STATIC_CALL(CDebugOverlay_DrawAllOverlays)(); + DETOUR_STATIC_CALL(); } DETOUR_DECL_STATIC(void, CDebugOverlay_DrawOverlay, OverlayBase_t *pOverlay) { VPROF_BUDGET("CDebugOverlay::DrawOverlay", "DebugOverlayRender"); - DETOUR_STATIC_CALL(CDebugOverlay_DrawOverlay)(pOverlay); + DETOUR_STATIC_CALL(pOverlay); } DETOUR_DECL_STATIC(void, RenderWireframeSphere, const Vector& vCenter, float flRadius, int nTheta, int nPhi, Color c, bool bZBuffer) { VPROF_BUDGET("RenderWireframeSphere", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderWireframeSphere)(vCenter, flRadius, nTheta, nPhi, c, bZBuffer); + DETOUR_STATIC_CALL(vCenter, flRadius, nTheta, nPhi, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderSphere, const Vector& vCenter, float flRadius, int nTheta, int nPhi, Color c, IMaterial *pMaterial) { VPROF_BUDGET("RenderSphere", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderSphere)(vCenter, flRadius, nTheta, nPhi, c, pMaterial); + DETOUR_STATIC_CALL(vCenter, flRadius, nTheta, nPhi, c, pMaterial); } DETOUR_DECL_STATIC(void, RenderWireframeBox, const Vector& vOrigin, const QAngle& angles, const Vector& vMins, const Vector& vMaxs, Color c, bool bZBuffer) { VPROF_BUDGET("RenderWireframeBox", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderWireframeBox)(vOrigin, angles, vMins, vMaxs, c, bZBuffer); + DETOUR_STATIC_CALL(vOrigin, angles, vMins, vMaxs, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderWireframeSweptBox, const Vector& vStart, const Vector& vEnd, const QAngle& angles, const Vector& vMins, const Vector& vMaxs, Color c, bool bZBuffer) { VPROF_BUDGET("RenderWireframeSweptBox", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderWireframeSweptBox)(vStart, vEnd, angles, vMins, vMaxs, c, bZBuffer); + DETOUR_STATIC_CALL(vStart, vEnd, angles, vMins, vMaxs, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderBox, const Vector& origin, const QAngle& angles, const Vector& mins, const Vector& maxs, Color c, IMaterial *pMaterial, bool bInsideOut) { VPROF_BUDGET("RenderBox", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderBox)(origin, angles, mins, maxs, c, pMaterial, bInsideOut); + DETOUR_STATIC_CALL(origin, angles, mins, maxs, c, pMaterial, bInsideOut); } DETOUR_DECL_STATIC(void, RenderAxes_vec, const Vector& vOrigin, float flScale, bool bZBuffer) { VPROF_BUDGET("RenderAxes", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderAxes_vec)(vOrigin, flScale, bZBuffer); + DETOUR_STATIC_CALL(vOrigin, flScale, bZBuffer); } DETOUR_DECL_STATIC(void, RenderAxes_mat, const matrix3x4_t& transform, float flScale, bool bZBuffer) { VPROF_BUDGET("RenderAxes", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderAxes_mat)(transform, flScale, bZBuffer); + DETOUR_STATIC_CALL(transform, flScale, bZBuffer); } DETOUR_DECL_STATIC(void, RenderLine, const Vector& v1, const Vector& v2, Color c, bool bZBuffer) { VPROF_BUDGET("RenderLine", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderLine)(v1, v2, c, bZBuffer); + DETOUR_STATIC_CALL(v1, v2, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderTriangle, const Vector& p1, const Vector& p2, const Vector& p3, Color c, IMaterial *pMaterial) { VPROF_BUDGET("RenderTriangle", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderTriangle)(p1, p2, p3, c, pMaterial); + DETOUR_STATIC_CALL(p1, p2, p3, c, pMaterial); } DETOUR_DECL_STATIC(void, RenderQuad, IMaterial *pMaterial, float x, float y, float w, float h, float z, float s0, float t0, float s1, float t1, const Color& clr) { VPROF_BUDGET("RenderQuad", "DebugOverlayRender"); - DETOUR_STATIC_CALL(RenderQuad)(pMaterial, x, y, w, h, z, s0, t0, s1, t1, clr); + DETOUR_STATIC_CALL(pMaterial, x, y, w, h, z, s0, t0, s1, t1, clr); } DETOUR_DECL_STATIC(void, DrawScreenSpaceRectangle, IMaterial *pMaterial, int nDestX, int nDestY, int nWidth, int nHeight, float flSrcTextureX0, float flSrcTextureY0, float flSrcTextureX1, float flSrcTextureY1, int nSrcTextureWidth, int nSrcTextureHeight, void *pClientRenderable, int nXDice, int nYDice, float fDepth) { VPROF_BUDGET("DrawScreenSpaceRectangle", "DebugOverlayRender"); - DETOUR_STATIC_CALL(DrawScreenSpaceRectangle)(pMaterial, nDestX, nDestY, nWidth, nHeight, flSrcTextureX0, flSrcTextureY0, flSrcTextureX1, flSrcTextureY1, nSrcTextureWidth, nSrcTextureHeight, pClientRenderable, nXDice, nYDice, fDepth); + DETOUR_STATIC_CALL(pMaterial, nDestX, nDestY, nWidth, nHeight, flSrcTextureX0, flSrcTextureY0, flSrcTextureX1, flSrcTextureY1, nSrcTextureWidth, nSrcTextureHeight, pClientRenderable, nXDice, nYDice, fDepth); } DETOUR_DECL_MEMBER(int, CMatSystemSurface_DrawColoredText, vgui::HFont font, int x, int y, int r, int g, int b, int a, const char *fmt, va_list argptr) { VPROF_BUDGET("CMatSystemSurface::DrawColoredText", "DebugOverlayRender"); - return DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(font, x, y, r, g, b, a, fmt, argptr); + return DETOUR_MEMBER_CALL(font, x, y, r, g, b, a, fmt, argptr); } @@ -94,13 +94,13 @@ namespace Mod::Prof::Debug_Overlay DETOUR_DECL_STATIC(int, D_vsnprintf, char *buffer, size_t count, const char *format, va_list argptr) { VPROF_BUDGET("_vsnprintf", "DebugOverlayRender"); - return DETOUR_STATIC_CALL(D_vsnprintf)(buffer, count, format, argptr); + return DETOUR_STATIC_CALL(buffer, count, format, argptr); } DETOUR_DECL_STATIC(int, D_MultiByteToWideChar, UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar) { VPROF_BUDGET("MultiByteToWideChar", "DebugOverlayRender"); - return DETOUR_STATIC_CALL(D_MultiByteToWideChar)(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar); + return DETOUR_STATIC_CALL(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar); } #endif diff --git a/src/mod/prof/flame_breakable_collision.cpp b/src/mod/prof/flame_breakable_collision.cpp index e6b47e9a..3a281c0b 100644 --- a/src/mod/prof/flame_breakable_collision.cpp +++ b/src/mod/prof/flame_breakable_collision.cpp @@ -6,13 +6,13 @@ namespace Mod::Prof::Flame_Breakable_Collision DETOUR_DECL_MEMBER(void, CTFFlameEntity_FlameThink) { VPROF_BUDGET("CTFFlameEntity::FlameThink", "sigsegv"); - DETOUR_MEMBER_CALL(CTFFlameEntity_FlameThink)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(CBaseEntity *, CGlobalEntityList_FindEntityByClassname, CBaseEntity *pStartEntity, const char *szName, IEntityFindFilter *filter) { VPROF_BUDGET("CGlobalEntityList::FindEntityByClassname", "sigsegv"); - return DETOUR_MEMBER_CALL(CGlobalEntityList_FindEntityByClassname)(pStartEntity, szName, filter); + return DETOUR_MEMBER_CALL(pStartEntity, szName, filter); } diff --git a/src/mod/prof/frame_prof.cpp b/src/mod/prof/frame_prof.cpp index 458592a8..0145820b 100644 --- a/src/mod/prof/frame_prof.cpp +++ b/src/mod/prof/frame_prof.cpp @@ -22,7 +22,7 @@ namespace Mod::Prof::Frame_Prof DETOUR_DECL_STATIC(void, _Host_RunFrame, float dt) { CTimeAdder timer(×pent); - DETOUR_STATIC_CALL(_Host_RunFrame)(dt); + DETOUR_STATIC_CALL(dt); timer.End(); if (floor(gpGlobals->curtime/5) != floor(prevTime) ) { Msg("Frame time: %f\n", timespent.GetSeconds()/5); @@ -38,7 +38,7 @@ namespace Mod::Prof::Frame_Prof DETOUR_DECL_STATIC(void, Host_CheckDumpMemoryStats) { - DETOUR_STATIC_CALL(Host_CheckDumpMemoryStats)(); + DETOUR_STATIC_CALL(); timespent2End.Sample(); timespent2.m_Int64 += timespent2End.m_Int64 - timespent2Start.m_Int64; static struct rusage s_lastUsage; @@ -64,7 +64,7 @@ namespace Mod::Prof::Frame_Prof DETOUR_DECL_MEMBER(void, CMapReslistGenerator_RunFrame) { timespent2Start.Sample(); - DETOUR_MEMBER_CALL(CMapReslistGenerator_RunFrame)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CNetChan_SendDatagram, bf_write *bf) @@ -73,14 +73,14 @@ namespace Mod::Prof::Frame_Prof bytesPrev = MAX(bytesPrev ,chan->GetNumBitsWritten(false) + (bf != nullptr ? bf->GetNumBitsWritten() : 0)); bytesPrevReliable = MAX(bytesPrevReliable, chan->GetNumBitsWritten(true)); prevOverflow |= chan->IsOverflowed(); - auto result = DETOUR_MEMBER_CALL(CNetChan_SendDatagram)(bf); + auto result = DETOUR_MEMBER_CALL(bf); return result; } DETOUR_DECL_MEMBER(bool, CGameClient_ShouldSendMessages) { auto client = reinterpret_cast(this); - auto result = DETOUR_MEMBER_CALL(CGameClient_ShouldSendMessages)(); + auto result = DETOUR_MEMBER_CALL(); if (!result && client->m_bFakePlayer && !client->m_bIsHLTV && !client->m_bIsReplay) { static ConVarRef sv_stressbots("sv_stressbots"); return sv_stressbots.GetBool(); @@ -90,7 +90,7 @@ namespace Mod::Prof::Frame_Prof DETOUR_DECL_MEMBER(void, CGameServer_SendClientMessages, bool sendSnapshots) { - DETOUR_MEMBER_CALL(CGameServer_SendClientMessages)(sendSnapshots); + DETOUR_MEMBER_CALL(sendSnapshots); static ConVarRef sv_stressbots("sv_stressbots"); if (sv_stressbots.GetBool()) { for (int i = 0; i < sv->GetClientCount(); i++) { diff --git a/src/mod/prof/mvm_shield_events.cpp b/src/mod/prof/mvm_shield_events.cpp index ecdc8642..e7094372 100644 --- a/src/mod/prof/mvm_shield_events.cpp +++ b/src/mod/prof/mvm_shield_events.cpp @@ -33,7 +33,7 @@ namespace Prof_MvM_Shield_Events } VPROF_CUSTOM(name); - auto result = DETOUR_MEMBER_CALL(IGameEventManager2_FireEventClientSide)(event); + auto result = DETOUR_MEMBER_CALL(event); if (cvar_trace.GetBool()) { DevMsg("EXIT IGameEventManager2::FireEventClientSide\n"); @@ -54,7 +54,7 @@ namespace Prof_MvM_Shield_Events } VPROF_CUSTOM(name); - DETOUR_MEMBER_CALL(CDamageAccountPanel_FireGameEvent)(event); + DETOUR_MEMBER_CALL(event); if (cvar_trace.GetBool()) { DevMsg("EXIT CDamageAccountPanel::FireGameEvent\n"); @@ -69,7 +69,7 @@ namespace Prof_MvM_Shield_Events } VPROF_CUSTOM("CDamageAccountPanel::DisplayDamageFeedback"); - DETOUR_MEMBER_CALL(CDamageAccountPanel_DisplayDamageFeedback)(pPlayer, pVictim, iDamageAmount, iHealth, bCrit); + DETOUR_MEMBER_CALL(pPlayer, pVictim, iDamageAmount, iHealth, bCrit); if (cvar_trace.GetBool()) { DevMsg("EXIT CDamageAccountPanel::DisplayDamageFeedback\n"); @@ -84,7 +84,7 @@ namespace Prof_MvM_Shield_Events const char *name = CFmtStr("vgui::AnimationController::StartAnimationSequence(\"%s\")", sequenceName); VPROF_CUSTOM(name); - return DETOUR_MEMBER_CALL(vgui_AnimationController_StartAnimationSequence)(pWithinParent, sequenceName); + return DETOUR_MEMBER_CALL(pWithinParent, sequenceName); } #endif @@ -97,7 +97,7 @@ namespace Prof_MvM_Shield_Events } VPROF_CUSTOM(name); - auto result = DETOUR_MEMBER_CALL(vgui_AnimationController_StartAnimationSequence)(sequenceName); + auto result = DETOUR_MEMBER_CALL(sequenceName); if (cvar_trace.GetBool()) { DevMsg("EXIT vgui::AnimationController::StartAnimationSequence(\"%s\")\n", sequenceName); diff --git a/src/mod/prof/popfile_load.cpp b/src/mod/prof/popfile_load.cpp index a1b3d193..4be4d3f5 100644 --- a/src/mod/prof/popfile_load.cpp +++ b/src/mod/prof/popfile_load.cpp @@ -21,7 +21,7 @@ namespace Mod::Prof::Popfile_Load float t1 = Plat_FloatTime(); { VPROF_CUSTOM("tf_mvm_popfile"); - DETOUR_STATIC_CALL(tf_mvm_popfile)(args); + DETOUR_STATIC_CALL(args); } float t2 = Plat_FloatTime(); float dt = (t2 - t1); @@ -40,7 +40,7 @@ namespace Mod::Prof::Popfile_Load DevMsg("\n> CSmokeStack #%d: CBaseEntity::ParseMapData\n", ENTINDEX(ent)); } - DETOUR_MEMBER_CALL(CBaseEntity_ParseMapData)(mapData); + DETOUR_MEMBER_CALL(mapData); } RefCount rc_CSmokeStack_KeyValue; @@ -52,12 +52,12 @@ namespace Mod::Prof::Popfile_Load DevMsg(" > KeyValue \"%s\" \"%s\"\n", szKeyName, szValue); - return DETOUR_MEMBER_CALL(CSmokeStack_KeyValue)(szKeyName, szValue); + return DETOUR_MEMBER_CALL(szKeyName, szValue); } DETOUR_DECL_MEMBER(bool, CBaseFileSystem_FileExists, const char *pFileName, const char *pPathID) { - auto result = DETOUR_MEMBER_CALL(CBaseFileSystem_FileExists)(pFileName, pPathID); + auto result = DETOUR_MEMBER_CALL(pFileName, pPathID); if (rc_CSmokeStack_KeyValue > 0) { DevMsg(" > FileExists \"%s\" \"%s\" --> %s\n", pFileName, pPathID, (result ? "TRUE" : "FALSE")); diff --git a/src/mod/prof/tier2_renderutils.cpp b/src/mod/prof/tier2_renderutils.cpp index 0c536aa2..6247a8e9 100644 --- a/src/mod/prof/tier2_renderutils.cpp +++ b/src/mod/prof/tier2_renderutils.cpp @@ -5,73 +5,73 @@ namespace Mod::Prof::Tier2_RenderUtils { DETOUR_DECL_STATIC(void, GenerateBoxVertices, const Vector& vOrigin, const QAngle& angles, const Vector& vMins, const Vector& vMaxs, Vector pVerts[8]) { - DETOUR_STATIC_CALL(GenerateBoxVertices)(vOrigin, angles, vMins, vMaxs, pVerts); + DETOUR_STATIC_CALL(vOrigin, angles, vMins, vMaxs, pVerts); } DETOUR_DECL_STATIC(void, RenderWireframeSphere, const Vector& vCenter, float flRadius, int nTheta, int nPhi, Color c, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderWireframeSphere)(vCenter, flRadius, nTheta, nPhi, c, bZBuffer); + DETOUR_STATIC_CALL(vCenter, flRadius, nTheta, nPhi, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderSphere1, const Vector& vCenter, float flRadius, int nTheta, int nPhi, Color c, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderSphere1)(vCenter, flRadius, nTheta, nPhi, c, bZBuffer); + DETOUR_STATIC_CALL(vCenter, flRadius, nTheta, nPhi, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderSphere2, const Vector& vCenter, float flRadius, int nTheta, int nPhi, Color c, IMaterial *pMaterial) { - DETOUR_STATIC_CALL(RenderSphere2)(vCenter, flRadius, nTheta, nPhi, c, pMaterial); + DETOUR_STATIC_CALL(vCenter, flRadius, nTheta, nPhi, c, pMaterial); } DETOUR_DECL_STATIC(void, RenderWireframeBox, const Vector& vOrigin, const QAngle& angles, const Vector& vMins, const Vector& vMaxs, Color c, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderWireframeBox)(vOrigin, angles, vMins, vMaxs, c, bZBuffer); + DETOUR_STATIC_CALL(vOrigin, angles, vMins, vMaxs, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderWireframeSweptBox, const Vector& vStart, const Vector& vEnd, const QAngle& angles, const Vector& vMins, const Vector& vMaxs, Color c, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderWireframeSweptBox)(vStart, vEnd, angles, vMins, vMaxs, c, bZBuffer); + DETOUR_STATIC_CALL(vStart, vEnd, angles, vMins, vMaxs, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderBox1, const Vector& origin, const QAngle& angles, const Vector& mins, const Vector& maxs, Color c, bool bZBuffer, bool bInsideOut) { - DETOUR_STATIC_CALL(RenderBox1)(origin, angles, mins, maxs, c, bZBuffer, bInsideOut); + DETOUR_STATIC_CALL(origin, angles, mins, maxs, c, bZBuffer, bInsideOut); } DETOUR_DECL_STATIC(void, RenderBox2, const Vector& origin, const QAngle& angles, const Vector& mins, const Vector& maxs, Color c, IMaterial *pMaterial, bool bInsideOut) { - DETOUR_STATIC_CALL(RenderBox2)(origin, angles, mins, maxs, c, pMaterial, bInsideOut); + DETOUR_STATIC_CALL(origin, angles, mins, maxs, c, pMaterial, bInsideOut); } DETOUR_DECL_STATIC(void, RenderAxes1, const Vector& vOrigin, float flScale, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderAxes1)(vOrigin, flScale, bZBuffer); + DETOUR_STATIC_CALL(vOrigin, flScale, bZBuffer); } DETOUR_DECL_STATIC(void, RenderAxes2, const matrix3x4_t& transform, float flScale, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderAxes2)(transform, flScale, bZBuffer); + DETOUR_STATIC_CALL(transform, flScale, bZBuffer); } DETOUR_DECL_STATIC(void, RenderLine, const Vector& v1, const Vector& v2, Color c, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderLine)(v1, v2, c, bZBuffer); + DETOUR_STATIC_CALL(v1, v2, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderTriangle1, const Vector& p1, const Vector& p2, const Vector& p3, Color c, bool bZBuffer) { - DETOUR_STATIC_CALL(RenderTriangle1)(p1, p2, p3, c, bZBuffer); + DETOUR_STATIC_CALL(p1, p2, p3, c, bZBuffer); } DETOUR_DECL_STATIC(void, RenderTriangle2, const Vector& p1, const Vector& p2, const Vector& p3, Color c, IMaterial *pMaterial) { - DETOUR_STATIC_CALL(RenderTriangle2)(p1, p2, p3, c, pMaterial); + DETOUR_STATIC_CALL(p1, p2, p3, c, pMaterial); } DETOUR_DECL_STATIC(void, RenderQuad, IMaterial *pMaterial, float x, float y, float w, float h, float z, float s0, float t0, float s1, float t1, const Color& clr) { - DETOUR_STATIC_CALL(RenderQuad)(pMaterial, x, y, w, h, z, s0, t0, s1, t1, clr); + DETOUR_STATIC_CALL(pMaterial, x, y, w, h, z, s0, t0, s1, t1, clr); } DETOUR_DECL_STATIC(void, DrawScreenSpaceRectangle, IMaterial *pMaterial, int nDestX, int nDestY, int nWidth, int nHeight, float flSrcTextureX0, float flSrcTextureY0, float flSrcTextureX1, float flSrcTextureY1, int nSrcTextureWidth, int nSrcTextureHeight, void *pClientRenderable, int nXDice, int nYDice, float fDepth) { - DETOUR_STATIC_CALL(DrawScreenSpaceRectangle)(pMaterial, nDestX, nDestY, nWidth, nHeight, flSrcTextureX0, flSrcTextureY0, flSrcTextureX1, flSrcTextureY1, nSrcTextureWidth, nSrcTextureHeight, pClientRenderable, nXDice, nYDice, fDepth); + DETOUR_STATIC_CALL(pMaterial, nDestX, nDestY, nWidth, nHeight, flSrcTextureX0, flSrcTextureY0, flSrcTextureX1, flSrcTextureY1, nSrcTextureWidth, nSrcTextureHeight, pClientRenderable, nXDice, nYDice, fDepth); } diff --git a/src/mod/robot/building_stomp.cpp b/src/mod/robot/building_stomp.cpp index 9b93646e..ac015ff3 100644 --- a/src/mod/robot/building_stomp.cpp +++ b/src/mod/robot/building_stomp.cpp @@ -15,14 +15,14 @@ namespace Mod::Robot::Building_Stomp { SCOPED_INCREMENT(rc_CTFBotMainAction_OnContact); bot_contact = actor; - return DETOUR_MEMBER_CALL(CTFBotMainAction_OnContact)(actor, ent, trace); + return DETOUR_MEMBER_CALL(actor, ent, trace); } DETOUR_DECL_MEMBER(EventDesiredResult, CTFBotMainAction_OnStuck, CTFBot *actor) { SCOPED_INCREMENT(rc_CTFBotMainAction_OnStuck); bot_stuck = actor; - return DETOUR_MEMBER_CALL(CTFBotMainAction_OnStuck)(actor); + return DETOUR_MEMBER_CALL(actor); } @@ -79,7 +79,7 @@ namespace Mod::Robot::Building_Stomp } } - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } diff --git a/src/mod/robot/no_canteens.cpp b/src/mod/robot/no_canteens.cpp index 108485e9..da32bbf6 100644 --- a/src/mod/robot/no_canteens.cpp +++ b/src/mod/robot/no_canteens.cpp @@ -12,7 +12,7 @@ namespace Mod::Robot::No_Canteens DETOUR_DECL_MEMBER(CEconItemView *, CTFPlayer_GetLoadoutItem, int pclass, int slot, bool b1) { - auto result = DETOUR_MEMBER_CALL(CTFPlayer_GetLoadoutItem)(pclass, slot, b1); + auto result = DETOUR_MEMBER_CALL(pclass, slot, b1); if (TFGameRules()->IsMannVsMachineMode() && result->GetItemDefIndex() == DEFIDX_CANTEEN_DEFAULT) { auto player = reinterpret_cast(this); diff --git a/src/mod/robot/spawn_protection_fix.cpp b/src/mod/robot/spawn_protection_fix.cpp index 5684dd64..f7510ad9 100644 --- a/src/mod/robot/spawn_protection_fix.cpp +++ b/src/mod/robot/spawn_protection_fix.cpp @@ -9,7 +9,7 @@ namespace Mod::Robot::Spawn_Protection_Fix DETOUR_DECL_MEMBER(ActionResult, CTFBotMainAction_Update, CTFBot *actor, float dt) { SCOPED_INCREMENT(rc_CTFBotMainAction_Update); - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } DETOUR_DECL_MEMBER(void, CTFPlayerShared_AddCond, ETFCond nCond, float flDuration, CBaseEntity *pProvider) @@ -28,7 +28,7 @@ namespace Mod::Robot::Spawn_Protection_Fix // DevMsg("[SpawnProtect] rc == %d; nCond == %d; flDuration %c= 0.5f; pProvider %c= nullptr\n", // rc_CTFBotMainAction_Update, (int)nCond, (flDuration == 0.5f ? '=' : '!'), (pProvider == nullptr ? '=' : '!')); - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(nCond, flDuration, pProvider); + DETOUR_MEMBER_CALL(nCond, flDuration, pProvider); } diff --git a/src/mod/robot/spawn_setname.cpp b/src/mod/robot/spawn_setname.cpp index 24bdea59..b4eb8e8f 100644 --- a/src/mod/robot/spawn_setname.cpp +++ b/src/mod/robot/spawn_setname.cpp @@ -8,7 +8,7 @@ namespace Mod::Robot::Spawn_SetName RefCount rc_CTFBotSpawner_Spawn; DETOUR_DECL_MEMBER(int, CTFBotSpawner_Spawn, const Vector& where, CUtlVector> *ents) { - return DETOUR_MEMBER_CALL(CTFBotSpawner_Spawn)(where, ents); + return DETOUR_MEMBER_CALL(where, ents); } DETOUR_DECL_MEMBER(void, IVEngineServer_SetFakeClientConVarValue, edict_t *pEntity, const char *cvar, const char *value) @@ -21,7 +21,7 @@ namespace Mod::Robot::Spawn_SetName } } - DETOUR_MEMBER_CALL(IVEngineServer_SetFakeClientConVarValue)(pEntity, cvar, value); + DETOUR_MEMBER_CALL(pEntity, cvar, value); } diff --git a/src/mod/robot/standable_heads.cpp b/src/mod/robot/standable_heads.cpp index c42a2521..7c017e74 100644 --- a/src/mod/robot/standable_heads.cpp +++ b/src/mod/robot/standable_heads.cpp @@ -10,7 +10,7 @@ namespace Mod::Robot::Standable_Heads DETOUR_DECL_MEMBER(void, CTFPlayer_TFPlayerThink) { SCOPED_INCREMENT(rc_TFPlayerThink); - DETOUR_MEMBER_CALL(CTFPlayer_TFPlayerThink)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, CTFPlayer_ApplyAbsVelocityImpulse, const Vector *v1) @@ -24,7 +24,7 @@ namespace Mod::Robot::Standable_Heads } } - DETOUR_MEMBER_CALL(CTFPlayer_ApplyAbsVelocityImpulse)(v1); + DETOUR_MEMBER_CALL(v1); } diff --git a/src/mod/robot/underground_check_override.cpp b/src/mod/robot/underground_check_override.cpp index e5835fb2..28d9e3b7 100644 --- a/src/mod/robot/underground_check_override.cpp +++ b/src/mod/robot/underground_check_override.cpp @@ -77,7 +77,7 @@ namespace Mod::Robot::Underground_Check_Override auto m_itUnderground = reinterpret_cast((uintptr_t)this + off_CTFBotMainAction_m_itUnderground); m_itUnderground->Invalidate(); - return DETOUR_MEMBER_CALL(CTFBotMainAction_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } diff --git a/src/mod/sound/responses_suppress_giant_sentrybuster.cpp b/src/mod/sound/responses_suppress_giant_sentrybuster.cpp index c9f487fd..a6bcc97d 100644 --- a/src/mod/sound/responses_suppress_giant_sentrybuster.cpp +++ b/src/mod/sound/responses_suppress_giant_sentrybuster.cpp @@ -8,7 +8,7 @@ namespace Mod::Sound::Suppress_Giant_SentryBuster DETOUR_DECL_MEMBER(bool, CMissionPopulator_UpdateMissionDestroySentries) { SCOPED_INCREMENT(rc_CMissionPopulator_UpdateMissionDestroySentries); - return DETOUR_MEMBER_CALL(CMissionPopulator_UpdateMissionDestroySentries)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFPlayer_SpeakConceptIfAllowed, int iConcept, const char *modifiers, char *pszOutResponseChosen, size_t bufsize, IRecipientFilter *filter) @@ -17,7 +17,7 @@ namespace Mod::Sound::Suppress_Giant_SentryBuster return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_SpeakConceptIfAllowed)(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); + return DETOUR_MEMBER_CALL(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); } diff --git a/src/mod/sound/responses_suppress_medicbot_shield.cpp b/src/mod/sound/responses_suppress_medicbot_shield.cpp index e71bcd7b..72f5be9a 100644 --- a/src/mod/sound/responses_suppress_medicbot_shield.cpp +++ b/src/mod/sound/responses_suppress_medicbot_shield.cpp @@ -12,7 +12,7 @@ namespace Mod::Sound::Suppress_MedicBot_Shield return false; } - return DETOUR_MEMBER_CALL(CTFPlayer_SpeakConceptIfAllowed)(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); + return DETOUR_MEMBER_CALL(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); } diff --git a/src/mod/sound/responses_unused_credits.cpp b/src/mod/sound/responses_unused_credits.cpp index ea7423b6..4001f89d 100644 --- a/src/mod/sound/responses_unused_credits.cpp +++ b/src/mod/sound/responses_unused_credits.cpp @@ -9,7 +9,7 @@ namespace Mod::Sound::Unused_Credits DETOUR_DECL_MEMBER(bool, CCurrencyPack_MyTouch, CBasePlayer *pPlayer) { SCOPED_INCREMENT(rc_CCurrencyPack_MyTouch); - return DETOUR_MEMBER_CALL(CCurrencyPack_MyTouch)(pPlayer); + return DETOUR_MEMBER_CALL(pPlayer); } DETOUR_DECL_MEMBER(bool, CTFPlayer_SpeakConceptIfAllowed, int iConcept, const char *modifiers, char *pszOutResponseChosen, size_t bufsize, IRecipientFilter *filter) @@ -38,7 +38,7 @@ namespace Mod::Sound::Unused_Credits } } - return DETOUR_MEMBER_CALL(CTFPlayer_SpeakConceptIfAllowed)(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); + return DETOUR_MEMBER_CALL(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); } diff --git a/src/mod/sound/responses_unused_sapper.cpp b/src/mod/sound/responses_unused_sapper.cpp index 6a742c44..d97c5739 100644 --- a/src/mod/sound/responses_unused_sapper.cpp +++ b/src/mod/sound/responses_unused_sapper.cpp @@ -11,7 +11,7 @@ namespace Mod::Sound::Unused_Sapper DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, bool, CObjectSapper_ApplyRoboSapperEffects, CTFPlayer *target, float duration) { SCOPED_INCREMENT(rc_CObjectSapper_ApplyRoboSapperEffects); - return DETOUR_MEMBER_CALL(CObjectSapper_ApplyRoboSapperEffects)(target, duration); + return DETOUR_MEMBER_CALL(target, duration); } DETOUR_DECL_MEMBER(bool, CTFPlayer_SpeakConceptIfAllowed, int iConcept, const char *modifiers, char *pszOutResponseChosen, size_t bufsize, IRecipientFilter *filter) @@ -20,7 +20,7 @@ namespace Mod::Sound::Unused_Sapper iConcept = MP_CONCEPT_MVM_SAPPED_ROBOT; } - return DETOUR_MEMBER_CALL(CTFPlayer_SpeakConceptIfAllowed)(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); + return DETOUR_MEMBER_CALL(iConcept, modifiers, pszOutResponseChosen, bufsize, filter); } diff --git a/src/mod/sound/tele_activate.cpp b/src/mod/sound/tele_activate.cpp index f2c4e62d..106aca27 100644 --- a/src/mod/sound/tele_activate.cpp +++ b/src/mod/sound/tele_activate.cpp @@ -9,7 +9,7 @@ namespace Mod::Sound::Tele_Activate auto hint = reinterpret_cast(this); bool active_pre = hint->m_bHasActiveTeleporter; - DETOUR_MEMBER_CALL(CTFBotHintEngineerNest_HintTeleporterThink)(); + DETOUR_MEMBER_CALL(); bool active_post = hint->m_bHasActiveTeleporter; if (!active_pre && active_post) { diff --git a/src/mod/tank/gunslinger_combo.cpp b/src/mod/tank/gunslinger_combo.cpp index f4ca0ba2..27718f47 100644 --- a/src/mod/tank/gunslinger_combo.cpp +++ b/src/mod/tank/gunslinger_combo.cpp @@ -13,13 +13,13 @@ namespace Mod::Tank::Gunslinger_Combo DETOUR_DECL_MEMBER(void, CTFRobotArm_Smack) { rc_CTFRobotArm_Smack = true; - DETOUR_MEMBER_CALL(CTFRobotArm_Smack)(); + DETOUR_MEMBER_CALL(); rc_CTFRobotArm_Smack = false; } DETOUR_DECL_MEMBER(bool, CTFWeaponBaseMelee_DoSwingTrace, trace_t &trace) { - bool result = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTrace)(trace); + bool result = DETOUR_MEMBER_CALL(trace); if (rc_CTFRobotArm_Smack && result && trace.m_pEnt != nullptr && ENTINDEX(trace.m_pEnt) != 0 && reinterpret_cast(trace.m_pEnt)->ClassMatches("tank_boss")) { rc_CTFRobotArm_Smack = false; CBaseEntity *owner = reinterpret_cast(this)->GetOwnerEntity(); diff --git a/src/mod/util/client_cmds.cpp b/src/mod/util/client_cmds.cpp index 2d259b19..2b08757b 100644 --- a/src/mod/util/client_cmds.cpp +++ b/src/mod/util/client_cmds.cpp @@ -1784,7 +1784,7 @@ namespace Mod::Util::Client_Cmds TFGameRules()->Set_m_bPlayingMannVsMachine(false); } - auto result = DETOUR_STATIC_CALL(CTFDroppedWeapon_Create)(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); + auto result = DETOUR_STATIC_CALL(vecOrigin, vecAngles, pOwner, pszModelName, pItemView); if (allow_create_dropped_weapon) { TFGameRules()->Set_m_bPlayingMannVsMachine(is_mvm_mode); @@ -1801,7 +1801,7 @@ namespace Mod::Util::Client_Cmds DETOUR_DECL_STATIC(void, Host_CheckDumpMemoryStats) { - DETOUR_STATIC_CALL(Host_CheckDumpMemoryStats)(); + DETOUR_STATIC_CALL(); timespentEnd.Sample(); timespent.m_Int64 += timespentEnd.m_Int64 - timespentStart.m_Int64; if (floor(gpGlobals->curtime) != floor(prevTime) ) { @@ -1816,7 +1816,7 @@ namespace Mod::Util::Client_Cmds DETOUR_DECL_MEMBER(void, CMapReslistGenerator_RunFrame) { timespentStart.Sample(); - DETOUR_MEMBER_CALL(CMapReslistGenerator_RunFrame)(); + DETOUR_MEMBER_CALL(); } class CMod : public IMod, IFrameUpdatePostEntityThinkListener diff --git a/src/mod/util/confilter.cpp b/src/mod/util/confilter.cpp index 436c3536..7096b0b2 100644 --- a/src/mod/util/confilter.cpp +++ b/src/mod/util/confilter.cpp @@ -204,12 +204,12 @@ namespace Mod::Util::ConFilter // return [&](const char *fmt, ...){ // va_list va; // va_start(va, fmt); - // SpewRetval_t ret = DETOUR_STATIC_CALL(D__SpewMessage)(spewType, pGroupName, nLevel, pColor, pMsgFormat, va); + // SpewRetval_t ret = DETOUR_STATIC_CALL(spewType, pGroupName, nLevel, pColor, pMsgFormat, va); // va_end(va); // return ret; // }("%s", s_Line); - return DETOUR_STATIC_CALL(D__SpewMessage)(spewType, pGroupName, nLevel, pColor, pMsgFormat, args); + return DETOUR_STATIC_CALL(spewType, pGroupName, nLevel, pColor, pMsgFormat, args); } diff --git a/src/mod/util/debugoverlay_font.cpp b/src/mod/util/debugoverlay_font.cpp index 431ec828..5ec4e674 100644 --- a/src/mod/util/debugoverlay_font.cpp +++ b/src/mod/util/debugoverlay_font.cpp @@ -43,14 +43,14 @@ namespace Mod::Util::DebugOverlay_Font DETOUR_DECL_MEMBER(void, CDebugOverlay_Paint) { SCOPED_INCREMENT(rc_CDebugOverlay_Paint); - DETOUR_MEMBER_CALL(CDebugOverlay_Paint)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CMatSystemSurface_DrawColoredText, vgui::HFont font, int x, int y, int r, int g, int b, int a, const char *fmt, va_list argptr) { MaybeOverrideFont(&font); - return DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(font, x, y, r, g, b, a, fmt, argptr); + return DETOUR_MEMBER_CALL(font, x, y, r, g, b, a, fmt, argptr); } diff --git a/src/mod/util/debugoverlay_font_v2.cpp b/src/mod/util/debugoverlay_font_v2.cpp index f0a5da67..18b7c28d 100644 --- a/src/mod/util/debugoverlay_font_v2.cpp +++ b/src/mod/util/debugoverlay_font_v2.cpp @@ -148,7 +148,7 @@ namespace Mod::Util::DebugOverlay_Font_v2 SCOPED_INCREMENT_IF(rc_CFontTextureCache_GetTextureForChars_FG, font == hFontFG); SCOPED_INCREMENT_IF(rc_CFontTextureCache_GetTextureForChars_BG, font == hFontBG); - return DETOUR_MEMBER_CALL(CFontTextureCache_GetTextureForChars)(font, type, wch, textureID, texCoords, numChars); + return DETOUR_MEMBER_CALL(font, type, wch, textureID, texCoords, numChars); } // DETOUR_DECL_STATIC(void, ApplyOutlineToTexture, int rgbaWide, int rgbaTall, unsigned char *rgba, int iOutlineSize) @@ -290,7 +290,7 @@ namespace Mod::Util::DebugOverlay_Font_v2 return; } - DETOUR_STATIC_CALL(ApplyGaussianBlurToTexture)(rgbaWide, rgbaTall, rgba, iBlur); + DETOUR_STATIC_CALL(rgbaWide, rgbaTall, rgba, iBlur); #if 0 if (rc_CFontTextureCache_GetTextureForChars_BG > 0) { @@ -326,7 +326,7 @@ namespace Mod::Util::DebugOverlay_Font_v2 DETOUR_DECL_MEMBER(void, CDebugOverlay_Paint) { SCOPED_INCREMENT(rc_CDebugOverlay_Paint); - DETOUR_MEMBER_CALL(CDebugOverlay_Paint)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CMatSystemSurface_DrawColoredText, vgui::HFont font, int x, int y, int r, int g, int b, int a, const char *fmt, va_list argptr) @@ -339,13 +339,13 @@ namespace Mod::Util::DebugOverlay_Font_v2 int bg_b = Clamp((int)std::strtol(cvar_bg_color_b.GetString(), nullptr, 0), 0x00, 0xff); int bg_a = Clamp((int)std::strtol(cvar_bg_color_a.GetString(), nullptr, 0), 0x00, 0xff); - int rBG = DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(hFontBG, x, y, bg_r, bg_g, bg_b, bg_a, fmt, argptr); - int rFG = DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(hFontFG, x, y, r, g, b, a, fmt, argptr); + int rBG = DETOUR_MEMBER_CALL(hFontBG, x, y, bg_r, bg_g, bg_b, bg_a, fmt, argptr); + int rFG = DETOUR_MEMBER_CALL(hFontFG, x, y, r, g, b, a, fmt, argptr); return std::max(rBG, rFG); } - return DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(font, x, y, r, g, b, a, fmt, argptr); + return DETOUR_MEMBER_CALL(font, x, y, r, g, b, a, fmt, argptr); } diff --git a/src/mod/util/debugoverlay_font_v3.cpp b/src/mod/util/debugoverlay_font_v3.cpp index 515f3fd4..349c799c 100644 --- a/src/mod/util/debugoverlay_font_v3.cpp +++ b/src/mod/util/debugoverlay_font_v3.cpp @@ -75,12 +75,12 @@ namespace Mod::Util::DebugOverlay_Font_v3 DETOUR_DECL_MEMBER(bool, ISurface_SetFontGlyphSet, vgui::HFont font, const char *windowsFontName, int tall, int weight, int blur, int scanlines, int flags) { SCOPED_INCREMENT_IF(rc_ISurface_SetFontGlyphSet, font == hFont); - return DETOUR_MEMBER_CALL(ISurface_SetFontGlyphSet)(font, windowsFontName, tall, weight, blur, scanlines, flags); + return DETOUR_MEMBER_CALL(font, windowsFontName, tall, weight, blur, scanlines, flags); } DETOUR_DECL_MEMBER(bool, CWin32Font_Create, const char *windowsFontName, int tall, int weight, int blur, int scanlines, int flags) { - auto result = DETOUR_MEMBER_CALL(CWin32Font_Create)(windowsFontName, tall, weight, blur, scanlines, flags); + auto result = DETOUR_MEMBER_CALL(windowsFontName, tall, weight, blur, scanlines, flags); if (result && rc_ISurface_SetFontGlyphSet > 0) { auto font = reinterpret_cast(this); @@ -138,7 +138,7 @@ namespace Mod::Util::DebugOverlay_Font_v3 DETOUR_DECL_MEMBER(bool, CWin32Font_Create, const char *windowsFontName, int tall, int weight, int blur, int scanlines, int flags) { if (rc_CFontManager_SetFontGlyphSet <= 0) { - return DETOUR_MEMBER_CALL(CWin32Font_Create)(windowsFontName, tall, weight, blur, scanlines, flags); + return DETOUR_MEMBER_CALL(windowsFontName, tall, weight, blur, scanlines, flags); } auto font = reinterpret_cast(this); @@ -232,7 +232,7 @@ namespace Mod::Util::DebugOverlay_Font_v3 { SCOPED_INCREMENT_IF(rc_CFontTextureCache_GetTextureForChars, font == hFont); - return DETOUR_MEMBER_CALL(CFontTextureCache_GetTextureForChars)(font, type, wch, textureID, texCoords, numChars); + return DETOUR_MEMBER_CALL(font, type, wch, textureID, texCoords, numChars); } DETOUR_DECL_STATIC(void, ApplyOutlineToTexture, int rgbaWide, int rgbaTall, unsigned char *rgba, int iOutlineSize) @@ -243,7 +243,7 @@ namespace Mod::Util::DebugOverlay_Font_v3 return; } - DETOUR_STATIC_CALL(ApplyOutlineToTexture)(rgbaWide, rgbaTall, rgba, iOutlineSize); + DETOUR_STATIC_CALL(rgbaWide, rgbaTall, rgba, iOutlineSize); } @@ -251,17 +251,17 @@ namespace Mod::Util::DebugOverlay_Font_v3 DETOUR_DECL_MEMBER(void, CDebugOverlay_Paint) { SCOPED_INCREMENT(rc_CDebugOverlay_Paint); - DETOUR_MEMBER_CALL(CDebugOverlay_Paint)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(int, CMatSystemSurface_DrawColoredText, vgui::HFont font, int x, int y, int r, int g, int b, int a, const char *fmt, va_list argptr) { if (rc_CDebugOverlay_Paint > 0) { UpdateDebugOverlayFont(); - return DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(hFont, x, y, 0x00, 0x00, 0x00, 0xff, fmt, argptr); + return DETOUR_MEMBER_CALL(hFont, x, y, 0x00, 0x00, 0x00, 0xff, fmt, argptr); } - return DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(font, x, y, r, g, b, a, fmt, argptr); + return DETOUR_MEMBER_CALL(font, x, y, r, g, b, a, fmt, argptr); } diff --git a/src/mod/util/download_manager.cpp b/src/mod/util/download_manager.cpp index ed4882bc..e1b16e5c 100644 --- a/src/mod/util/download_manager.cpp +++ b/src/mod/util/download_manager.cpp @@ -935,7 +935,7 @@ namespace Mod::Util::Download_Manager DETOUR_DECL_MEMBER(void, CServerGameDLL_ServerActivate, edict_t *pEdictList, int edictList, int clientMax) { - DETOUR_MEMBER_CALL(CServerGameDLL_ServerActivate)(pEdictList, edictList, clientMax); + DETOUR_MEMBER_CALL(pEdictList, edictList, clientMax); server_activated = true; LoadDownloadsFile(); @@ -958,7 +958,7 @@ namespace Mod::Util::Download_Manager V_strlower(output + base_path_len); struct stat stats; return stat(output, &stats) == 0; - //return DETOUR_STATIC_CALL(findFileInDirCaseInsensitive)(file, output, bufSize); + //return DETOUR_STATIC_CALL(file, output, bufSize); } int inotify_fd = -1; diff --git a/src/mod/util/dtwarning_use_cvar.cpp b/src/mod/util/dtwarning_use_cvar.cpp index f1690ff5..0fac9dd3 100644 --- a/src/mod/util/dtwarning_use_cvar.cpp +++ b/src/mod/util/dtwarning_use_cvar.cpp @@ -16,7 +16,7 @@ namespace Mod::Util::DTWarning_Use_CVar V_vsprintf_safe(msg, pInMessage, va); va_end(va); - DETOUR_STATIC_CALL(DataTable_Warning)("%s", msg); + DETOUR_STATIC_CALL("%s", msg); } diff --git a/src/mod/util/entity_overlays.cpp b/src/mod/util/entity_overlays.cpp index 4b401993..a549a49b 100644 --- a/src/mod/util/entity_overlays.cpp +++ b/src/mod/util/entity_overlays.cpp @@ -31,7 +31,7 @@ namespace Mod::Util::Entity_Overlays DevMsg("SetDebugBits([pPlayer: #%d] [name: \"%s\"] [bit: %08x]\n", ENTINDEX(pPlayer), name, bit); - DETOUR_STATIC_CALL(SetDebugBits)(pPlayer, name, bit); + DETOUR_STATIC_CALL(pPlayer, name, bit); } @@ -46,7 +46,7 @@ namespace Mod::Util::Entity_Overlays DETOUR_DECL_STATIC(CBaseEntity *, GetNextCommandEntity, CBasePlayer *pPlayer, const char *name, CBaseEntity *ent) { - auto result = DETOUR_STATIC_CALL(GetNextCommandEntity)(pPlayer, name, ent); + auto result = DETOUR_STATIC_CALL(pPlayer, name, ent); char str_ent [0x1000]; char str_result[0x1000]; diff --git a/src/mod/util/jumboframes.cpp b/src/mod/util/jumboframes.cpp index d525d261..0502c597 100644 --- a/src/mod/util/jumboframes.cpp +++ b/src/mod/util/jumboframes.cpp @@ -514,7 +514,7 @@ namespace Mod::Util::JumboFrames length, (bUseCompression ? "true" : "false")); - return DETOUR_STATIC_CALL(NET_SendPacket)(chan, sock, to, data, length, pVoicePayload, bUseCompression); + return DETOUR_STATIC_CALL(chan, sock, to, data, length, pVoicePayload, bUseCompression); } DETOUR_DECL_STATIC(int, NET_SendLong, INetChannel *chan, int sock, SOCKET s, const char *buf, int len, const struct sockaddr *to, int tolen, int nMaxRoutableSize) @@ -525,7 +525,7 @@ namespace Mod::Util::JumboFrames len, nMaxRoutableSize); - return DETOUR_STATIC_CALL(NET_SendLong)(chan, sock, s, buf, len, to, tolen, nMaxRoutableSize); + return DETOUR_STATIC_CALL(chan, sock, s, buf, len, to, tolen, nMaxRoutableSize); } DETOUR_DECL_STATIC(int, NET_SendTo, bool verbose, SOCKET s, const char *buf, int len, const struct sockaddr *to, int tolen, int iGameDataLength) @@ -534,14 +534,14 @@ namespace Mod::Util::JumboFrames len, iGameDataLength); - return DETOUR_STATIC_CALL(NET_SendTo)(verbose, s, buf, len, to, tolen, iGameDataLength); + return DETOUR_STATIC_CALL(verbose, s, buf, len, to, tolen, iGameDataLength); } DETOUR_DECL_MEMBER(int, CNetChan_GetMaxRoutablePayloadSize) { static ConVarRef net_maxroutable("net_maxroutable"); - //auto result = DETOUR_MEMBER_CALL(CNetChan_GetMaxRoutablePayloadSize)(); + //auto result = DETOUR_MEMBER_CALL(); auto result = net_maxroutable.GetInt(); TRACE("%d", result); diff --git a/src/mod/util/notify_recv.cpp b/src/mod/util/notify_recv.cpp index d68c8a8f..b0834739 100644 --- a/src/mod/util/notify_recv.cpp +++ b/src/mod/util/notify_recv.cpp @@ -136,7 +136,7 @@ namespace Mod::Util::Notify_Recv ReceivePackets(); ProcessQueuedPackets(); - DETOUR_STATIC_CALL(CDebugOverlay_DrawAllOverlays)(); + DETOUR_STATIC_CALL(); } diff --git a/src/mod/util/notify_send.cpp b/src/mod/util/notify_send.cpp index 612bb127..fed6acee 100644 --- a/src/mod/util/notify_send.cpp +++ b/src/mod/util/notify_send.cpp @@ -157,7 +157,7 @@ namespace Mod::Util::Notify_Send msg->WriteString(buf.get()); MSG_END(); - DETOUR_STATIC_CALL(Con_NPrintf)(idx, "%s", buf.get()); + DETOUR_STATIC_CALL(idx, "%s", buf.get()); } DETOUR_DECL_MEMBER(void, IVEngineServer_Con_NPrintf, int pos, const char *fmt, ...) @@ -175,7 +175,7 @@ namespace Mod::Util::Notify_Send msg->WriteString(buf.get()); MSG_END(); - DETOUR_MEMBER_CALL(IVEngineServer_Con_NPrintf)(pos, "%s", buf.get()); + DETOUR_MEMBER_CALL(pos, "%s", buf.get()); } DETOUR_DECL_MEMBER(void, IVEngineServer_Con_NXPrintf, const struct con_nprint_s *info, const char *fmt, ...) @@ -198,7 +198,7 @@ namespace Mod::Util::Notify_Send msg->WriteString (buf.get()); MSG_END(); - DETOUR_MEMBER_CALL(IVEngineServer_Con_NXPrintf)(info, "%s", buf.get()); + DETOUR_MEMBER_CALL(info, "%s", buf.get()); } diff --git a/src/mod/util/overlay_enhancements.cpp b/src/mod/util/overlay_enhancements.cpp index eb476246..0b9e8462 100644 --- a/src/mod/util/overlay_enhancements.cpp +++ b/src/mod/util/overlay_enhancements.cpp @@ -177,7 +177,7 @@ namespace Mod::Util::Overlay_Enhancements DETOUR_DECL_MEMBER(void, CDebugOverlay_Paint) { SCOPED_INCREMENT(rc_CDebugOverlay_Paint); - DETOUR_MEMBER_CALL(CDebugOverlay_Paint)(); + DETOUR_MEMBER_CALL(); } @@ -202,7 +202,7 @@ namespace Mod::Util::Overlay_Enhancements va_end(va); } - return DETOUR_MEMBER_CALL(CMatSystemSurface_DrawColoredText)(font, x, y, r, g, b, a, fmt, argptr); + return DETOUR_MEMBER_CALL(font, x, y, r, g, b, a, fmt, argptr); } @@ -400,7 +400,7 @@ namespace Mod::Util::Overlay_Enhancements } } - DETOUR_STATIC_CALL(CDebugOverlay_DrawOverlay)(pOverlay); + DETOUR_STATIC_CALL(pOverlay); } diff --git a/src/mod/util/overlay_recv.cpp b/src/mod/util/overlay_recv.cpp index 587c6572..90640fb4 100644 --- a/src/mod/util/overlay_recv.cpp +++ b/src/mod/util/overlay_recv.cpp @@ -1075,7 +1075,7 @@ namespace Mod::Util::Overlay_Recv ReceivePackets(); ProcessQueuedPackets(); - DETOUR_STATIC_CALL(CDebugOverlay_DrawAllOverlays)(); + DETOUR_STATIC_CALL(); #if 0 static std::vector packet; diff --git a/src/mod/util/overlay_send.cpp b/src/mod/util/overlay_send.cpp index 225a7a1e..4be24be9 100644 --- a/src/mod/util/overlay_send.cpp +++ b/src/mod/util/overlay_send.cpp @@ -207,7 +207,7 @@ namespace Mod::Util::Overlay_Send filter = new CReliableBroadcastRecipientFilter(); SCOPED_INCREMENT(rc_IServerGameDLL_GameFrame); - DETOUR_MEMBER_CALL(IServerGameDLL_GameFrame)(simulating); + DETOUR_MEMBER_CALL(simulating); /* post-frame */ // TODO: report stats (bits/sec average based on timer) @@ -1099,7 +1099,7 @@ namespace Mod::Util::Overlay_Send } DETOUR_DECL_STATIC(void, clear_debug_overlays, const CCommand& args) { - DETOUR_STATIC_CALL(clear_debug_overlays)(args); + DETOUR_STATIC_CALL(args); Send_Clear(); } @@ -1129,14 +1129,14 @@ namespace Mod::Util::Overlay_Send DETOUR_DECL_MEMBER(void, NextBotPlayer_CTFPlayer_PhysicsSimulate) { SCOPED_INCREMENT(rc_NextBotPlayer_PhysicsSimulate); - DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_PhysicsSimulate)(); + DETOUR_MEMBER_CALL(); } RefCount rc_NextBotPlayer_Update; DETOUR_DECL_MEMBER(void, NextBotPlayer_CTFPlayer_Update) { SCOPED_INCREMENT(rc_NextBotPlayer_Update); - DETOUR_MEMBER_CALL(NextBotPlayer_CTFPlayer_Update)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_STATIC(void, ConColorMsg, const Color& clr, const char *pMsg, ...) @@ -1152,7 +1152,7 @@ namespace Mod::Util::Overlay_Send V_vsprintf_safe(buf, pMsg, args); va_end(args); - DETOUR_STATIC_CALL(ConColorMsg)(clr, "%s", buf); + DETOUR_STATIC_CALL(clr, "%s", buf); } @@ -1160,7 +1160,7 @@ namespace Mod::Util::Overlay_Send DETOUR_DECL_STATIC(void, DrawAllDebugOverlays) { SCOPED_INCREMENT(rc_DrawAllDebugOverlays); - DETOUR_STATIC_CALL(DrawAllDebugOverlays)(); + DETOUR_STATIC_CALL(); } DETOUR_DECL_MEMBER(bool, IVEngineServer_IsDedicatedServer) @@ -1169,7 +1169,7 @@ namespace Mod::Util::Overlay_Send return false; } - return DETOUR_MEMBER_CALL(IVEngineServer_IsDedicatedServer)(); + return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/util/serialize_spew.cpp b/src/mod/util/serialize_spew.cpp index 6945aed4..8e0e11fd 100644 --- a/src/mod/util/serialize_spew.cpp +++ b/src/mod/util/serialize_spew.cpp @@ -26,7 +26,7 @@ namespace Mod::Util::Serialize_Spew // LibMgr::WhichLibAtAddr(func ptr addr), if any } - DETOUR_STATIC_CALL(SpewOutputFunc)(func); + DETOUR_STATIC_CALL(func); } diff --git a/src/mod/util/vprof_remote.cpp b/src/mod/util/vprof_remote.cpp index 077abeec..c4ae94c7 100644 --- a/src/mod/util/vprof_remote.cpp +++ b/src/mod/util/vprof_remote.cpp @@ -179,7 +179,7 @@ namespace Mod::Util::VProf_Remote DevMsg(" this = %08x\n", (uintptr_t)this); DevMsg(" cmd = \"%s\"\n", cmd); - DETOUR_MEMBER_CALL(CRConClient_SendCmd)(cmd); + DETOUR_MEMBER_CALL(cmd); } @@ -233,7 +233,7 @@ namespace Mod::Util::VProf_Remote_Test } } - DETOUR_MEMBER_CALL(CServerRemoteAccess_SendVProfData)(listenerID, bGroupData, data, len); + DETOUR_MEMBER_CALL(listenerID, bGroupData, data, len); } diff --git a/src/mod/vgui/test.cpp b/src/mod/vgui/test.cpp index 9546011a..7a445669 100644 --- a/src/mod/vgui/test.cpp +++ b/src/mod/vgui/test.cpp @@ -61,7 +61,7 @@ namespace Mod::VGUI::Test Warning("[CLIENT] Got SVC_CmdKeyValues, but the KeyValues ptr is nullptr!\n"); } - return DETOUR_MEMBER_CALL(SVC_CmdKeyValues_Process)(); + return DETOUR_MEMBER_CALL(); } diff --git a/src/mod/visualize/airblast_box.cpp b/src/mod/visualize/airblast_box.cpp index 17dbf7e0..ca445dd2 100644 --- a/src/mod/visualize/airblast_box.cpp +++ b/src/mod/visualize/airblast_box.cpp @@ -23,7 +23,7 @@ namespace Mod::Visualize::Airblast_Box DETOUR_DECL_MEMBER(bool, CTFWeaponBase_DeflectProjectiles) { SCOPED_INCREMENT(rc_CTFWeaponBase_DeflectProjectiles); - return DETOUR_MEMBER_CALL(CTFWeaponBase_DeflectProjectiles)(); + return DETOUR_MEMBER_CALL(); } /* UTIL_EntitiesInBox forwards call to partition->EnumerateElementsInBox */ @@ -44,7 +44,7 @@ namespace Mod::Visualize::Airblast_Box cvar_duration.GetFloat()); } - return DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInBox)(listMask, mins, maxs, coarseTest, pIterator); + return DETOUR_MEMBER_CALL(listMask, mins, maxs, coarseTest, pIterator); } diff --git a/src/mod/visualize/airblast_cone.cpp b/src/mod/visualize/airblast_cone.cpp index 64bbadee..23ecc967 100644 --- a/src/mod/visualize/airblast_cone.cpp +++ b/src/mod/visualize/airblast_cone.cpp @@ -148,7 +148,7 @@ namespace Mod::Visualize::Airblast_Cone deflected[player] = false; } - DETOUR_MEMBER_CALL(CTFFlameThrower_FireAirBlast)(i1); + DETOUR_MEMBER_CALL(i1); if (cvar_clear.GetBool()) { NDebugOverlay::Clear(); @@ -173,7 +173,7 @@ namespace Mod::Visualize::Airblast_Cone DETOUR_DECL_MEMBER(bool, CTFFlameThrower_DeflectPlayer, CTFPlayer *pVictim, CTFPlayer *pPyro, const Vector& vecEyeFwd, const Vector& vecBoxCenter, const Vector& vecBoxSize) { - auto result = DETOUR_MEMBER_CALL(CTFFlameThrower_DeflectPlayer)(pVictim, pPyro, vecEyeFwd, vecBoxCenter, vecBoxSize); + auto result = DETOUR_MEMBER_CALL(pVictim, pPyro, vecEyeFwd, vecBoxCenter, vecBoxSize); if (result) { auto it = deflected.find(pVictim); diff --git a/src/mod/visualize/airblast_vectors.cpp b/src/mod/visualize/airblast_vectors.cpp index 8a75d314..92e23e0d 100644 --- a/src/mod/visualize/airblast_vectors.cpp +++ b/src/mod/visualize/airblast_vectors.cpp @@ -44,7 +44,7 @@ namespace Mod::Visualize::Airblast_Vectors float attr__airblast_vertical_pushback_scale = -1.0f; DETOUR_DECL_STATIC(float, CAttributeManager_AttribHookValue_float, float value, const char *attr, const CBaseEntity *ent, CUtlVector *vec, bool b1) { - auto result = DETOUR_STATIC_CALL(CAttributeManager_AttribHookValue_float)(value, attr, ent, vec, b1); + auto result = DETOUR_STATIC_CALL(value, attr, ent, vec, b1); if (strcmp(attr, "airblast_pushback_scale") == 0) { attr__airblast_pushback_scale = result; @@ -60,7 +60,7 @@ namespace Mod::Visualize::Airblast_Vectors { NDebugOverlay::Clear(); - auto result = DETOUR_MEMBER_CALL(CTFFlameThrower_DeflectPlayer)(pVictim, pPyro, vecEyeFwd, vecBoxCenter, vecBoxSize); + auto result = DETOUR_MEMBER_CALL(pVictim, pPyro, vecEyeFwd, vecBoxCenter, vecBoxSize); Vector vecDeltaWSC = (pVictim->WorldSpaceCenter() - pPyro->WorldSpaceCenter()); @@ -102,7 +102,7 @@ namespace Mod::Visualize::Airblast_Vectors { DevMsg("ApplyGenericPushbackImpulse: %6.1f [ %+7.1f %+7.1f %+7.1f ]\n", impulse.Length(), impulse.x, impulse.y, impulse.z); - DETOUR_MEMBER_CALL(CTFPlayer_ApplyGenericPushbackImpulse)(impulse, inflictor); + DETOUR_MEMBER_CALL(impulse, inflictor); } diff --git a/src/mod/visualize/blast_radius.cpp b/src/mod/visualize/blast_radius.cpp index 6e15f408..21626897 100644 --- a/src/mod/visualize/blast_radius.cpp +++ b/src/mod/visualize/blast_radius.cpp @@ -186,7 +186,7 @@ namespace Mod::Visualize::Blast_Radius radiusinfo = &info; SCOPED_INCREMENT(rc_CTFGameRules_RadiusDamage); - DETOUR_MEMBER_CALL(CTFGameRules_RadiusDamage)(info); + DETOUR_MEMBER_CALL(info); } ConVar cvar_spheretext("sig_visualize_blast_radius_spheretext", "1", FCVAR_NOTIFY, @@ -270,14 +270,14 @@ namespace Mod::Visualize::Blast_Radius //NDebugOverlay::EntityTextAtPosition(radiusinfo->m_vecOrigin, 1, buf, cvar_duration_sphere.GetFloat(), 0xff, 0xff, 0xff, 0xff); } - DETOUR_MEMBER_CALL(CEntitySphereQuery_ctor)(center, radius, flagMask); + DETOUR_MEMBER_CALL(center, radius, flagMask); } RefCount rc_CTFRadiusDamageInfo_ApplyToEntity; DETOUR_DECL_MEMBER_CALL_CONVENTION(__gcc_regcall, int, CTFRadiusDamageInfo_ApplyToEntity, CBaseEntity *ent) { if (rc_CTFGameRules_RadiusDamage > 0) ++rc_CTFRadiusDamageInfo_ApplyToEntity; - auto result = DETOUR_MEMBER_CALL(CTFRadiusDamageInfo_ApplyToEntity)(ent); + auto result = DETOUR_MEMBER_CALL(ent); if (rc_CTFGameRules_RadiusDamage > 0) --rc_CTFRadiusDamageInfo_ApplyToEntity; return result; } @@ -337,7 +337,7 @@ namespace Mod::Visualize::Blast_Radius } } - return DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } diff --git a/src/mod/visualize/damage_force.cpp b/src/mod/visualize/damage_force.cpp index 5b7b8f28..11d5278d 100644 --- a/src/mod/visualize/damage_force.cpp +++ b/src/mod/visualize/damage_force.cpp @@ -16,7 +16,7 @@ namespace Mod::Visualize::Damage_Force NDebugOverlay::VertArrow(vecCenter, vecCenter + vecForce, 5.0f, 0xff, 0x00, 0x00, 0xff, true, 1.0f); } - return DETOUR_MEMBER_CALL(CTFPlayer_OnTakeDamage)(info); + return DETOUR_MEMBER_CALL(info); } diff --git a/src/mod/visualize/dispenser_radius.cpp b/src/mod/visualize/dispenser_radius.cpp index ba932d08..a0687c8c 100644 --- a/src/mod/visualize/dispenser_radius.cpp +++ b/src/mod/visualize/dispenser_radius.cpp @@ -20,7 +20,7 @@ namespace Mod::Visualize::Dispenser_Radius DETOUR_DECL_MEMBER(void, CObjectDispenser_DispenseThink) { - DETOUR_MEMBER_CALL(CObjectDispenser_DispenseThink)(); + DETOUR_MEMBER_CALL(); static int i = 0; if (i++ % 10 != 0) { diff --git a/src/mod/visualize/engie_nests.cpp b/src/mod/visualize/engie_nests.cpp index de066dc1..5f87dd89 100644 --- a/src/mod/visualize/engie_nests.cpp +++ b/src/mod/visualize/engie_nests.cpp @@ -96,21 +96,21 @@ namespace Mod::Visualize::Engie_Nests DETOUR_DECL_MEMBER(ActionResult, CTFBotMvMEngineerTeleportSpawn_Update, CTFBot *actor, float dt) { SCOPED_INCREMENT(rc_TeleSpawn_Update); - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerTeleportSpawn_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } RefCount rc_BuildSentry_Update; DETOUR_DECL_MEMBER(ActionResult, CTFBotMvMEngineerBuildSentryGun_Update, CTFBot *actor, float dt) { SCOPED_INCREMENT(rc_BuildSentry_Update); - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerBuildSentryGun_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } RefCount rc_BuildTele_Update; DETOUR_DECL_MEMBER(ActionResult, CTFBotMvMEngineerBuildTeleportExit_Update, CTFBot *actor, float dt) { SCOPED_INCREMENT(rc_BuildTele_Update); - return DETOUR_MEMBER_CALL(CTFBotMvMEngineerBuildTeleportExit_Update)(actor, dt); + return DETOUR_MEMBER_CALL(actor, dt); } @@ -118,7 +118,7 @@ namespace Mod::Visualize::Engie_Nests DETOUR_DECL_MEMBER(void, CTFGameRules_PushAllPlayersAway, const Vector& origin, float radius, float force, int teamnum, CUtlVector *pushed_players) { SCOPED_INCREMENT(rc_PushAllPlayersAway); - DETOUR_MEMBER_CALL(CTFGameRules_PushAllPlayersAway)(origin, radius, force, teamnum, pushed_players); + DETOUR_MEMBER_CALL(origin, radius, force, teamnum, pushed_players); constexpr float duration = 2.0f; diff --git a/src/mod/visualize/explosive_headshot.cpp b/src/mod/visualize/explosive_headshot.cpp index 8e701d25..3d499306 100644 --- a/src/mod/visualize/explosive_headshot.cpp +++ b/src/mod/visualize/explosive_headshot.cpp @@ -22,7 +22,7 @@ namespace Mod::Visualize::Explosive_Headshot DETOUR_DECL_MEMBER(void, CTFSniperRifle_ExplosiveHeadShot, CTFPlayer *player1, CTFPlayer *player2) { SCOPED_INCREMENT(rc_CTFSniperRifle_ExplosiveHeadShot); - DETOUR_MEMBER_CALL(CTFSniperRifle_ExplosiveHeadShot)(player1, player2); + DETOUR_MEMBER_CALL(player1, player2); } /* UTIL_EntitiesInSphere forwards call to partition->EnumerateElementsInSphere */ @@ -42,7 +42,7 @@ namespace Mod::Visualize::Explosive_Headshot } } - return DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInSphere)(listMask, origin, radius, coarseTest, pIterator); + return DETOUR_MEMBER_CALL(listMask, origin, radius, coarseTest, pIterator); } diff --git a/src/mod/visualize/flamethrower.cpp b/src/mod/visualize/flamethrower.cpp index b06187e5..9d3c2256 100644 --- a/src/mod/visualize/flamethrower.cpp +++ b/src/mod/visualize/flamethrower.cpp @@ -101,7 +101,7 @@ namespace Mod::Visualize::Flamethrower DETOUR_DECL_STATIC(CTFFlameEntity *, CTFFlameEntity_Create, const Vector& origin, const QAngle& angles, CBaseEntity *owner, float f1, int i1, float f2, bool b1, bool b2) { - auto result = DETOUR_STATIC_CALL(CTFFlameEntity_Create)(origin, angles, owner, f1, i1, f2, b1, b2); + auto result = DETOUR_STATIC_CALL(origin, angles, owner, f1, i1, f2, b1, b2); if (result != nullptr) { flames.emplace(std::make_pair(result, result)); @@ -145,7 +145,7 @@ namespace Mod::Visualize::Flamethrower // DevMsg("[CTFFlameEntity::RemoveFlame] [%+6.1f %+6.1f %+6.1f]\n", // flame->GetAbsOrigin().x, flame->GetAbsOrigin().y, flame->GetAbsOrigin().z); - DETOUR_MEMBER_CALL(CTFFlameEntity_RemoveFlame)(); + DETOUR_MEMBER_CALL(); } @@ -161,7 +161,7 @@ namespace Mod::Visualize::Flamethrower int num_thinks = info.num_thinks++; } - DETOUR_MEMBER_CALL(CTFFlameEntity_FlameThink)(); + DETOUR_MEMBER_CALL(); } @@ -178,7 +178,7 @@ namespace Mod::Visualize::Flamethrower // NDebugOverlay::EntityTextAtPosition(flame->WorldSpaceCenter(), -2, "HIT", 0.10f, info.col_lt.r(), info.col_lt.g(), info.col_lt.b(), 0xff); } - DETOUR_MEMBER_CALL(CTFFlameEntity_OnCollide)(pOther); + DETOUR_MEMBER_CALL(pOther); } diff --git a/src/mod/visualize/jar_radius.cpp b/src/mod/visualize/jar_radius.cpp index b35e64f0..dc2c6a21 100644 --- a/src/mod/visualize/jar_radius.cpp +++ b/src/mod/visualize/jar_radius.cpp @@ -103,7 +103,7 @@ namespace Mod::Visualize::Jar_Radius break; } - DETOUR_MEMBER_CALL(CTFProjectile_Jar_Explode)(trace, i1); + DETOUR_MEMBER_CALL(trace, i1); is_jarate = false; is_milk = false; @@ -127,7 +127,7 @@ namespace Mod::Visualize::Jar_Radius NDebugOverlay::Sphere(center, vec3_angle, radius, 0xff, 0xff, 0xff, 0x20, false, cvar_duration_sphere.GetFloat()); } - return DETOUR_STATIC_CALL(UTIL_EntitiesInSphere)(center, radius, pEnum); + return DETOUR_STATIC_CALL(center, radius, pEnum); } @@ -161,7 +161,7 @@ namespace Mod::Visualize::Jar_Radius NDebugOverlay::EntityText(ENTINDEX(player), 2, CFmtStrN<64>("%.1f sec", duration), cvar_duration_player.GetFloat(), 0xff, 0xff, 0xff, 0xff); } - DETOUR_MEMBER_CALL(CTFPlayerShared_AddCond)(cond, duration, provider); + DETOUR_MEMBER_CALL(cond, duration, provider); } diff --git a/src/mod/visualize/melee_range.cpp b/src/mod/visualize/melee_range.cpp index a7eb2e71..cfb1f414 100644 --- a/src/mod/visualize/melee_range.cpp +++ b/src/mod/visualize/melee_range.cpp @@ -40,14 +40,14 @@ namespace Mod::Visualize::Melee_Range got_ray = true; memcpy(&saved_ray, &ray, sizeof(ray)); - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); } #endif DETOUR_DECL_MEMBER(bool, CTFWeaponBaseMelee_DoSwingTraceInternal, CGameTrace *pTrace, bool cleave_attack, CUtlVector *v1) { - auto result = DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_DoSwingTraceInternal)(pTrace, cleave_attack, v1); + auto result = DETOUR_MEMBER_CALL(pTrace, cleave_attack, v1); auto melee = reinterpret_cast(this); CTFPlayer *owner = ToTFPlayer(melee->GetOwner()); diff --git a/src/mod/visualize/minigun_deflect.cpp b/src/mod/visualize/minigun_deflect.cpp index 0d0fb45f..95fbb7a9 100644 --- a/src/mod/visualize/minigun_deflect.cpp +++ b/src/mod/visualize/minigun_deflect.cpp @@ -34,13 +34,13 @@ namespace Mod::Visualize::Minigun_Deflect DETOUR_DECL_MEMBER(void, CTFMinigun_AttackEnemyProjectiles) { SCOPED_INCREMENT(rc_CTFMinigun_AttackProjectiles); - DETOUR_MEMBER_CALL(CTFMinigun_AttackEnemyProjectiles)(); + DETOUR_MEMBER_CALL(); } bool is_MiniBoss; DETOUR_DECL_MEMBER(bool, CTFPlayer_IsMiniBoss) { - bool result = DETOUR_MEMBER_CALL(CTFPlayer_IsMiniBoss)(); + bool result = DETOUR_MEMBER_CALL(); is_MiniBoss = result; return result; } @@ -76,12 +76,12 @@ namespace Mod::Visualize::Minigun_Deflect cvar_duration.GetFloat()); } - return DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInSphere)(listMask, origin, radius, coarseTest, pIterator); + return DETOUR_MEMBER_CALL(listMask, origin, radius, coarseTest, pIterator); } DETOUR_DECL_STATIC(float, CalcDistanceToLineSegment, const Vector& P, const Vector& vLineA, const Vector& vLineB, float *t) { - float dist = DETOUR_STATIC_CALL(CalcDistanceToLineSegment)(P, vLineA, vLineB, t); + float dist = DETOUR_STATIC_CALL(P, vLineA, vLineB, t); if (rc_CTFMinigun_AttackProjectiles > 0) { float radius = (is_MiniBoss ? 56.0f : 38.0f); diff --git a/src/mod/visualize/taunt_attacks.cpp b/src/mod/visualize/taunt_attacks.cpp index d1343b2d..627ed2d4 100644 --- a/src/mod/visualize/taunt_attacks.cpp +++ b/src/mod/visualize/taunt_attacks.cpp @@ -256,13 +256,13 @@ namespace Mod::Visualize::Taunt_Attacks taunt_player = reinterpret_cast(this); SCOPED_INCREMENT(rc_CTFPlayer_DoTauntAttack); - DETOUR_MEMBER_CALL(CTFPlayer_DoTauntAttack)(); + DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(void, IEngineTrace_TraceRay, const Ray_t& ray, unsigned int fMask, ITraceFilter *pTraceFilter, trace_t *pTrace) { - DETOUR_MEMBER_CALL(IEngineTrace_TraceRay)(ray, fMask, pTraceFilter, pTrace); + DETOUR_MEMBER_CALL(ray, fMask, pTraceFilter, pTrace); if (rc_CTFPlayer_DoTauntAttack > 0 && ((ray.m_Delta.Length() > 127.9f && ray.m_Delta.Length() < 128.1f) || @@ -400,7 +400,7 @@ namespace Mod::Visualize::Taunt_Attacks } } - DETOUR_MEMBER_CALL(ISpatialPartition_EnumerateElementsInBox)(listMask, mins, maxs, coarseTest, pIterator); + DETOUR_MEMBER_CALL(listMask, mins, maxs, coarseTest, pIterator); } DETOUR_DECL_MEMBER(void, CEntitySphereQuery_ctor, const Vector& center, float radius, int flagMask) @@ -420,7 +420,7 @@ namespace Mod::Visualize::Taunt_Attacks } } - DETOUR_MEMBER_CALL(CEntitySphereQuery_ctor)(center, radius, flagMask); + DETOUR_MEMBER_CALL(center, radius, flagMask); } diff --git a/src/stub/econ.cpp b/src/stub/econ.cpp index 046b616e..974f4cc3 100644 --- a/src/stub/econ.cpp +++ b/src/stub/econ.cpp @@ -408,6 +408,8 @@ CInventoryManager *InventoryManager() { return ft_InventoryManager(); } static StaticFuncThunk ft_TFInventoryManager("TFInventoryManager"); CTFInventoryManager *TFInventoryManager() { return ft_TFInventoryManager(); } +CAttribute_String *last_parsed_string_attribute_value = nullptr; + bool LoadAttributeDataUnionFromString(const CEconItemAttributeDefinition *attr_def, attribute_data_union_t &value, const std::string &value_str) { //Pool of previously added string values @@ -418,6 +420,10 @@ bool LoadAttributeDataUnionFromString(const CEconItemAttributeDefinition *attr_d auto entry = attribute_string_values.find(value_str); if (entry != attribute_string_values.end()) { value = entry->second; +#ifdef PLATFORM_64BITS + last_parsed_string_attribute_value = entry->second.m_String; + Msg("set that parsed %p %p\n", last_parsed_string_attribute_value, entry->second.m_Float); +#endif return true; } } diff --git a/src/stub/econ.h b/src/stub/econ.h index a94fd441..8ee85570 100644 --- a/src/stub/econ.h +++ b/src/stub/econ.h @@ -229,6 +229,10 @@ bool LoadAttributeDataUnionFromString(const CEconItemAttributeDefinition *attr_d class CEconItemAttribute; +#ifdef PLATFORM_64BITS +extern CAttribute_String *last_parsed_string_attribute_value; +#endif + class CAttributeList { public: diff --git a/src/util/lua.cpp b/src/util/lua.cpp index 485f7212..bdbd37ec 100644 --- a/src/util/lua.cpp +++ b/src/util/lua.cpp @@ -4178,7 +4178,7 @@ namespace Util::Lua DETOUR_DECL_MEMBER(void, CBaseEntity_Activate) { auto entity = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CBaseEntity_Activate)(); + DETOUR_MEMBER_CALL(); auto mod = entity->GetEntityModule("luaentity"); if (mod != nullptr) { mod->FireCallback(ON_ACTIVATE); @@ -4187,7 +4187,7 @@ namespace Util::Lua DETOUR_DECL_STATIC(int, DispatchSpawn, CBaseEntity *entity, bool flag) { - auto result = DETOUR_STATIC_CALL(DispatchSpawn)(entity, flag); + auto result = DETOUR_STATIC_CALL(entity, flag); if (entity != nullptr) { auto mod = entity->GetEntityModule("luaentity"); if (mod != nullptr && !entity->IsPlayer()) { @@ -4199,7 +4199,7 @@ namespace Util::Lua DETOUR_DECL_STATIC(CBaseEntity *, CreateEntityByName, const char *className, int iForceEdictIndex) { - auto entity = DETOUR_STATIC_CALL(CreateEntityByName)(className, iForceEdictIndex); + auto entity = DETOUR_STATIC_CALL(className, iForceEdictIndex); if (entity != nullptr && !entity_create_callbacks.empty()) { for(auto &callback : entity_create_callbacks) { if (entity->GetClassnameString() == callback.classname || (callback.wildcard && NamesMatch(STRING(callback.classname), entity->GetClassnameString()))) { @@ -4250,7 +4250,7 @@ namespace Util::Lua mod->lastTakeDamage = infooverride; } - damage = DETOUR_MEMBER_CALL(CBaseEntity_TakeDamage)(infooverride); + damage = DETOUR_MEMBER_CALL(infooverride); if (mod != nullptr&& !mod->callbacks[ON_DAMAGE_RECEIVED_POST].empty()) { auto &callbackList = mod->callbacks[ON_DAMAGE_RECEIVED_POST]; @@ -4274,7 +4274,7 @@ namespace Util::Lua DETOUR_DECL_MEMBER(int, CBaseCombatCharacter_OnTakeDamage, const CTakeDamageInfo& info) { CBaseEntity *entity = reinterpret_cast(this); - auto ret = DETOUR_MEMBER_CALL(CBaseCombatCharacter_OnTakeDamage)(info); + auto ret = DETOUR_MEMBER_CALL(info); auto mod = entity->GetEntityModule("luaentity"); if (mod != nullptr) { @@ -4303,7 +4303,7 @@ namespace Util::Lua return true; } } - return DETOUR_MEMBER_CALL(CBaseEntity_AcceptInput)(szInputName, pActivator, pCaller, Value, outputID); + return DETOUR_MEMBER_CALL(szInputName, pActivator, pCaller, Value, outputID); } @@ -4344,12 +4344,12 @@ namespace Util::Lua return; } } - return DETOUR_MEMBER_CALL(CBaseEntityOutput_FireOutput)(Value, pActivator, pCaller, fDelay); + return DETOUR_MEMBER_CALL(Value, pActivator, pCaller, fDelay); } DETOUR_DECL_MEMBER(void, CServerGameClients_ClientPutInServer, edict_t *edict, const char *playername) { - DETOUR_MEMBER_CALL(CServerGameClients_ClientPutInServer)(edict, playername); + DETOUR_MEMBER_CALL(edict, playername); for(auto state : LuaState::List()) { LEntityAlloc(state->GetState(), GetContainingEntity(edict)); state->CallGlobalCallback("OnPlayerConnected", 1, 0); @@ -4359,7 +4359,7 @@ namespace Util::Lua DETOUR_DECL_MEMBER(void, CTFPlayer_UpdateOnRemove) { auto player = reinterpret_cast(this); - DETOUR_MEMBER_CALL(CTFPlayer_UpdateOnRemove)(); + DETOUR_MEMBER_CALL(); for(auto state : LuaState::List()) { LEntityAlloc(state->GetState(), player); state->CallGlobalCallback("OnPlayerDisconnected", 1, 0); @@ -4370,7 +4370,7 @@ namespace Util::Lua { CTFPlayer* player = reinterpret_cast(this); int prebuttons = player->m_nButtons; - DETOUR_MEMBER_CALL(CBasePlayer_PlayerRunCommand)(cmd, moveHelper); + DETOUR_MEMBER_CALL(cmd, moveHelper); if (prebuttons != cmd->buttons) { auto mod = player->GetEntityModule("luaentity"); if (mod != nullptr) { @@ -4426,11 +4426,11 @@ namespace Util::Lua lua_settop(l, 0); } if(overriden) { - DETOUR_MEMBER_CALL(CBaseEntity_Event_Killed)(infooverride); + DETOUR_MEMBER_CALL(infooverride); return; } } - DETOUR_MEMBER_CALL(CBaseEntity_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CBaseCombatCharacter_Event_Killed, CTakeDamageInfo &info) @@ -4461,16 +4461,16 @@ namespace Util::Lua lua_settop(l, 0); } if(overriden) { - DETOUR_MEMBER_CALL(CBaseCombatCharacter_Event_Killed)(infooverride); + DETOUR_MEMBER_CALL(infooverride); return; } } - DETOUR_MEMBER_CALL(CBaseCombatCharacter_Event_Killed)(info); + DETOUR_MEMBER_CALL(info); } DETOUR_DECL_MEMBER(void, CTFPlayer_Spawn) { - DETOUR_MEMBER_CALL(CTFPlayer_Spawn)(); + DETOUR_MEMBER_CALL(); CTFPlayer *player = reinterpret_cast(this); auto mod = player->GetEntityModule("luaentity"); if (mod != nullptr) { @@ -4501,7 +4501,7 @@ namespace Util::Lua auto entity = reinterpret_cast(this); if (!CheckDeploy(ON_EQUIP_ITEM, owner, entity)) return; - DETOUR_MEMBER_CALL(CBaseCombatWeapon_Equip)(owner); + DETOUR_MEMBER_CALL(owner); } DETOUR_DECL_MEMBER(void, CTFWearable_Equip, CBasePlayer *owner) @@ -4509,7 +4509,7 @@ namespace Util::Lua auto entity = reinterpret_cast(this); if (!CheckDeploy(ON_EQUIP_ITEM, owner, entity)) return; - DETOUR_MEMBER_CALL(CTFWearable_Equip)(owner); + DETOUR_MEMBER_CALL(owner); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_Deploy) @@ -4527,7 +4527,7 @@ namespace Util::Lua mod->FireCallback(ON_DEPLOY_WEAPON, &func, 1, &funcReturn, 1); if (!give) return false; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_Deploy)(); + return DETOUR_MEMBER_CALL(); } DETOUR_DECL_MEMBER(bool, CTFWeaponBase_Holster, CBaseCombatWeapon *newWeapon) @@ -4548,7 +4548,7 @@ namespace Util::Lua if (!give) return false; } - return DETOUR_MEMBER_CALL(CTFWeaponBase_Holster)(newWeapon); + return DETOUR_MEMBER_CALL(newWeapon); } class PlayerLoadoutUpdatedListener : public IBitBufUserMessageListener @@ -4633,7 +4633,7 @@ namespace Util::Lua return result; } } - return DETOUR_STATIC_CALL(PassServerEntityFilter)(ent1, ent2); + return DETOUR_STATIC_CALL(ent1, ent2); } DETOUR_DECL_MEMBER(int, CCollisionEvent_ShouldCollide, IPhysicsObject *pObj0, IPhysicsObject *pObj1, void *pGameData0, void *pGameData1) @@ -4648,7 +4648,7 @@ namespace Util::Lua return result; } } - return DETOUR_MEMBER_CALL(CCollisionEvent_ShouldCollide)(pObj0, pObj1, pGameData0, pGameData1); + return DETOUR_MEMBER_CALL(pObj0, pObj1, pGameData0, pGameData1); } bool DoTouchCallback(CallbackType type, CBaseEntity *entity, CBaseEntity *other) @@ -4673,7 +4673,7 @@ namespace Util::Lua CBaseEntity *entity = reinterpret_cast(this); if (!DoTouchCallback(ON_START_TOUCH, entity, other)) return; - return DETOUR_MEMBER_CALL(CBaseEntity_StartTouch)(other); + return DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CBaseEntity_EndTouch, CBaseEntity *other) @@ -4681,7 +4681,7 @@ namespace Util::Lua CBaseEntity *entity = reinterpret_cast(this); if (!DoTouchCallback(ON_END_TOUCH, entity, other)) return; - return DETOUR_MEMBER_CALL(CBaseEntity_EndTouch)(other); + return DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CBaseTrigger_StartTouch, CBaseEntity *other) @@ -4689,7 +4689,7 @@ namespace Util::Lua CBaseEntity *entity = reinterpret_cast(this); if (!DoTouchCallback(ON_START_TOUCH, entity, other)) return; - return DETOUR_MEMBER_CALL(CBaseTrigger_StartTouch)(other); + return DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CBaseTrigger_EndTouch, CBaseEntity *other) @@ -4697,7 +4697,7 @@ namespace Util::Lua CBaseEntity *entity = reinterpret_cast(this); if (!DoTouchCallback(ON_END_TOUCH, entity, other)) return; - return DETOUR_MEMBER_CALL(CBaseTrigger_EndTouch)(other); + return DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CBaseEntity_Touch, CBaseEntity *other) @@ -4705,7 +4705,7 @@ namespace Util::Lua CBaseEntity *entity = reinterpret_cast(this); if (!DoTouchCallback(ON_TOUCH, entity, other)) return; - return DETOUR_MEMBER_CALL(CBaseEntity_Touch)(other); + return DETOUR_MEMBER_CALL(other); } DETOUR_DECL_MEMBER(void, CBasePlayer_Touch, CBaseEntity *other) @@ -4713,7 +4713,7 @@ namespace Util::Lua CBaseEntity *entity = reinterpret_cast(this); if (!DoTouchCallback(ON_TOUCH, entity, other)) return; - return DETOUR_MEMBER_CALL(CBasePlayer_Touch)(other); + return DETOUR_MEMBER_CALL(other); } class CGameEvent : public IGameEvent @@ -4782,7 +4782,7 @@ namespace Util::Lua } } - return DETOUR_MEMBER_CALL(IGameEventManager2_FireEvent)(event, bDontBroadcast); + return DETOUR_MEMBER_CALL(event, bDontBroadcast); } DETOUR_DECL_MEMBER(void, CTFWeaponBaseMelee_Smack ) @@ -4802,7 +4802,7 @@ namespace Util::Lua if (action == ACTION_CONTINUE) { SCOPED_INCREMENT(rc_CTFWeaponBaseGun_FireProjectile); - DETOUR_MEMBER_CALL(CTFWeaponBaseMelee_Smack)(); + DETOUR_MEMBER_CALL(); } if (mod != nullptr) { @@ -4831,7 +4831,7 @@ namespace Util::Lua CBaseAnimating *proj = nullptr; if (action == ACTION_CONTINUE) { SCOPED_INCREMENT(rc_CTFWeaponBaseGun_FireProjectile); - proj = DETOUR_MEMBER_CALL(CTFWeaponBaseGun_FireProjectile)(player); + proj = DETOUR_MEMBER_CALL(player); } if (action == ACTION_HANDLED) { @@ -4862,7 +4862,7 @@ namespace Util::Lua DETOUR_DECL_MEMBER(void, CPlayerMove_StartCommand, CBasePlayer *player, CUserCmd *ucmd) { - DETOUR_MEMBER_CALL(CPlayerMove_StartCommand)(player, ucmd); + DETOUR_MEMBER_CALL(player, ucmd); auto mod = player->GetEntityModule("playerusercmd"); if (mod != nullptr) { mod->lastPlayerUserCmd = *ucmd; @@ -4943,7 +4943,7 @@ namespace Util::Lua } } } - DETOUR_MEMBER_CALL(CVEngineServer_PlaybackTempEntity)(filter, delay, pSender, pST, classID); + DETOUR_MEMBER_CALL(filter, delay, pSender, pST, classID); } class CMod : public IMod, public IModCallbackListener, public IFrameUpdatePostEntityThinkListener diff --git a/src/util/pooled_string.cpp b/src/util/pooled_string.cpp index bad40780..d5362bbe 100644 --- a/src/util/pooled_string.cpp +++ b/src/util/pooled_string.cpp @@ -5,7 +5,7 @@ namespace Util::PooledStringMod { DETOUR_DECL_MEMBER(void, CGameStringPool_LevelShutdownPostEntity) { - DETOUR_MEMBER_CALL(CGameStringPool_LevelShutdownPostEntity)(); + DETOUR_MEMBER_CALL(); for (auto &string : PooledString::List()) { string->Reset(); }