1
- #if defined _srccoop_entitypatch_bm_included
2
- #endinput
3
- #endif
4
- #define _srccoop_entitypatch_bm_included
5
-
6
1
#pragma newdecls required
7
2
#pragma semicolon 1
8
3
@@ -15,7 +10,7 @@ static bool g_pPlayerIronsightClassic[MAXPLAYERS + 1];
15
10
// scientists should classify as allies (in MP, base function returns false when player is not passed in)
16
11
// this allows npcs to pass filter in "player ally only" triggers
17
12
//------------------------------------------------------
18
- public MRESReturn Hook_IsPlayerAlly (int _this , Handle hReturn , Handle hParams )
13
+ public MRESReturn Hook_IsPlayerAlly (int _this , DHookReturn hReturn , DHookParam hParams )
19
14
{
20
15
DHookSetReturn (hReturn , true );
21
16
return MRES_Supercede ;
@@ -66,7 +61,7 @@ public void Hook_GargSpawnPost(int iEntIndex)
66
61
// CAI_BaseNPC - npc_gargantua
67
62
// fix the 'ChasePlayer' input by setting a target ent.
68
63
//------------------------------------------------------
69
- public MRESReturn Hook_GargAcceptInputPost (int _this , Handle hReturn , Handle hParams )
64
+ public MRESReturn Hook_GargAcceptInputPost (int _this , DHookReturn hReturn , DHookParam hParams )
70
65
{
71
66
if (! DHookIsNullParam (hParams , 1 ))
72
67
{
@@ -262,7 +257,7 @@ public void Hook_XenTurretSpawnPost(int iEntIndex)
262
257
//------------------------------------------------------
263
258
CBaseEntity g_pActiveMarionettist [MAXPLAYERS +1 ] = {view_as <CBaseEntity >(- 1 ), ...};
264
259
265
- public MRESReturn Hook_MarionettistAcceptInput (int _this , Handle hReturn , Handle hParams )
260
+ public MRESReturn Hook_MarionettistAcceptInput (int _this , DHookReturn hReturn , DHookParam hParams )
266
261
{
267
262
if (CoopManager .IsCoopModeEnabled ())
268
263
{
@@ -543,7 +538,7 @@ public MRESReturn Hook_MusicTrackThink(int _this)
543
538
return MRES_Supercede ;
544
539
}
545
540
546
- public MRESReturn Hook_MusicTrackAcceptInput (int _this , Handle hReturn , Handle hParams )
541
+ public MRESReturn Hook_MusicTrackAcceptInput (int _this , DHookReturn hReturn , DHookParam hParams )
547
542
{
548
543
char szInputType [MAX_FORMAT ];
549
544
char szBuffer [MAX_VALUE ];
@@ -648,7 +643,7 @@ public MRESReturn Hook_TestGroundMove(Address _this, DHookReturn hReturn, DHookP
648
643
// `env_xen_portal_effect`
649
644
// Fixes xen portals not pushing players.
650
645
//------------------------------------------------------
651
- public MRESReturn Hook_XenPortalEffect_AcceptInput (int _this , Handle hReturn , Handle hParams )
646
+ public MRESReturn Hook_XenPortalEffect_AcceptInput (int _this , DHookReturn hReturn , DHookParam hParams )
652
647
{
653
648
char szInputType [MAX_FORMAT ];
654
649
DHookGetParamString (hParams , 1 , szInputType , sizeof (szInputType ));
@@ -823,7 +818,7 @@ public void Hook_GrenadeFragSpawnPost(const int iEntIndex)
823
818
// weapon_357/weapon_crossbow
824
819
// New constructed logic of toggling ironsights.
825
820
//------------------------------------------------------
826
- public MRESReturn Hook_ToggleIronsights (int _this , Handle hParams )
821
+ public MRESReturn Hook_ToggleIronsights (int _this , DHookParam hParams )
827
822
{
828
823
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
829
824
{
@@ -875,8 +870,7 @@ public MRESReturn Hook_ToggleIronsights(int _this, Handle hParams)
875
870
}
876
871
pPlayer .SetFOV (pWeapon , bWillBeUsingIronsights ? iFOV : 0 , 0.5 );
877
872
pWeapon .SetIronsights (bWillBeUsingIronsights );
878
-
879
- PreventWeaponFiring (pWeapon , 0.5 );
873
+ pWeapon .DelayNextAttack (0.5 );
880
874
881
875
return MRES_Supercede ;
882
876
}
@@ -887,7 +881,7 @@ public MRESReturn Hook_ToggleIronsights(int _this, Handle hParams)
887
881
// weapon_357
888
882
// Fixes the shooting animation played while using ironsights.
889
883
//------------------------------------------------------
890
- public MRESReturn Hook_IronsightGetPrimaryAttackActivity (int _this , Handle hReturn )
884
+ public MRESReturn Hook_IronsightGetPrimaryAttackActivity (int _this , DHookReturn hReturn )
891
885
{
892
886
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
893
887
{
@@ -909,7 +903,7 @@ public MRESReturn Hook_IronsightGetPrimaryAttackActivity(int _this, Handle hRetu
909
903
// weapon_crossbow
910
904
// Fixes the shooting animation played while using ironsights.
911
905
//------------------------------------------------------
912
- public MRESReturn Hook_CrossbowGetPrimaryAttackActivity (int _this , Handle hReturn )
906
+ public MRESReturn Hook_CrossbowGetPrimaryAttackActivity (int _this , DHookReturn hReturn )
913
907
{
914
908
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
915
909
{
@@ -941,7 +935,7 @@ void ConvarQuery_IronsightClassic(QueryCookie hCookie, int iClient, ConVarQueryR
941
935
//------------------------------------------------------
942
936
// Caches the client settings used for ironsights.
943
937
//------------------------------------------------------
944
- public MRESReturn Hook_IronsightDeployPost_SaveSettings (int _this , Handle hReturn )
938
+ public MRESReturn Hook_IronsightDeployPost_SaveSettings (int _this , DHookReturn hReturn )
945
939
{
946
940
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
947
941
{
@@ -959,7 +953,7 @@ public MRESReturn Hook_IronsightDeployPost_SaveSettings(int _this, Handle hRetur
959
953
// grenade_bolt
960
954
// Disables explosive bolts by blocking the call.
961
955
//------------------------------------------------------
962
- public MRESReturn Hook_GrenadeBoltAcceptInput (int _this , Handle hReturn , Handle hParams )
956
+ public MRESReturn Hook_GrenadeBoltAcceptInput (int _this , DHookReturn hReturn , DHookParam hParams )
963
957
{
964
958
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
965
959
{
@@ -978,7 +972,7 @@ public MRESReturn Hook_GrenadeBoltAcceptInput(int _this, Handle hReturn, Handle
978
972
// weapon_crossbow
979
973
// Sets the skin of the crossbow.
980
974
//------------------------------------------------------
981
- public MRESReturn Hook_CrossbowDeployPost (int _this , Handle hReturn )
975
+ public MRESReturn Hook_CrossbowDeployPost (int _this , DHookReturn hReturn )
982
976
{
983
977
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
984
978
{
@@ -1004,7 +998,7 @@ public MRESReturn Hook_CrossbowDeployPost(int _this, Handle hReturn)
1004
998
// TODO: Hooking ItemPostFrame with IsMultiplayer = false causes prediction issues.
1005
999
// Fix this by not calling IsMultiplayer = false.
1006
1000
//------------------------------------------------------
1007
- public MRESReturn Hook_CrossbowItemPostFrame (int _this , Handle hReturn )
1001
+ public MRESReturn Hook_CrossbowItemPostFrame (int _this , DHookReturn hReturn )
1008
1002
{
1009
1003
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1010
1004
{
@@ -1032,7 +1026,7 @@ public MRESReturn Hook_CrossbowItemPostFrame(int _this, Handle hReturn)
1032
1026
// weapon_crossbow
1033
1027
// See `Hook_CrossbowItemPostFrame` for details.
1034
1028
//------------------------------------------------------
1035
- public MRESReturn Hook_CrossbowItemPostFramePost (int _this , Handle hReturn )
1029
+ public MRESReturn Hook_CrossbowItemPostFramePost (int _this , DHookReturn hReturn )
1036
1030
{
1037
1031
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1038
1032
{
@@ -1049,7 +1043,7 @@ public MRESReturn Hook_CrossbowItemPostFramePost(int _this, Handle hReturn)
1049
1043
// - Sets the rearm bool
1050
1044
// - Sets animations
1051
1045
//------------------------------------------------------
1052
- public MRESReturn Hook_CrossbowPrimaryAttack (int _this , Handle hReturn , Handle hParams )
1046
+ public MRESReturn Hook_CrossbowPrimaryAttack (int _this , DHookReturn hReturn , DHookParam hParams )
1053
1047
{
1054
1048
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1055
1049
{
@@ -1062,7 +1056,7 @@ public MRESReturn Hook_CrossbowPrimaryAttack(int _this, Handle hReturn, Handle h
1062
1056
// weapon_crossbow
1063
1057
// See `Hook_CrossbowPrimaryAttack` for details.
1064
1058
//------------------------------------------------------
1065
- public MRESReturn Hook_CrossbowPrimaryAttackPost (int _this , Handle hReturn , Handle hParams )
1059
+ public MRESReturn Hook_CrossbowPrimaryAttackPost (int _this , DHookReturn hReturn , DHookParam hParams )
1066
1060
{
1067
1061
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1068
1062
{
@@ -1075,7 +1069,7 @@ public MRESReturn Hook_CrossbowPrimaryAttackPost(int _this, Handle hReturn, Hand
1075
1069
// weapon_crossbow
1076
1070
// Fixes the rearm animation when pulling out the crossbow.
1077
1071
//------------------------------------------------------
1078
- public MRESReturn Hook_CrossbowGetDrawActivity (int _this , Handle hReturn )
1072
+ public MRESReturn Hook_CrossbowGetDrawActivity (int _this , DHookReturn hReturn )
1079
1073
{
1080
1074
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1081
1075
{
@@ -1088,7 +1082,7 @@ public MRESReturn Hook_CrossbowGetDrawActivity(int _this, Handle hReturn)
1088
1082
// weapon_crossbow
1089
1083
// See `Hook_CrossbowGetDrawActivity` for details.
1090
1084
//------------------------------------------------------
1091
- public MRESReturn Hook_CrossbowGetDrawActivityPost (int _this , Handle hReturn )
1085
+ public MRESReturn Hook_CrossbowGetDrawActivityPost (int _this , DHookReturn hReturn )
1092
1086
{
1093
1087
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1094
1088
{
@@ -1102,7 +1096,7 @@ public MRESReturn Hook_CrossbowGetDrawActivityPost(int _this, Handle hReturn)
1102
1096
// `CWeapon_Crossbow::FireBolt` is only called by `CWeapon_Crossbow::PrimaryAttack` which is hooked.
1103
1097
// If this gets called with singleplayer being set, this will crash the server.
1104
1098
//------------------------------------------------------
1105
- public MRESReturn Hook_CrossbowFireBolt (int _this , Handle hReturn , Handle hParams )
1099
+ public MRESReturn Hook_CrossbowFireBolt (int _this , DHookReturn hReturn , DHookParam hParams )
1106
1100
{
1107
1101
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1108
1102
{
@@ -1115,7 +1109,7 @@ public MRESReturn Hook_CrossbowFireBolt(int _this, Handle hReturn, Handle hParam
1115
1109
// weapon_crossbow
1116
1110
// See `Hook_CrossbowFireBolt` for details.
1117
1111
//------------------------------------------------------
1118
- public MRESReturn Hook_CrossbowFireBoltPost (int _this , Handle hReturn , Handle hParams )
1112
+ public MRESReturn Hook_CrossbowFireBoltPost (int _this , DHookReturn hReturn , DHookParam hParams )
1119
1113
{
1120
1114
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1121
1115
{
@@ -1128,7 +1122,7 @@ public MRESReturn Hook_CrossbowFireBoltPost(int _this, Handle hReturn, Handle hP
1128
1122
// weapon_tau
1129
1123
// Fixes the tau velocity.
1130
1124
//------------------------------------------------------
1131
- public MRESReturn Hook_TauFireBeam (int _this , Handle hReturn )
1125
+ public MRESReturn Hook_TauFireBeam (int _this , DHookReturn hReturn )
1132
1126
{
1133
1127
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1134
1128
{
@@ -1141,7 +1135,7 @@ public MRESReturn Hook_TauFireBeam(int _this, Handle hReturn)
1141
1135
// weapon_tau
1142
1136
// See `Hook_TauFireBeamPost` for details.
1143
1137
//------------------------------------------------------
1144
- public MRESReturn Hook_TauFireBeamPost (int _this , Handle hReturn )
1138
+ public MRESReturn Hook_TauFireBeamPost (int _this , DHookReturn hReturn )
1145
1139
{
1146
1140
if (CoopManager .IsFeatureEnabled (FT_SP_WEAPONS ))
1147
1141
{
@@ -1171,7 +1165,7 @@ public MRESReturn Hook_Dissolve(int _this, DHookReturn hReturn, DHookParam hPara
1171
1165
1172
1166
// Switches between using singleplayer and multiplayer weapon values.
1173
1167
// This will get triggered by the command `params_reload_server`.
1174
- public MRESReturn Hook_CParamsManager_InitInstances (Address _this , Handle hReturn , Handle hParams )
1168
+ public MRESReturn Hook_CParamsManager_InitInstances (Address _this , DHookReturn hReturn , DHookParam hParams )
1175
1169
{
1176
1170
// TODO:
1177
1171
// Currently, this is getting only called during level init, but
0 commit comments