From 99ebd626537924de1475c138f6d3bb6935410c0f Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Thu, 6 Sep 2018 17:09:10 +0200 Subject: [PATCH] Update Hamsandwich for Sven Coop 5.17 (#452) * Remove dropped functions * Update existing offsets * Add some logic to prevent the use of removed functions. * Add Ham_SC_AddPoints and Ham_SC_AddPointsToTeam * Add Ham_SC_GiveAmmo * Add Ham_SC_FVisibleFromPos * Fix an old typos with CanPlaySentence for all mods * Add Ham_SC_CanPlaySequence * Add Ham_SC_PlayScriptSentence * Add Ham_SC_StartPlayerFollowing * Fix CanPlaySequence hamdata.ini (SC) * Add Ham_SC_StopPlayerFollowing * Fix handlers from previous commits * Add Ham_SC_PreSpawn * Add Ham_SC_PostSpawn * Add Ham_SC_OnKeyValueUpdate * Add Ham_SC_SetClassification * Add Ham_SC_MyCustomPointer and Ham_SC_MyItemPointer * Add Ham_SC_IsSneaking * Add Ham_SC_IsAlive * Add Ham_SC_IsBSPModel * Add Ham_SC_ReflectGauss * Add Ham_SC_HasTarget * Add Ham_SC_IsInWorld * Add Ham_SC_IsPlayer * Add Ham_SC_IsNetClient * Add Ham_SC_IsBreakable * Fix Ham_SC_IsMonster, Ham_SC_IsPointEntity, Ham_SC_IsMachine and Ham_SC_CriticakRemove handlers * Add Ham_SC_OnControls * Fix Ham_SC_TakeHealth and Ham_SC_TakeArmor handlers * Add Ham_SC_IsTriggered * Add Ham_SC_RemovePlayerItem * Fix typo * Fix Ham_SC_IsMoving handler * Add Ham_SC_SUB_UseTargets * Ham_SC_IsLockedByMaster * Add Ham_SC_FBecomeProne * Fix Ham_SC_FVisible handler * Add Ham_SC_FVecVisible * Fix Ham_SC_FVisibleFromPos handler * Fix Ham_SC_IsFacing handler * Add Ham_SC_SetPlayerAlly * Add Ham_SC_OnSetOriginByMap * Add Ham_SC_IsRevivable * Add Ham_SC_BeginRevive and Ham_SC_EndRevive * Update offsets based on SvenCoop v5.17 * Add Ham_SC_Item_CanCollect and Ham_SC_Item_Collect * Add Ham_SC_Item_AddToPlayer * Add Ham_SC_Item_AddDuplicate * Add Ham_SC_Item_AddAmmoFromItem * Add Ham_SC_Item_GetItemInfo * Add Ham_SC_Item_CanDeploy, Ham_SC_Item_Deploy and Ham_SC_Item_CanHolster * Add Ham_SC_Item_UpdateClientData * Add Ham_SC_Item_GetRespawnTime * Add Ham_SC_Item_CanHaveDuplicates * Add Ham_SC_Weapon_ExtractAmmoFromItem * Add Ham_SC_Weapon_GetAmmo1Drop and Ham_SC_Weapon_GetAmmo2Drop * Add Ham_SC_Weapon_FinishReload and Ham_SC_Weapon_ShouldReload * Fix Ham_SC_IsMultiplayer, Ham_SC_FRunfuncs and Ham_SC_FCanRun handlers * Add Ham_SC_Weapon_AddWeapon, _PlayEmptySound, _IsUsable, _ShouldWeaponIdle and _UseDecrement * Add Ham_SC_Item_GetPickupSound * Add Ham_SC_Item_InactiveItemPreFrame and Ham_SC_Item_InactiveItemPostFrame * Add Ham_SC_Item_DetachFromPlayer * Fix Ham_SC_Player_IsConnected handler * Add Ham_SC_Player_EnteredObserver, Ham_SC_Player_LeftObserver and Ham_SC_Player_IsObserver * Fix sc_postpawn typo (should be sc_postspawn) * Add few more assert --- configs/hamdata.ini | 1039 ++++++++++++------------ modules/hamsandwich/amxx_api.cpp | 4 + modules/hamsandwich/call_funcs.cpp | 325 +++++++- modules/hamsandwich/call_funcs.h | 32 + modules/hamsandwich/ham_const.h | 71 +- modules/hamsandwich/ham_utils.h | 9 +- modules/hamsandwich/hook_callbacks.cpp | 519 ++++++++++++ modules/hamsandwich/hook_callbacks.h | 79 ++ modules/hamsandwich/hook_create.cpp | 86 ++ modules/hamsandwich/hook_create.h | 32 + modules/hamsandwich/hook_native.cpp | 119 ++- modules/hamsandwich/hooklist.h | 1 + plugins/include/ham_const.inc | 631 +++++++++++++- 13 files changed, 2388 insertions(+), 559 deletions(-) diff --git a/configs/hamdata.ini b/configs/hamdata.ini index c6702c24..05a44691 100644 --- a/configs/hamdata.ini +++ b/configs/hamdata.ini @@ -517,7 +517,7 @@ checkmeleeattack2 86 schedulechange 92 canplaysequence 93 - canplaysentence 94 + canplaysentence2 94 playsentence 95 playscriptedsentence 96 sentencestop 97 @@ -702,7 +702,7 @@ checkmeleeattack2 86 schedulechange 92 canplaysequence 93 - canplaysentence 94 + canplaysentence2 94 playsentence 95 playscriptedsentence 96 sentencestop 97 @@ -888,7 +888,7 @@ checkmeleeattack2 86 schedulechange 92 canplaysequence 93 - canplaysentence 94 + canplaysentence2 94 playsentence 95 playscriptedsentence 96 sentencestop 97 @@ -1072,7 +1072,7 @@ checkmeleeattack2 88 schedulechange 94 canplaysequence 95 - canplaysentence 96 + canplaysentence2 96 playsentence 97 playscriptedsentence 98 sentencestop 99 @@ -1240,7 +1240,7 @@ checkmeleeattack2 87 schedulechange 93 canplaysequence 94 - canplaysentence 95 + canplaysentence2 95 playsentence 96 playscriptedsentence 97 sentencestop 98 @@ -1409,7 +1409,7 @@ checkmeleeattack2 87 schedulechange 93 canplaysequence 94 - canplaysentence 95 + canplaysentence2 95 playsentence 96 playscriptedsentence 97 sentencestop 98 @@ -2068,512 +2068,555 @@ ts_weapon_alternateattack 95 @end -; Sven-Coop 4.8 +; Sven-Coop 5.17 @section svencoop linux pev 4 base 0x0 - spawn 0 - precache 1 - keyvalue 2 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - irelationship 10 - classify 11 - deathnotice 12 - traceattack 13 - takedamage 14 - killed 17 - bloodcolor 18 - tracebleed 19 - istriggered 20 - mymonsterpointer 21 - mysquadmonsterpointer 22 - gettogglestate 23 - addpoints 24 - addpointstoteam 25 - addplayeritem 26 - removeplayeritem 27 - getdelay 29 - ismoving 30 - overridereset 31 - damagedecal 32 - settogglestate 33 - startsneaking 34 - stopsneaking 35 - oncontrols 36 - issneaking 37 - isalive 38 - isbspmodel 39 - reflectgauss 40 - hastarget 41 - isinworld 42 - isplayer 44 - isnetclient 46 - teamid 49 - getnexttarget 51 - think 52 - touch 53 - use 54 - blocked 55 - respawn 57 - updateowner 58 - fbecomeprone 59 - center 60 - eyeposition 61 - earposition 62 - bodytarget 63 - illumination 64 - fvecvisible 66 + spawn 1 + precache 3 + keyvalue 4 + objectcaps 9 + activate 10 + setobjectcollisionbox 11 + irelationship 14 + classify 15 + deathnotice 16 + traceattack 17 + takedamage 18 + killed 21 + bloodcolor 22 + tracebleed 23 + mymonsterpointer 25 + mysquadmonsterpointer 26 + gettogglestate 29 + addplayeritem 32 + getdelay 35 + overridereset 37 + damagedecal 38 + settogglestate 39 + startsneaking 40 + stopsneaking 41 + teamid 55 + getnexttarget 57 + think 58 + touch 59 + use 60 + blocked 61 + respawn 63 + updateowner 66 + fbecomeprone 67 + center 68 + eyeposition 69 + earposition 70 + bodytarget 71 + illumination 72 - look 77 - runai 78 - changeyaw 80 - monsterthink 81 - monsterinit 83 - monsterinitdead 84 - becomedead 85 - bestvisibleenemy 88 - finviewcone 89 - fvecinviewcone 90 - checklocalmove 91 - move 92 - moveexecute 93 - shouldadvanceroute 94 - getstoppedactivity 95 - stop 96 - checkrangeattack1 97 - checkrangeattack2 99 - checkmeleeattack1 101 - checkmeleeattack2 103 - schedulechange 111 - canplaysequence 112 - canplaysentence 113 - playsentence 114 - playscriptedsentence 115 - sentencestop 116 - getidealstate 117 - setactivity 118 - reportaistate 120 - checkenemy 121 - setyawspeed 124 - buildnearestroute 125 - findcover 126 - coverradius 131 - fcancheckattacks 132 - checkammo 134 - ignoreconditions 135 - fvalidatehinttype 136 - fcanactiveidle 137 - isoundmask 138 - hearingsensitivity 141 - barnaclevictimbitten 142 - barnaclevictimreleased 143 - preschedulethink 150 - getdeathactivity 151 - gibmonster 152 - hashumangibs 154 - hasaliengibs 155 - fademonster 156 - deathsound 159 - alertsound 160 - idlesound 161 - painsound 162 - stopfollowing 163 + look 100 + runai 101 + changeyaw 104 + monsterthink 106 + monsterinit 107 + monsterinitdead 108 + becomedead 109 + bestvisibleenemy 112 + finviewcone 113 + fvecinviewcone 114 + checklocalmove 115 + move 116 + moveexecute 117 + shouldadvanceroute 118 + getstoppedactivity 119 + stop 120 + checkrangeattack1 121 + checkrangeattack2 123 + checkmeleeattack1 125 + checkmeleeattack2 127 + schedulechange 135 + playsentence 138 + sentencestop 140 + getidealstate 141 + setactivity 142 + reportaistate 144 + checkenemy 145 + setyawspeed 148 + buildnearestroute 149 + findcover 150 + coverradius 155 + fcancheckattacks 156 + checkammo 158 + ignoreconditions 159 + fvalidatehinttype 160 + fcanactiveidle 161 + isoundmask 162 + hearingsensitivity 165 + barnaclevictimbitten 166 + barnaclevictimreleased 167 + preschedulethink 174 + getdeathactivity 175 + gibmonster 176 + hashumangibs 178 + hasaliengibs 179 + fademonster 180 + deathsound 184 + alertsound 185 + idlesound 186 + painsound 187 - player_getgunposition 157 - player_jump 179 - player_duck 180 - player_prethink 181 - player_postthink 182 - player_updateclientdata 184 - player_impulsecommands 185 + player_getgunposition 181 + player_jump 208 + player_duck 209 + player_prethink 210 + player_postthink 211 + player_updateclientdata 216 + player_impulsecommands 217 - item_addtoplayer 77 - item_addduplicate 78 - item_getiteminfo 80 - item_candeploy 81 - item_deploy 82 - item_canholster 83 - item_holster 84 - item_updateiteminfo 85 - item_preframe 86 - item_postframe 87 - item_drop 88 - item_kill 89 - item_attachtoplayer 90 - item_primaryammoindex 91 - item_secondaryammoindex 92 - item_updateclientdata 93 - item_getweaponptr 94 - item_itemslot 95 + item_holster 118 + item_updateiteminfo 119 + item_preframe 120 + item_postframe 121 + item_drop 132 + item_kill 102 + item_attachtoplayer 124 + item_primaryammoindex 126 + item_secondaryammoindex 127 + item_getweaponptr 129 + item_itemslot 130 - weapon_extractammo 96 - weapon_extractclipammo 97 - weapon_addweapon 98 - weapon_playemptysound 99 - weapon_resetemptysound 100 - weapon_sendweaponanim 101 - weapon_isusable 103 - weapon_primaryattack 104 - weapon_secondaryattack 105 - weapon_reload 107 - weapon_weaponidle 108 - weapon_retireweapon 109 - weapon_shouldweaponidle 110 - weapon_usedecrement 111 + weapon_extractammo 135 + weapon_extractclipammo 136 + weapon_resetemptysound 141 + weapon_sendweaponanim 142 + weapon_primaryattack 145 + weapon_secondaryattack 146 + weapon_reload 148 + weapon_weaponidle 151 + weapon_retireweapon 152 - sc_getclassification 9 - sc_takehealth 15 - sc_takearmor 16 - sc_giveammo 28 - sc_ismonster 43 - sc_isphysx 45 - sc_ispointentity 47 - sc_ismachine 48 - sc_criticalremove 50 - sc_updateonremove 56 - sc_fvisible 65 - sc_fvisiblefrompos 67 - sc_isfacing 68 - sc_getpointsfordamage 69 - sc_getdamagepoints 70 - sc_oncreate 73 - sc_ondestroy 74 - sc_isvalidentity 75 - sc_shouldfadeondeath 79 - sc_setupfriendly 80 - sc_revivethink 85 - sc_revive 86 - sc_startmonster 87 - sc_checkrangeattack1_move 98 - sc_checkrangeattack2_move 100 - sc_checkmeleeattack1_move 102 - sc_checkmeleeattack2_move 104 - sc_checktankusage 105 - sc_setgaitactivity 119 - sc_ftriangulate 122 - sc_ftriangulateextension 123 - sc_findcovergrenade 127 - sc_findcoverdistance 128 - sc_findattackpoint 129 - sc_fvalidatecover 130 - sc_checkattacker 133 - sc_nofriendlyfire1 144 - sc_nofriendlyfire2 145 - sc_nofriendlyfire3 146 - sc_nofriendlyfiretopos 147 - sc_fvisiblegunpos 148 - sc_finbulletcone 149 - sc_callgibmonster 153 - sc_checktimebaseddamage 157 - sc_ismoving 158 - sc_isplayerfollowing 164 - sc_startplayerfollowing 165 - sc_stopplayerfollowing 166 - sc_usesound 167 - sc_unusesound 168 - sc_ridemonster 169 - sc_checkandapplygenericattacks 170 - sc_checkscared 171 - sc_checkcreaturedanger 172 - sc_checkfalldamage 173 - sc_checkrevival 174 - sc_mediccallsound 175 + sc_prespawn 0 + sc_postspawn 2 + sc_onkeyvalueupdate 6 + sc_getclassification 12 + sc_setclassification 13 + sc_takehealth 19 + sc_takearmor 20 + sc_istriggered 24 + sc_mycustompointer 27 + sc_myitempointer 28 + sc_addpoints 30 + sc_addpointstoteam 31 + sc_removeplayeritem 33 + sc_giveammo 34 + sc_ismoving 36 + sc_oncontrols 42 + sc_issneaking 43 + sc_isalive 44 + sc_isbspmodel 45 + sc_reflectgauss 46 + sc_hastarget 47 + sc_isinworld 48 + sc_ismonster 49 + sc_isplayer 50 + sc_isnetclient 51 + sc_ispointentity 52 + sc_isbreakable 53 + sc_ismachine 54 + sc_criticalremove 56 + sc_updateonremove 62 + sc_subusetargets 64 + sc_islockedbymaster 65 + sc_fbecomeprone 67 + sc_fvisible 73 + sc_fvecvisible 74 + sc_fvisiblefrompos 75 + sc_isfacing 76 + sc_getpointsfordamage 77 + sc_getdamagepoints 78 + sc_setplayerally 79 + sc_oncreate 82 + sc_ondestroy 83 + sc_onsetoriginbymap 84 + sc_isrevivable 85 + sc_beginrevive 86 + sc_endrevive 87 + sc_shouldfadeondeath 103 + sc_setupfriendly 105 + sc_revive 110 + sc_startmonster 111 + sc_checkrangeattack1_move 122 + sc_checkrangeattack2_move 124 + sc_checkmeleeattack1_move 126 + sc_checkmeleeattack2_move 128 + sc_checktankusage 129 + sc_canplaysequence 136 + sc_canplaysentence2 137 + sc_playscriptedsentence 139 + sc_setgaitactivity 143 + sc_ftriangulate 145 + sc_ftriangulateextension 147 + sc_findcovergrenade 151 + sc_findcoverdistance 152 + sc_findattackpoint 153 + sc_fvalidatecover 154 + sc_checkattacker 157 + sc_nofriendlyfire1 168 + sc_nofriendlyfire2 169 + sc_nofriendlyfire3 170 + sc_nofriendlyfiretopos 171 + sc_fvisiblegunpos 172 + sc_finbulletcone 173 + sc_callgibmonster 177 + sc_checktimebaseddamage 182 + sc_isplayerfollowing 189 + sc_startplayerfollowing 193 + sc_stopplayerfollowing 194 + sc_usesound 196 + sc_unusesound 197 + sc_ridemonster 198 + sc_checkandapplygenericattacks 19รง + sc_checkscared 200 + sc_checkcreaturedanger 201 + sc_checkfalldamage 202 + sc_checkrevival 203 + sc_mediccallsound 206 - sc_player_menuinputperformed 176 - sc_player_ismenuinputdone 177 - sc_player_specialspawn 178 - sc_player_isconnected 182 - sc_player_isvalidinfoentity 186 - sc_player_levelend 187 - sc_player_votestarted 188 - sc_player_canstartnextvote 189 - sc_player_vote 190 - sc_player_hasvoted 191 - sc_player_resetvote 192 - sc_player_lastvoteinput 193 - sc_player_initvote 194 - sc_player_timetostartnextvote 195 - sc_player_resetview 196 - sc_player_getlogfrequency 197 - sc_player_logplayerstats 198 - sc_player_disablecollisionwithplayer 199 - sc_player_enablecollisionwithplayer 200 - sc_player_cantouchplayer 201 + sc_player_specialspawn 207 + sc_player_enteredobserver 212 + sc_player_leftobserver 213 + sc_player_isobserver 214 + sc_player_isconnected 215 + sc_player_isvalidinfoentity 218 + sc_player_levelend 219 + sc_player_votestarted 220 + sc_player_canstartnextvote 221 + sc_player_vote 222 + sc_player_hasvoted 223 + sc_player_resetvote 224 + sc_player_lastvoteinput 225 + sc_player_initvote 226 + sc_player_timetostartnextvote 227 + sc_player_resetview 228 + sc_player_getlogfrequency 229 + sc_player_logplayerstats 230 - sc_item_materialize 79 + sc_item_materialize 100 + sc_item_cancollect 105 + sc_item_collect 106 + sc_item_addtoplayer 110 + sc_item_addduplicate 111 + sc_item_addammofromitem 112 + sc_item_getpickupsound 113 + sc_item_getiteminfo 114 + sc_item_candeploy 115 + sc_item_deploy 116 + sc_item_canholster 117 + sc_item_inactiveitempreframe 122 + sc_item_inactiveitempostframe 123 + sc_item_detachfromplayer 125 + sc_item_updateclientdata 128 + sc_item_getrespawntime 131 + sc_item_canhaveduplicates 133 - sc_weapon_bulletaccuracy 102 - sc_weapon_tertiaryattack 106 - sc_weapon_burstsupplement 112 - sc_weapon_getp_model 113 - sc_weapon_getw_model 114 - sc_weapon_getv_model 115 - sc_weapon_precachecustommodels 116 - sc_weapon_ismultiplayer 117 - sc_weapon_frunfuncs 118 - sc_weapon_setfov 119 - sc_weapon_fcanrun 120 - sc_weapon_customdecrement 121 - sc_weapon_setv_model 122 - sc_weapon_setp_model 123 - sc_weapon_changeweaponskin 124 + sc_weapon_extractammofromitem 134 + sc_weapon_addweapon 137 + sc_weapon_getammo1drop 138 + sc_weapon_getammo2drop 139 + sc_weapon_playemptysound 140 + sc_weapon_bulletaccuracy 143 + sc_weapon_isusable 144 + sc_weapon_tertiaryattack 147 + sc_weapon_finishreload 149 + sc_weapon_shouldreload 150 + sc_weapon_shouldweaponidle 153 + sc_weapon_usedecrement 154 + sc_weapon_burstsupplement 155 + sc_weapon_getp_model 156 + sc_weapon_getw_model 157 + sc_weapon_getv_model 158 + sc_weapon_precachecustommodels 159 + sc_weapon_ismultiplayer 162 + sc_weapon_frunfuncs 163 + sc_weapon_setfov 164 + sc_weapon_fcanrun 165 + sc_weapon_customdecrement 166 + sc_weapon_setv_model 167 + sc_weapon_setp_model 168 + sc_weapon_changeweaponskin 169 @end -; Sven-Coop 4.8 +; Sven-Coop 5.17 @section svencoop windows pev 4 base 0x0 - spawn 0 - precache 1 - keyvalue 2 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - irelationship 10 - classify 11 - deathnotice 12 - traceattack 13 - takedamage 14 - killed 17 - bloodcolor 18 - tracebleed 19 - istriggered 20 - mymonsterpointer 21 - mysquadmonsterpointer 22 - gettogglestate 23 - addpoints 24 - addpointstoteam 25 - addplayeritem 26 - removeplayeritem 27 - getdelay 29 - ismoving 30 - overridereset 31 - damagedecal 32 - settogglestate 33 - startsneaking 34 - stopsneaking 35 - oncontrols 36 - issneaking 37 - isalive 38 - isbspmodel 39 - reflectgauss 40 - hastarget 41 - isinworld 42 - isplayer 44 - isnetclient 46 - teamid 49 - getnexttarget 51 - think 52 - touch 53 - use 54 - blocked 55 - respawn 57 - updateowner 58 - fbecomeprone 59 - center 60 - eyeposition 61 - earposition 62 - bodytarget 63 - illumination 64 - fvecvisible 65 + spawn 1 + precache 3 + keyvalue 4 + objectcaps 9 + activate 10 + setobjectcollisionbox 11 + irelationship 14 + classify 15 + deathnotice 16 + traceattack 17 + takedamage 18 + killed 21 + bloodcolor 22 + tracebleed 23 + mymonsterpointer 25 + mysquadmonsterpointer 26 + gettogglestate 29 + addplayeritem 32 + getdelay 35 + overridereset 37 + damagedecal 38 + settogglestate 39 + startsneaking 40 + stopsneaking 41 + teamid 55 + getnexttarget 57 + think 58 + touch 59 + use 60 + blocked 61 + respawn 63 + updateowner 66 + center 68 + eyeposition 69 + earposition 70 + bodytarget 71 + illumination 72 - look 76 - runai 77 - changeyaw 79 - monsterthink 80 - monsterinit 82 - monsterinitdead 83 - becomedead 84 - bestvisibleenemy 87 - finviewcone 88 - fvecinviewcone 89 - checklocalmove 90 - move 91 - moveexecute 92 - shouldadvanceroute 93 - getstoppedactivity 94 - stop 95 - checkrangeattack1 96 - checkrangeattack2 98 - checkmeleeattack1 100 - checkmeleeattack2 102 - schedulechange 110 - canplaysequence 111 - canplaysentence 112 - playsentence 113 - playscriptedsentence 114 - sentencestop 115 - getidealstate 116 - setactivity 117 - reportaistate 119 - checkenemy 120 - setyawspeed 123 - buildnearestroute 124 - findcover 125 - coverradius 130 - fcancheckattacks 131 - checkammo 133 - ignoreconditions 134 - fvalidatehinttype 135 - fcanactiveidle 136 - isoundmask 137 - hearingsensitivity 140 - barnaclevictimbitten 141 - barnaclevictimreleased 142 - preschedulethink 149 - getdeathactivity 150 - gibmonster 151 - hashumangibs 153 - hasaliengibs 154 - fademonster 155 - deathsound 158 - alertsound 159 - idlesound 160 - painsound 161 - stopfollowing 162 + look 99 + runai 100 + changeyaw 103 + monsterthink 105 + monsterinit 106 + monsterinitdead 107 + becomedead 108 + bestvisibleenemy 110 + finviewcone 113 + fvecinviewcone 112 + checklocalmove 114 + move 115 + moveexecute 116 + shouldadvanceroute 117 + getstoppedactivity 118 + stop 119 + checkrangeattack1 120 + checkrangeattack2 122 + checkmeleeattack1 124 + checkmeleeattack2 126 + schedulechange 134 + playsentence 137 + sentencestop 139 + getidealstate 140 + setactivity 141 + reportaistate 143 + checkenemy 144 + setyawspeed 147 + buildnearestroute 148 + findcover 149 + coverradius 154 + fcancheckattacks 155 + checkammo 157 + ignoreconditions 158 + fvalidatehinttype 159 + fcanactiveidle 160 + isoundmask 161 + hearingsensitivity 164 + barnaclevictimbitten 165 + barnaclevictimreleased 166 + preschedulethink 173 + getdeathactivity 174 + gibmonster 175 + hashumangibs 177 + hasaliengibs 178 + fademonster 179 + deathsound 183 + alertsound 184 + idlesound 185 + painsound 186 - player_getgunposition 156 - player_jump 178 - player_duck 179 - player_prethink 180 - player_postthink 181 - player_updateclientdata 183 - player_impulsecommands 184 + player_getgunposition 180 + player_jump 207 + player_duck 208 + player_prethink 209 + player_postthink 210 + player_updateclientdata 215 + player_impulsecommands 216 - item_addtoplayer 76 - item_addduplicate 77 - item_getiteminfo 79 - item_candeploy 80 - item_deploy 81 - item_canholster 82 - item_holster 83 - item_updateiteminfo 84 - item_preframe 85 - item_postframe 86 - item_drop 87 - item_kill 88 - item_attachtoplayer 89 - item_primaryammoindex 90 - item_secondaryammoindex 91 - item_updateclientdata 92 - item_getweaponptr 93 - item_itemslot 94 + item_holster 117 + item_updateiteminfo 118 + item_preframe 119 + item_postframe 120 + item_drop 131 + item_kill 101 + item_attachtoplayer 123 + item_primaryammoindex 125 + item_secondaryammoindex 126 + item_getweaponptr 128 + item_itemslot 129 - weapon_extractammo 95 - weapon_extractclipammo 96 - weapon_addweapon 97 - weapon_playemptysound 98 - weapon_resetemptysound 99 - weapon_sendweaponanim 100 - weapon_isusable 102 - weapon_primaryattack 103 - weapon_secondaryattack 104 - weapon_reload 106 - weapon_weaponidle 107 - weapon_retireweapon 108 - weapon_shouldweaponidle 109 - weapon_usedecrement 110 + weapon_extractammo 134 + weapon_extractclipammo 135 + weapon_resetemptysound 140 + weapon_sendweaponanim 141 + weapon_primaryattack 144 + weapon_secondaryattack 145 + weapon_reload 147 + weapon_weaponidle 150 + weapon_retireweapon 151 - sc_getclassification 9 - sc_takehealth 15 - sc_takearmor 16 - sc_giveammo 28 - sc_ismonster 43 - sc_isphysx 45 - sc_ispointentity 47 - sc_ismachine 48 - sc_criticalremove 50 - sc_updateonremove 56 - sc_fvisible 66 - sc_fvisiblefrompos 67 - sc_isfacing 68 - sc_getpointsfordamage 69 - sc_getdamagepoints 70 - sc_oncreate 72 - sc_ondestroy 73 - sc_isvalidentity 74 - sc_shouldfadeondeath 78 - sc_setupfriendly 79 - sc_revivethink 84 - sc_revive 85 - sc_startmonster 86 - sc_checkrangeattack1_move 97 - sc_checkrangeattack2_move 99 - sc_checkmeleeattack1_move 101 - sc_checkmeleeattack2_move 103 - sc_checktankusage 104 - sc_setgaitactivity 118 - sc_ftriangulate 121 - sc_ftriangulateextension 122 - sc_findcovergrenade 126 - sc_findcoverdistance 127 - sc_findattackpoint 128 - sc_fvalidatecover 129 - sc_checkattacker 132 - sc_nofriendlyfire1 145 - sc_nofriendlyfire2 144 - sc_nofriendlyfire3 143 - sc_nofriendlyfiretopos 146 - sc_fvisiblegunpos 147 - sc_finbulletcone 148 - sc_callgibmonster 152 - sc_checktimebaseddamage 156 - sc_ismoving 157 - sc_isplayerfollowing 163 - sc_startplayerfollowing 164 - sc_stopplayerfollowing 165 - sc_usesound 166 - sc_unusesound 167 - sc_ridemonster 168 - sc_checkandapplygenericattacks 169 - sc_checkscared 170 - sc_checkcreaturedanger 171 - sc_checkfalldamage 172 - sc_checkrevival 173 - sc_mediccallsound 174 + sc_prespawn 0 + sc_postspawn 2 + sc_onkeyvalueupdate 6 + sc_getclassification 12 + sc_setclassification 13 + sc_takehealth 19 + sc_takearmor 20 + sc_istriggered 24 + sc_mycustompointer 27 + sc_myitempointer 28 + sc_addpoints 30 + sc_addpointstoteam 31 + sc_removeplayeritem 33 + sc_giveammo 34 + sc_ismoving 36 + sc_oncontrols 42 + sc_issneaking 43 + sc_isalive 44 + sc_isbspmodel 45 + sc_reflectgauss 46 + sc_hastarget 47 + sc_isinworld 48 + sc_ismonster 49 + sc_isplayer 50 + sc_isnetclient 51 + sc_ispointentity 52 + sc_isbreakable 53 + sc_ismachine 54 + sc_criticalremove 56 + sc_updateonremove 62 + sc_subusetargets 64 + sc_islockedbymaster 65 + sc_fbecomeprone 67 + sc_fvecvisible 73 + sc_fvisible 74 + sc_fvisiblefrompos 75 + sc_isfacing 76 + sc_getpointsfordamage 77 + sc_getdamagepoints 78 + sc_setplayerally 79 + sc_oncreate 81 + sc_ondestroy 82 + sc_onsetoriginbymap 83 + sc_isrevivable 84 + sc_beginrevive 85 + sc_endrevive 86 + sc_shouldfadeondeath 102 + sc_setupfriendly 104 + sc_revive 109 + sc_startmonster 110 + sc_checkrangeattack1_move 121 + sc_checkrangeattack2_move 123 + sc_checkmeleeattack1_move 125 + sc_checkmeleeattack2_move 127 + sc_checktankusage 128 + sc_canplaysequence 135 + sc_canplaysentence2 136 + sc_playscriptedsentence 138 + sc_setgaitactivity 142 + sc_ftriangulate 145 + sc_ftriangulateextension 146 + sc_findcovergrenade 150 + sc_findcoverdistance 151 + sc_findattackpoint 152 + sc_fvalidatecover 153 + sc_checkattacker 156 + sc_nofriendlyfire1 169 + sc_nofriendlyfire2 168 + sc_nofriendlyfire3 167 + sc_nofriendlyfiretopos 170 + sc_fvisiblegunpos 171 + sc_finbulletcone 172 + sc_callgibmonster 176 + sc_checktimebaseddamage 181 + sc_isplayerfollowing 188 + sc_startplayerfollowing 192 + sc_stopplayerfollowing 193 + sc_usesound 195 + sc_unusesound 196 + sc_ridemonster 197 + sc_checkandapplygenericattacks 198 + sc_checkscared 199 + sc_checkcreaturedanger 200 + sc_checkfalldamage 201 + sc_checkrevival 202 + sc_mediccallsound 205 - sc_player_menuinputperformed 175 - sc_player_ismenuinputdone 176 - sc_player_specialspawn 177 - sc_player_isconnected 181 - sc_player_isvalidinfoentity 185 - sc_player_levelend 186 - sc_player_votestarted 187 - sc_player_canstartnextvote 188 - sc_player_vote 189 - sc_player_hasvoted 190 - sc_player_resetvote 191 - sc_player_lastvoteinput 192 - sc_player_initvote 193 - sc_player_timetostartnextvote 194 - sc_player_resetview 195 - sc_player_getlogfrequency 196 - sc_player_logplayerstats 197 - sc_player_disablecollisionwithplayer 198 - sc_player_enablecollisionwithplayer 199 - sc_player_cantouchplayer 200 + sc_player_specialspawn 206 + sc_player_enteredobserver 211 + sc_player_leftobserver 212 + sc_player_isobserver 213 + sc_player_isconnected 214 + sc_player_isvalidinfoentity 217 + sc_player_levelend 218 + sc_player_votestarted 219 + sc_player_canstartnextvote 220 + sc_player_vote 221 + sc_player_hasvoted 222 + sc_player_resetvote 223 + sc_player_lastvoteinput 224 + sc_player_initvote 225 + sc_player_timetostartnextvote 226 + sc_player_resetview 227 + sc_player_getlogfrequency 228 + sc_player_logplayerstats 229 - sc_item_materialize 78 + sc_item_materialize 99 + sc_item_cancollect 104 + sc_item_collect 105 + sc_item_addtoplayer 109 + sc_item_addduplicate 110 + sc_item_addammofromitem 111 + sc_item_getpickupsound 112 + sc_item_getiteminfo 113 + sc_item_candeploy 114 + sc_item_deploy 115 + sc_item_canholster 116 + sc_item_inactiveitempreframe 121 + sc_item_inactiveitempostframe 122 + sc_item_detachfromplayer 125 + sc_item_updateclientdata 127 + sc_item_getrespawntime 130 + sc_item_canhaveduplicates 132 - sc_weapon_bulletaccuracy 101 - sc_weapon_tertiaryattack 105 - sc_weapon_burstsupplement 111 - sc_weapon_getp_model 112 - sc_weapon_getw_model 113 - sc_weapon_getv_model 114 - sc_weapon_precachecustommodels 115 - sc_weapon_ismultiplayer 116 - sc_weapon_frunfuncs 117 - sc_weapon_setfov 118 - sc_weapon_fcanrun 119 - sc_weapon_customdecrement 120 - sc_weapon_setv_model 121 - sc_weapon_setp_model 122 - sc_weapon_changeweaponskin 123 + sc_weapon_extractammofromitem 133 + sc_weapon_addweapon 136 + sc_weapon_getammo1drop 137 + sc_weapon_getammo2drop 138 + sc_weapon_playemptysound 139 + sc_weapon_bulletaccuracy 142 + sc_weapon_isusable 143 + sc_weapon_tertiaryattack 146 + sc_weapon_finishreload 148 + sc_weapon_shouldreload 149 + sc_weapon_shouldweaponidle 152 + sc_weapon_usedecrement 153 + sc_weapon_burstsupplement 154 + sc_weapon_getp_model 155 + sc_weapon_getw_model 156 + sc_weapon_getv_model 157 + sc_weapon_precachecustommodels 158 + sc_weapon_ismultiplayer 161 + sc_weapon_frunfuncs 162 + sc_weapon_setfov 163 + sc_weapon_fcanrun 164 + sc_weapon_customdecrement 165 + sc_weapon_setv_model 166 + sc_weapon_setp_model 167 + sc_weapon_changeweaponskin 168 @end ; Earth's Special Forces 1.2.3 @@ -2660,7 +2703,7 @@ checkmeleeattack2 81 schedulechange 87 canplaysequence 88 - canplaysentence 89 + canplaysentence2 89 playsentence 90 playscriptedsentence 91 sentencestop 92 @@ -2817,7 +2860,7 @@ checkmeleeattack2 79 schedulechange 85 canplaysequence 86 - canplaysentence 87 + canplaysentence2 87 playsentence 88 playscriptedsentence 89 sentencestop 90 @@ -2975,7 +3018,7 @@ checkmeleeattack2 85 schedulechange 91 canplaysequence 92 - canplaysentence 93 + canplaysentence2 93 playsentence 94 playscriptedsentence 95 sentencestop 96 @@ -3214,7 +3257,7 @@ checkmeleeattack2 85 schedulechange 91 canplaysequence 92 - canplaysentence 93 + canplaysentence2 93 playsentence 94 playscriptedsentence 95 sentencestop 96 @@ -3454,7 +3497,7 @@ checkmeleeattack2 80 schedulechange 86 canplaysequence 87 - canplaysentence 88 + canplaysentence2 88 playsentence 89 playscriptedsentence 90 sentencestop 91 @@ -3615,7 +3658,7 @@ checkmeleeattack2 80 schedulechange 86 canplaysequence 87 - canplaysentence 88 + canplaysentence2 88 playsentence 89 playscriptedsentence 90 sentencestop 91 @@ -3777,7 +3820,7 @@ checkmeleeattack2 80 schedulechange 86 canplaysequence 87 - canplaysentence 88 + canplaysentence2 88 playsentence 89 playscriptedsentence 90 sentencestop 91 @@ -3939,7 +3982,7 @@ checkmeleeattack2 82 schedulechange 88 canplaysequence 89 - canplaysentence 90 + canplaysentence2 90 playsentence 91 playscriptedsentence 92 sentencestop 93 @@ -4104,7 +4147,7 @@ checkmeleeattack2 82 schedulechange 88 canplaysequence 89 - canplaysentence 90 + canplaysentence2 90 playsentence 91 playscriptedsentence 92 sentencestop 93 @@ -4269,7 +4312,7 @@ checkmeleeattack2 82 schedulechange 88 canplaysequence 89 - canplaysentence 90 + canplaysentence2 90 playsentence 91 playscriptedsentence 92 sentencestop 93 @@ -4434,7 +4477,7 @@ checkmeleeattack2 84 schedulechange 90 canplaysequence 91 - canplaysentence 92 + canplaysentence2 92 playsentence 93 playscriptedsentence 94 sentencestop 95 @@ -4596,7 +4639,7 @@ checkmeleeattack2 82 schedulechange 88 canplaysequence 89 - canplaysentence 90 + canplaysentence2 90 playsentence 91 playscriptedsentence 92 sentencestop 93 diff --git a/modules/hamsandwich/amxx_api.cpp b/modules/hamsandwich/amxx_api.cpp index fc11c972..0cd66d3a 100644 --- a/modules/hamsandwich/amxx_api.cpp +++ b/modules/hamsandwich/amxx_api.cpp @@ -63,6 +63,10 @@ void OnAmxxAttach(void) assert(strcmp(hooklist[Ham_SC_Weapon_ChangeWeaponSkin].name, "sc_weapon_changeweaponskin")==0); assert(strcmp(hooklist[Ham_Item_GetItemInfo].name, "item_getiteminfo") == 0); + assert(strcmp(hooklist[Ham_SC_Item_AddToPlayer].name, "sc_item_addtoplayer") == 0); + assert(strcmp(hooklist[Ham_SC_Weapon_ExtractAmmoFromItem].name, "sc_weapon_extractammofromitem") == 0); + assert(strcmp(hooklist[Ham_SC_Player_EnteredObserver].name, "sc_player_enteredobserver") == 0); + MF_AddNatives(pdata_natives_safe); if (ReadConfig() > 0) diff --git a/modules/hamsandwich/call_funcs.cpp b/modules/hamsandwich/call_funcs.cpp index f180573a..d3ed798f 100644 --- a/modules/hamsandwich/call_funcs.cpp +++ b/modules/hamsandwich/call_funcs.cpp @@ -173,7 +173,22 @@ cell Call_Int_Float_Int_Int(AMX *amx, cell *params) return reinterpret_cast(__func)(pv, f3, i4, i5); #endif } - + +cell Call_Bool_Float_Int_Int(AMX *amx, cell *params) +{ + SETUP(3); + + float f3 = amx_ctof(*MF_GetAmxAddr(amx, params[3])); + int i4 = *MF_GetAmxAddr(amx, params[4]); + int i5 = *MF_GetAmxAddr(amx, params[5]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, f3, i4, i5) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, f3, i4, i5) ? TRUE : FALSE; +#endif +} + cell Call_Void_Entvar_Int(AMX *amx, cell *params) { SETUP(2); @@ -248,6 +263,36 @@ cell Call_Void_Int_Int(AMX *amx, cell *params) return 1; } +cell Call_Void_Int_Bool(AMX *amx, cell *params) +{ + SETUP(2); + + int i3 = *MF_GetAmxAddr(amx, params[3]); + bool i4 = *MF_GetAmxAddr(amx, params[4]) != 0; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, i3, i4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, i3, i4); +#endif + return 1; +} + +cell Call_Void_Bool_Bool(AMX *amx, cell *params) +{ + SETUP(2); + + bool i3 = *MF_GetAmxAddr(amx, params[3]) != 0; + bool i4 = *MF_GetAmxAddr(amx, params[4]) != 0; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, i3, i4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, i3, i4); +#endif + return 1; +} + cell Call_Int_Int_Str_Int(AMX *amx, cell *params) { SETUP(3); @@ -279,6 +324,22 @@ cell Call_Int_Int_Str_Int_Int(AMX *amx, cell *params) #endif } +cell Call_Int_Int_Str_Int_Bool(AMX *amx, cell *params) +{ + SETUP(4); + + int i3 = *MF_GetAmxAddr(amx, params[3]); + char *sz4 = MF_GetAmxString(amx, params[4], 0, NULL); + int i5 = *MF_GetAmxAddr(amx, params[5]); + bool i6 = *MF_GetAmxAddr(amx, params[6]) != 0; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3, sz4, i5, i6); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3, sz4, i5, i6); +#endif +} + cell Call_Int_Int(AMX *amx, cell *params) { SETUP(1); @@ -292,6 +353,19 @@ cell Call_Int_Int(AMX *amx, cell *params) #endif } +cell Call_Bool_Bool(AMX *amx, cell *params) +{ + SETUP(1); + + bool i3 = *MF_GetAmxAddr(amx, params[3]) != 0; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3) ? TRUE : FALSE; +#endif +} + cell Call_Int_Entvar(AMX *amx, cell *params) { SETUP(1); @@ -591,6 +665,29 @@ cell Call_Int_pVector(AMX *amx, cell *params) return ret; } +cell Call_Bool_pVector(AMX *amx, cell *params) +{ + SETUP(1); + + Vector v3; + float *fl3 = (float *)MF_GetAmxAddr(amx, params[3]); + v3.x = fl3[0]; + v3.y = fl3[1]; + v3.z = fl3[2]; + +#if defined(_WIN32) + bool ret = reinterpret_cast(__func)(pv, 0, &v3); +#elif defined(__linux__) || defined(__APPLE__) + bool ret = reinterpret_cast(__func)(pv, &v3); +#endif + + fl3[0] = v3.x; + fl3[1] = v3.y; + fl3[2] = v3.z; + + return ret ? TRUE : FALSE; +} + cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params) { SETUP(3); @@ -683,6 +780,24 @@ cell Call_Int_ItemInfo(AMX *amx, cell *params) #endif } +cell Call_Bool_ItemInfo(AMX *amx, cell *params) +{ + SETUP(1); + + void *ptr = reinterpret_cast(*MF_GetAmxAddr(amx, params[3])); + + if (!ptr) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle!"); + return 0; + } +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ptr) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ptr) ? TRUE : FALSE; +#endif +} + cell Call_Float_Void(AMX *amx, cell *params) { SETUP(1); @@ -844,6 +959,34 @@ cell Call_Int_Int_Int(AMX *amx, cell *params) #endif } +cell Call_Bool_Bool_Int(AMX *amx, cell *params) +{ + SETUP(2); + + bool i3 = *MF_GetAmxAddr(amx, params[3]) != 0; + int i4 = *MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3, i4) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3, i4) ? TRUE : FALSE; +#endif +} + +cell Call_Int_Bool_Int(AMX *amx, cell *params) +{ + SETUP(2); + + bool i3 = *MF_GetAmxAddr(amx, params[3]) != 0; + int i4 = *MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3, i4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3, i4); +#endif +} + cell Call_Void_Str_Float_Float_Float(AMX *amx, cell *params) { SETUP(4); @@ -886,6 +1029,30 @@ cell Call_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, cell *params) return 1; } +cell Call_Void_Str_Float_Float_Float_Bool_Cbase(AMX *amx, cell *params) +{ + SETUP(6); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + float f4=amx_ctof(*MF_GetAmxAddr(amx, params[4])); + float f5=amx_ctof(*MF_GetAmxAddr(amx, params[5])); + float f6=amx_ctof(*MF_GetAmxAddr(amx, params[6])); + bool i7=*MF_GetAmxAddr(amx, params[7]) != 0; + int id8=*MF_GetAmxAddr(amx, params[8]); + + CHECK_ENTITY(id8); + + void *p8 = TypeConversion.id_to_cbase(id8); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, sz3, f4, f5, f6, i7, p8); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, sz3, f4, f5, f6, i7, p8); +#endif + + return 1; +} + cell Call_Int_Vector_Vector_Float_Float(AMX *amx, cell *params) { SETUP(4); @@ -1143,6 +1310,24 @@ cell Call_Void_Str_Int(AMX *amx, cell *params) return 1; } +cell Call_Bool_Cbase_Int(AMX *amx, cell *params) +{ + SETUP(2); + + int id3 = *MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + void *p8 = TypeConversion.id_to_cbase(id3); + + int i4 = *MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, p8, i4) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, p8, i4) ? TRUE : FALSE; +#endif +} + cell Call_Void_Cbase_Int(AMX *amx, cell *params) { SETUP(2); @@ -1163,6 +1348,27 @@ cell Call_Void_Cbase_Int(AMX *amx, cell *params) return 1; } +cell Call_Void_Cbase_Int_Float(AMX *amx, cell *params) +{ + SETUP(3); + + int id3 = *MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + void *p8 = TypeConversion.id_to_cbase(id3); + + int i4 = *MF_GetAmxAddr(amx, params[4]); + float f5 = amx_ctof(*MF_GetAmxAddr(amx, params[5])); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, p8, i4, f5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, p8, i4, f5); +#endif + + return 1; +} + cell Call_Void_Str(AMX *amx, cell *params) { SETUP(1); @@ -1401,7 +1607,7 @@ cell Call_Int_Cbase_Bool(AMX *amx, cell *params) void *pv1 = TypeConversion.id_to_cbase(id3); - bool b4=*MF_GetAmxAddr(amx, params[4]) ? true : false; + bool b4= *MF_GetAmxAddr(amx, params[4]) != 0; #if defined(_WIN32) return reinterpret_cast(__func)(pv, 0, pv1, b4); @@ -1410,6 +1616,25 @@ cell Call_Int_Cbase_Bool(AMX *amx, cell *params) #endif } +cell Call_Bool_Cbase_Bool(AMX *amx, cell *params) +{ + SETUP(2); + + int id3 = *MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + void *pv1 = TypeConversion.id_to_cbase(id3); + + bool b4 = *MF_GetAmxAddr(amx, params[4]) != 0; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, pv1, b4) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, pv1, b4) ? TRUE : FALSE; +#endif +} + cell Call_Int_Vector_Vector(AMX *amx, cell *params) { SETUP(2); @@ -1434,6 +1659,54 @@ cell Call_Int_Vector_Vector(AMX *amx, cell *params) #endif } +cell Call_Int_pVector_pVector(AMX *amx, cell *params) +{ + SETUP(2); + + Vector v3; + Vector v4; + + float *fl3 = (float *)MF_GetAmxAddr(amx, params[3]); + v3.x = fl3[0]; + v3.y = fl3[1]; + v3.z = fl3[2]; + + float *fl4 = (float *)MF_GetAmxAddr(amx, params[4]); + v4.x = fl4[0]; + v4.y = fl4[1]; + v4.z = fl4[2]; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, &v3, &v4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, &v3, &v4); +#endif +} + +cell Call_Bool_pVector_pVector(AMX *amx, cell *params) +{ + SETUP(2); + + Vector v3; + Vector v4; + + float *fl3 = (float *)MF_GetAmxAddr(amx, params[3]); + v3.x = fl3[0]; + v3.y = fl3[1]; + v3.z = fl3[2]; + + float *fl4 = (float *)MF_GetAmxAddr(amx, params[4]); + v4.x = fl4[0]; + v4.y = fl4[1]; + v4.z = fl4[2]; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, &v3, &v4) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, &v3, &v4) ? TRUE : FALSE; +#endif +} + cell Call_Int_Entvar_Float(AMX *amx, cell *params) { SETUP(2); @@ -1453,6 +1726,25 @@ cell Call_Int_Entvar_Float(AMX *amx, cell *params) #endif } +cell Call_Bool_Entvar_Float(AMX *amx, cell *params) +{ + SETUP(2); + + int id3 = *MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + entvars_t *ev3 = TypeConversion.id_to_entvars(id3); + + float f4 = amx_ctof(*MF_GetAmxAddr(amx, params[4])); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3, f4) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3, f4) ? TRUE : FALSE; +#endif +} + cell Call_Float_Float(AMX *amx, cell *params) { SETUP(2); @@ -1497,9 +1789,9 @@ cell Call_Bool_Void(AMX *amx, cell *params) SETUP(0); #if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0); + return reinterpret_cast(__func)(pv, 0) ? TRUE : FALSE; #elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv); + return reinterpret_cast(__func)(pv) ? TRUE : FALSE; #endif } @@ -1665,9 +1957,9 @@ cell Call_Bool_Cbase(AMX *amx, cell *params) void *pv1 = TypeConversion.id_to_cbase(id3); #if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, pv1); + return reinterpret_cast(__func)(pv, 0, pv1) ? TRUE : FALSE; #elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, pv1); + return reinterpret_cast(__func)(pv, pv1) ? TRUE : FALSE; #endif } @@ -1678,9 +1970,24 @@ cell Call_Bool_Int(AMX *amx, cell *params) int id3=*MF_GetAmxAddr(amx, params[3]); #if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, id3); + return reinterpret_cast(__func)(pv, 0, id3) ? TRUE : FALSE; #elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, id3); + return reinterpret_cast(__func)(pv, id3) ? TRUE : FALSE; +#endif +} + +cell Call_Bool_Entvar(AMX *amx, cell *params) +{ + SETUP(1); + + int id3 = *MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + entvars_t *ev3 = TypeConversion.id_to_entvars(id3); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3) ? TRUE : FALSE; +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3) ? TRUE : FALSE; #endif } @@ -1711,7 +2018,7 @@ cell Call_Void_Cbase_Bool(AMX *amx, cell *params) CHECK_ENTITY(id3); void *p8 = TypeConversion.id_to_cbase(id3); - bool b4 = *MF_GetAmxAddr(amx, params[4]) ? true : false; + bool b4 = *MF_GetAmxAddr(amx, params[4]) != 0; #if defined(_WIN32) reinterpret_cast(__func)(pv, 0, p8, b4); diff --git a/modules/hamsandwich/call_funcs.h b/modules/hamsandwich/call_funcs.h index 0b492a9c..b252632f 100644 --- a/modules/hamsandwich/call_funcs.h +++ b/modules/hamsandwich/call_funcs.h @@ -27,6 +27,8 @@ cell Call_Int_Float_Int(AMX *amx, cell *params); cell Call_Int_Float_Int_Int(AMX *amx, cell *params); +cell Call_Bool_Float_Int_Int(AMX *amx, cell *params); + cell Call_Void_Entvar_Int(AMX *amx, cell *params); cell Call_Void_Entvar_Entvar_Int(AMX *amx, cell *params); @@ -35,12 +37,20 @@ cell Call_Int_Cbase(AMX *amx, cell *params); cell Call_Void_Int_Int(AMX *amx, cell *params); +cell Call_Void_Int_Bool(AMX *amx, cell *params); + +cell Call_Void_Bool_Bool(AMX *amx, cell *params); + cell Call_Int_Int_Str_Int(AMX *amx, cell *params); cell Call_Int_Int_Str_Int_Int(AMX *amx, cell *params); +cell Call_Int_Int_Str_Int_Bool(AMX *amx, cell *params); + cell Call_Int_Int(AMX *amx, cell *params); +cell Call_Bool_Bool(AMX *amx, cell *params); + cell Call_Int_Entvar(AMX *amx, cell *params); cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params); @@ -67,6 +77,8 @@ cell Call_Vector_pVector(AMX *amx, cell *params); cell Call_Int_pVector(AMX *amx, cell *params); +cell Call_Bool_pVector(AMX *amx, cell *params); + cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params); cell Call_Void_pFloat_pFloat(AMX *amx, cell *params); @@ -77,6 +89,8 @@ cell Call_Void_Int_Int_Int(AMX *amx, cell *params); cell Call_Int_ItemInfo(AMX *amx, cell *params); +cell Call_Bool_ItemInfo(AMX *amx, cell *params); + cell Call_Float_Void(AMX *amx, cell *params); cell Call_Void_Float_Int(AMX* amx, cell* params); @@ -99,10 +113,14 @@ cell Call_Int_Float(AMX *amx, cell *params); cell Call_Int_Int_Int(AMX *amx, cell *params); +cell Call_Bool_Bool_Int(AMX *amx, cell *params); + cell Call_Void_Str_Float_Float_Float(AMX *amx, cell *params); cell Call_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, cell *params); +cell Call_Void_Str_Float_Float_Float_Bool_Cbase(AMX *amx, cell *params); + cell Call_Int_Vector_Vector_Float_Float(AMX *amx, cell *params); cell Call_Int_Short(AMX *amx, cell *params); @@ -129,8 +147,12 @@ cell Call_Int_Int_Int_Float_Int(AMX* amx, cell* params); cell Call_Void_Str_Int(AMX* amx, cell* params); +cell Call_Bool_Cbase_Int(AMX* amx, cell* params); + cell Call_Void_Cbase_Int(AMX* amx, cell* params); +cell Call_Void_Cbase_Int_Float(AMX* amx, cell* params); + cell Call_Void_Str(AMX* amx, cell* params); cell Call_Void_Vector(AMX* amx, cell* params); @@ -151,10 +173,18 @@ cell Call_Int_pVector_pVector_Float_Cbase_pVector(AMX* amx, cell* params); cell Call_Int_Cbase_Bool(AMX* amx, cell* params); +cell Call_Bool_Cbase_Bool(AMX* amx, cell* params); + cell Call_Int_Vector_Vector(AMX *amx, cell *params); +cell Call_Int_pVector_pVector(AMX *amx, cell *params); + +cell Call_Bool_pVector_pVector(AMX *amx, cell *params); + cell Call_Int_Entvar_Float(AMX *amx, cell *params); +cell Call_Bool_Entvar_Float(AMX *amx, cell *params); + cell Call_Float_Float(AMX* amx, cell* params); cell Call_Void_Entvar_Entvar_Float(AMX *amx, cell *params); @@ -173,6 +203,8 @@ cell Call_Void_Bool(AMX *amx, cell *params); cell Call_Bool_Cbase(AMX *amx, cell *params); +cell Call_Bool_Entvar(AMX *amx, cell *params); + cell Call_Bool_Int(AMX *amx, cell *params); cell Call_Void_Cbase_Float(AMX* amx, cell* params); diff --git a/modules/hamsandwich/ham_const.h b/modules/hamsandwich/ham_const.h index e196dd7c..ee6ca006 100644 --- a/modules/hamsandwich/ham_const.h +++ b/modules/hamsandwich/ham_const.h @@ -203,7 +203,7 @@ enum Ham_CheckMeleeAttack2, Ham_ScheduleChange, Ham_CanPlaySequence, - Ham_CanPlaySentence, + Ham_CanPlaySentence2, Ham_PlaySentence, Ham_PlayScriptedSentence, Ham_SentenceStop, @@ -484,6 +484,72 @@ enum Ham_Item_GetItemInfo, + // + // New addition - 20117 + // + + Ham_SC_PreSpawn, + Ham_SC_PostSpawn, + Ham_SC_OnKeyValueUpdate, + Ham_SC_SetClassification, + Ham_SC_IsTriggered, + Ham_SC_MyCustomPointer, + Ham_SC_MyItemPointer, + Ham_SC_AddPoints, + Ham_SC_AddPointsToTeam, + Ham_SC_RemovePlayerItem, + Ham_SC_OnControls, + Ham_SC_IsSneaking, + Ham_SC_IsAlive, + Ham_SC_IsBSPModel, + Ham_SC_ReflectGauss, + Ham_SC_HasTarget, + Ham_SC_IsInWorld, + Ham_SC_IsPlayer, + Ham_SC_IsNetClient, + Ham_SC_IsBreakable, + Ham_SC_SUB_UseTargets, + Ham_SC_IsLockedByMaster, + Ham_SC_FBecomeProne, + Ham_SC_FVecVisible, + Ham_SC_SetPlayerAlly, + Ham_SC_OnSetOriginByMap, + Ham_SC_IsRevivable, + Ham_SC_BeginRevive, + Ham_SC_EndRevive, + Ham_SC_CanPlaySequence, + Ham_SC_CanPlaySentence2, + Ham_SC_PlayScriptedSentence, + Ham_SC_Item_AddToPlayer, + Ham_SC_Item_AddDuplicate, + Ham_SC_Item_AddAmmoFromItem, + Ham_SC_Item_GetPickupSound, + Ham_SC_Item_CanCollect, + Ham_SC_Item_Collect, + Ham_SC_Item_GetItemInfo, + Ham_SC_Item_CanDeploy, + Ham_SC_Item_Deploy, + Ham_SC_Item_CanHolster, + Ham_SC_Item_InactiveItemPreFrame, + Ham_SC_Item_InactiveItemPostFrame, + Ham_SC_Item_DetachFromPlayer, + Ham_SC_Item_UpdateClientData, + Ham_SC_Item_GetRespawnTime, + Ham_SC_Item_CanHaveDuplicates, + Ham_SC_Weapon_ExtractAmmoFromItem, + Ham_SC_Weapon_AddWeapon, + Ham_SC_Weapon_GetAmmo1Drop, + Ham_SC_Weapon_GetAmmo2Drop, + Ham_SC_Weapon_PlayEmptySound, + Ham_SC_Weapon_IsUsable, + Ham_SC_Weapon_FinishReload, + Ham_SC_Weapon_ShouldReload, + Ham_SC_Weapon_ShouldWeaponIdle, + Ham_SC_Weapon_UseDecrement, + Ham_SC_Player_EnteredObserver, + Ham_SC_Player_LeftObserver, + Ham_SC_Player_IsObserver, + HAM_LAST_ENTRY_DONT_USE_ME_LOL }; @@ -493,7 +559,8 @@ enum HAM_INVALID_FUNC, // The function is not valid HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini - + HAM_FUNC_NOT_AVAILABLE, // This function is not more available in the mod + HAM_ERR_END }; diff --git a/modules/hamsandwich/ham_utils.h b/modules/hamsandwich/ham_utils.h index a30f415f..82877a97 100644 --- a/modules/hamsandwich/ham_utils.h +++ b/modules/hamsandwich/ham_utils.h @@ -24,7 +24,12 @@ extern HLTypeConversion TypeConversion; if (x < 0 || x >= HAM_LAST_ENTRY_DONT_USE_ME_LOL) { \ char msg[1024]; \ ke::SafeSprintf(msg, sizeof(msg), "Function out of bounds. Got: %d Max: %d", x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \ - FailPlugin(amx, x, HAM_INVALID_FUNC, msg); \ + FailPlugin(amx, x, HAM_INVALID_FUNC, msg); \ + return 0; \ + } else if (hooklist[x].isremoved) { \ + char msg[1024]; \ + ke::SafeSprintf(msg, sizeof(msg), "Function %s is no more available in the mod.", hooklist[x].name); \ + FailPlugin(amx, x, HAM_FUNC_NOT_AVAILABLE, msg); \ return 0; \ } else if (hooklist[x].isset == 0) { \ char msg[1024]; \ @@ -34,6 +39,8 @@ extern HLTypeConversion TypeConversion; } + + #define CHECK_ENTITY(x) \ if (x < 0 || x > gpGlobals->maxEntities) { \ MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ diff --git a/modules/hamsandwich/hook_callbacks.cpp b/modules/hamsandwich/hook_callbacks.cpp index 59588adf..9ba1dab9 100644 --- a/modules/hamsandwich/hook_callbacks.cpp +++ b/modules/hamsandwich/hook_callbacks.cpp @@ -313,6 +313,39 @@ int Hook_Int_Float_Int_Int(Hook *hook, void *pthis, float f1, int i1, int i2) return ret; } +bool Hook_Bool_Float_Int_Int(Hook *hook, void *pthis, float f1, int i1, int i2) +{ + bool ret = false; + bool origret = false; + + PUSH_BOOL() + + MAKE_VECTOR() + + P_FLOAT(f1) + P_INT(i1) + P_INT(i2) + + PRE_START() + , f1, i1, i2 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, f1, i1, i2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, f1, i1, i2); +#endif + + POST_START() + , f1, i1, i2 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} void Hook_Void_Entvar_Int(Hook *hook, void *pthis, entvars_t *ev1, int i1) { PUSH_VOID() @@ -429,6 +462,58 @@ void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2) POP() } +void Hook_Void_Int_Bool(Hook *hook, void *pthis, int i1, bool i2) +{ + PUSH_VOID() + + MAKE_VECTOR() + + P_INT(i1) + P_BOOL(i2) + + PRE_START() + , i1, i2 + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, i1, i2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, i1, i2); +#endif + + POST_START() + , i1, i2 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Bool_Bool(Hook *hook, void *pthis, bool i1, bool i2) +{ + PUSH_VOID() + + MAKE_VECTOR() + + P_BOOL(i1) + P_BOOL(i2) + + PRE_START() + , i1, i2 + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, i1, i2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, i1, i2); +#endif + + POST_START() + , i1, i2 + POST_END() + + KILL_VECTOR() + POP() +} + int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i2) { int ret=0; @@ -500,6 +585,42 @@ int Hook_Int_Int_Str_Int_Int(Hook *hook, void *pthis, int i1, const char *sz1, i return ret; } +int Hook_Int_Int_Str_Int_Bool(Hook *hook, void *pthis, int i1, const char *sz1, int i2, bool i3) +{ + int ret = 0; + int origret = 0; + ke::AString a; + + PUSH_INT() + + a = sz1; + + MAKE_VECTOR() + + P_INT(i1) + P_STR(a) + P_INT(i2) + P_BOOL(i3) + + PRE_START() + , i1, a.chars(), i2, i3 + PRE_END() +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, i1, a.chars(), i2, i3); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, i1, a.chars(), i2, i3); +#endif + + POST_START() + , i1, a.chars(), i2, i3 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + int Hook_Int_Int(Hook *hook, void *pthis, int i1) { int ret=0; @@ -531,6 +652,38 @@ int Hook_Int_Int(Hook *hook, void *pthis, int i1) return ret; } +bool Hook_Bool_Bool(Hook *hook, void *pthis, bool i1) +{ + bool ret = false; + bool origret = false; + + PUSH_BOOL() + MAKE_VECTOR() + + P_BOOL(i1) + + PRE_START() + ,i1 + PRE_END() + +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, i1); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, i1); +#endif + + POST_START() + ,i1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + + int Hook_Int_Entvar(Hook *hook, void *pthis, entvars_t *ev1) { int ret=0; @@ -973,6 +1126,36 @@ int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1) return ret; } +bool Hook_Bool_pVector(Hook *hook, void *pthis, Vector *v1) +{ + bool ret = false; + bool origret = false; + + PUSH_BOOL() + + MAKE_VECTOR() + P_PTRVECTOR(v1) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + PRE_END() + +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, v1); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, v1); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + void Hook_Void_Entvar_Float_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1, float f2) { PUSH_VOID() @@ -1080,6 +1263,7 @@ void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3) KILL_VECTOR() POP() } + int Hook_Int_ItemInfo(Hook *hook, void *pthis, void *iteminfo) { int ret = 0; @@ -1111,6 +1295,38 @@ int Hook_Int_ItemInfo(Hook *hook, void *pthis, void *iteminfo) return ret; } +bool Hook_Bool_ItemInfo(Hook *hook, void *pthis, void *iteminfo) +{ + bool ret = false; + bool origret = false; + + PUSH_BOOL() + + MAKE_VECTOR() + + P_ITEMINFO(iteminfo) + + PRE_START() + ,iteminfo + PRE_END() +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, iteminfo); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, iteminfo); +#endif + + POST_START() + ,iteminfo + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + + return ret; +} + float Hook_Float_Void(Hook *hook, void *pthis) { float ret=0.0; @@ -1410,6 +1626,39 @@ int Hook_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2) return ret; } +bool Hook_Bool_Bool_Int(Hook *hook, void *pthis, bool i1, int i2) +{ + bool ret = false; + bool origret = false; + + PUSH_BOOL() + + MAKE_VECTOR() + + P_BOOL(i1) + P_INT(i2) + + PRE_START() + ,i1, i2 + PRE_END() + +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, i1, i2); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, i1, i2); +#endif + + POST_START() + ,i1, i2 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + void Hook_Void_Str_Float_Float_Float(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3) { ke::AString a; @@ -1479,6 +1728,42 @@ void Hook_Void_Str_Float_Float_Float_Int_Cbase(Hook *hook, void *pthis, const ch POP() } +void Hook_Void_Str_Float_Float_Float_Bool_Cbase(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3, bool i1, void *cb) +{ + ke::AString a; + + PUSH_VOID() + + a = sz1; + int iEnt=TypeConversion.cbase_to_id(cb); + + MAKE_VECTOR() + + P_STR(a) + P_FLOAT(f1) + P_FLOAT(f2) + P_FLOAT(f3) + P_BOOL(i1) + P_CBASE(cb, iEnt) + + PRE_START() + ,a.chars(), f1, f2, f3, i1, iEnt + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.chars(), f1, f2, f3, i1, cb); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.chars(), f1, f2, f3, i1, cb); +#endif + + POST_START() + ,a.chars(), f1, f2, f3, i1, iEnt + POST_END() + + KILL_VECTOR() + POP() +} + int Hook_Int_Vector_Vector_Float_Float(Hook *hook, void *pthis, Vector v1, Vector v2, float f1, float f2) { int ret=0; @@ -1907,6 +2192,42 @@ void Hook_Void_Str_Int(Hook *hook, void *pthis, const char *sz1, int i2) POP() } +bool Hook_Bool_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1) +{ + bool ret = false; + bool origret = false; + + PUSH_BOOL() + + int iEnt =TypeConversion.cbase_to_id(p1); + + MAKE_VECTOR() + + P_CBASE(p1, iEnt) + P_INT(i1) + + PRE_START() + , iEnt, i1 + PRE_END() + +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, p1, i1); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, p1, i1); +#endif + + POST_START() + , iEnt, i1 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + + return ret; +} + void Hook_Void_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1) { PUSH_VOID() @@ -1935,6 +2256,35 @@ void Hook_Void_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1) POP() } +void Hook_Void_Cbase_Int_Float(Hook *hook, void *pthis, void *p1, int i1, float f1) +{ + PUSH_VOID() + int iEnt = TypeConversion.cbase_to_id(p1); + + MAKE_VECTOR() + + P_CBASE(p1, iEnt) + P_INT(i1) + P_FLOAT(f1) + + PRE_START() + , iEnt, i1, f1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, p1, i1, f1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, p1, i1, f1); +#endif + + POST_START() + , iEnt, i1, f1 + POST_END() + + KILL_VECTOR() + POP() +} + void Hook_Void_Str(Hook *hook, void *pthis, const char *sz1) { ke::AString a; @@ -2274,6 +2624,39 @@ int Hook_Int_Cbase_Bool(Hook *hook, void *pthis, void *cb1, bool b1) return ret; } +bool Hook_Bool_Cbase_Bool(Hook *hook, void *pthis, void *cb1, bool b1) +{ + bool ret=false; + bool origret=false; + + PUSH_BOOL() + + int i1=TypeConversion.cbase_to_id(cb1); + + MAKE_VECTOR() + + P_CBASE(cb1, i1) + P_BOOL(b1) + + PRE_START() + , i1, b1 + PRE_END() +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, cb1, b1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, cb1, b1); +#endif + + POST_START() + , i1, b1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + int Hook_Int_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2) { int ret=0; @@ -2309,6 +2692,76 @@ int Hook_Int_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2) return ret; } +int Hook_Int_pVector_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_PTRVECTOR(v1) + P_PTRVECTOR(v2) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, v2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + +bool Hook_Bool_pVector_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2) +{ + bool ret=false; + bool origret=false; + + PUSH_BOOL() + + MAKE_VECTOR() + + P_PTRVECTOR(v1) + P_PTRVECTOR(v2) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, v2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + int Hook_Int_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1) { int ret=0; @@ -2341,6 +2794,38 @@ int Hook_Int_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1) return ret; } +bool Hook_Bool_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1) +{ + bool ret=false; + bool origret=false; + + PUSH_BOOL() + int i1=TypeConversion.entvars_to_id(ev1); + + MAKE_VECTOR() + P_ENTVAR(ev1, i1) + P_FLOAT(f1) + + PRE_START() + ,i1, f1 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, ev1, f1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, ev1, f1); +#endif + + POST_START() + , i1, f1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + float Hook_Float_Float(Hook *hook, void *pthis, float f1) { float ret=0.0; @@ -2643,6 +3128,40 @@ bool Hook_Bool_Cbase(Hook *hook, void *pthis, void *cb) return ret; } +bool Hook_Bool_Entvar(Hook *hook, void *pthis, entvars_t *ev1) +{ + bool ret = 0; + bool origret = 0; + + PUSH_BOOL() + + int e1 = TypeConversion.entvars_to_id(ev1); + + MAKE_VECTOR() + + P_ENTVAR(ev1, e1) + + PRE_START() + , e1 + PRE_END() + +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, ev1); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, ev1); +#endif + + POST_START() + , e1 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + bool Hook_Bool_Int(Hook *hook, void *pthis, int i1) { bool ret=0; diff --git a/modules/hamsandwich/hook_callbacks.h b/modules/hamsandwich/hook_callbacks.h index c50f4f8e..097d1445 100644 --- a/modules/hamsandwich/hook_callbacks.h +++ b/modules/hamsandwich/hook_callbacks.h @@ -50,6 +50,11 @@ const bool RB_Int_Float_Int_Int = false; const int PC_Int_Float_Int_Int = 3; int Hook_Int_Float_Int_Int(Hook *hook, void *pthis, float f1, int i1, int i2); +const bool RT_Bool_Float_Int_Int = false; +const bool RB_Bool_Float_Int_Int = false; +const int PC_Bool_Float_Int_Int = 3; +bool Hook_Bool_Float_Int_Int(Hook *hook, void *pthis, float f1, int i1, int i2); + const bool RT_Void_Entvar_Int = true; const bool RB_Void_Entvar_Int = false; const int PC_Void_Entvar_Int = 2; @@ -70,6 +75,16 @@ const bool RB_Void_Int_Int = false; const int PC_Void_Int_Int = 2; void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2); +const bool RT_Void_Int_Bool = true; +const bool RB_Void_Int_Bool = false; +const int PC_Void_Int_Bool = 2; +void Hook_Void_Int_Bool(Hook *hook, void *pthis, int i1, bool i2); + +const bool RT_Void_Bool_Bool = true; +const bool RB_Void_Bool_Bool = false; +const int PC_Void_Bool_Bool = 2; +void Hook_Void_Bool_Bool(Hook *hook, void *pthis, bool i1, bool i2); + const bool RT_Int_Int_Str_Int = false; const bool RB_Int_Int_Str_Int = false; const int PC_Int_Int_Str_Int = 3; @@ -81,11 +96,21 @@ const bool RB_Int_Int_Str_Int_Int = false; const int PC_Int_Int_Str_Int_Int = 4; int Hook_Int_Int_Str_Int_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i2, int i3); +const bool RT_Int_Int_Str_Int_Bool = false; +const bool RB_Int_Int_Str_Int_Bool = false; +const int PC_Int_Int_Str_Int_Bool = 4; +int Hook_Int_Int_Str_Int_Bool(Hook *hook, void *pthis, int i1, const char *sz1, int i2, bool i3); + const bool RT_Int_Int = false; const bool RB_Int_Int = false; const int PC_Int_Int = 1; int Hook_Int_Int(Hook *hook, void *pthis, int i1); +const bool RT_Bool_Bool = false; +const bool RB_Bool_Bool = false; +const int PC_Bool_Bool = 1; +bool Hook_Bool_Bool(Hook *hook, void *pthis, bool i1); + const bool RT_Int_Entvar = false; const bool RB_Int_Entvar = false; const int PC_Int_Entvar = 1; @@ -177,6 +202,11 @@ const bool RB_Int_pVector = false; const int PC_Int_pVector = 1; int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1); +const bool RT_Bool_pVector = false; +const bool RB_Bool_pVector = false; +const int PC_Bool_pVector = 1; +bool Hook_Bool_pVector(Hook *hook, void *pthis, Vector *v1); + const bool RT_Void_Entvar_Float_Float = true; const bool RB_Void_Entvar_Float_Float = false; const int PC_Void_Entvar_Float_Float = 3; @@ -203,6 +233,10 @@ const bool RB_Int_ItemInfo = false; const int PC_Int_ItemInfo = 1; int Hook_Int_ItemInfo(Hook *hook, void *pthis, void *iteminfo); +const bool RT_Bool_ItemInfo = false; +const bool RB_Bool_ItemInfo = false; +const int PC_Bool_ItemInfo = 1; +bool Hook_Bool_ItemInfo(Hook *hook, void *pthis, void *iteminfo); const bool RT_Float_Void = false; const bool RB_Float_Void = false; @@ -263,6 +297,11 @@ const bool RB_Int_Int_Int = false; const int PC_Int_Int_Int = 2; int Hook_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2); +const bool RT_Bool_Bool_Int = false; +const bool RB_Bool_Bool_Int = false; +const int PC_Bool_Bool_Int = 2; +bool Hook_Bool_Bool_Int(Hook *hook, void *pthis, bool i1, int i2); + const bool RT_Void_Str_Float_Float_Float = true; const bool RB_Void_Str_Float_Float_Float = false; const int PC_Void_Str_Float_Float_Float = 4; @@ -273,6 +312,11 @@ const bool RB_Void_Str_Float_Float_Float_Int_Cbase = false; const int PC_Void_Str_Float_Float_Float_Int_Cbase = 6; void Hook_Void_Str_Float_Float_Float_Int_Cbase(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3, int i1, void *cb); +const bool RT_Void_Str_Float_Float_Float_Bool_Cbase = true; +const bool RB_Void_Str_Float_Float_Float_Bool_Cbase = false; +const int PC_Void_Str_Float_Float_Float_Bool_Cbase = 6; +void Hook_Void_Str_Float_Float_Float_Bool_Cbase(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3, bool i1, void *cb); + const bool RT_Int_Vector_Vector_Float_Float= false; const bool RB_Int_Vector_Vector_Float_Float = false; const int PC_Int_Vector_Vector_Float_Float = 8; @@ -346,11 +390,21 @@ const bool RB_Void_Str_Int = false; const int PC_Void_Str_Int = 2; void Hook_Void_Str_Int(Hook *hook, void *pthis, const char *sz1, int i2); +const bool RT_Bool_Cbase_Int = false; +const bool RB_Bool_Cbase_Int = false; +const int PC_Bool_Cbase_Int = 2; +bool Hook_Bool_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1); + const bool RT_Void_Cbase_Int = true; const bool RB_Void_Cbase_Int = false; const int PC_Void_Cbase_Int = 2; void Hook_Void_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1); +const bool RT_Void_Cbase_Int_Float = true; +const bool RB_Void_Cbase_Int_Float = false; +const int PC_Void_Cbase_Int_Float = 3; +void Hook_Void_Cbase_Int_Float(Hook *hook, void *pthis, void *p1, int i1, float f1); + const bool RT_Void_Str = true; const bool RB_Void_Str = false; const int PC_Void_Str = 1; @@ -401,16 +455,36 @@ const bool RB_Int_Cbase_Bool = false; const int PC_Int_Cbase_Bool = 2; int Hook_Int_Cbase_Bool(Hook *hook, void *pthis, void *cb1, bool b1); +const bool RT_Bool_Cbase_Bool = false; +const bool RB_Bool_Cbase_Bool = false; +const int PC_Bool_Cbase_Bool = 2; +bool Hook_Bool_Cbase_Bool(Hook *hook, void *pthis, void *cb1, bool b1); + const bool RT_Int_Vector_Vector = false; const bool RB_Int_Vector_Vector = false; const int PC_Int_Vector_Vector = 6; int Hook_Int_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2); +const bool RT_Int_pVector_pVector = false; +const bool RB_Int_pVector_pVector = false; +const int PC_Int_pVector_pVector = 3; +int Hook_Int_pVector_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2); + +const bool RT_Bool_pVector_pVector = false; +const bool RB_Bool_pVector_pVector = false; +const int PC_Bool_pVector_pVector = 3; +bool Hook_Bool_pVector_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2); + const bool RT_Int_Entvar_Float = false; const bool RB_Int_Entvar_Float = false; const int PC_Int_Entvar_Float = 2; int Hook_Int_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1); +const bool RT_Bool_Entvar_Float = false; +const bool RB_Bool_Entvar_Float = false; +const int PC_Bool_Entvar_Float = 2; +bool Hook_Bool_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1); + const bool RT_Float_Float = false; const bool RB_Float_Float = false; const int PC_Float_Float = 1; @@ -456,6 +530,11 @@ const bool RB_Bool_Cbase = false; const int PC_Bool_Cbase = 1; bool Hook_Bool_Cbase(Hook *hook, void *pthis, void *cb); +const bool RT_Bool_Entvar = false; +const bool RB_Bool_Entvar = false; +const int PC_Bool_Entvar = 1; +bool Hook_Bool_Entvar(Hook *hook, void *pthis, entvars_t *ev1); + const bool RT_Bool_Int = false; const bool RB_Bool_Int = false; const int PC_Bool_Int = 1; diff --git a/modules/hamsandwich/hook_create.cpp b/modules/hamsandwich/hook_create.cpp index d2ab0061..53942a21 100644 --- a/modules/hamsandwich/hook_create.cpp +++ b/modules/hamsandwich/hook_create.cpp @@ -43,6 +43,11 @@ int Create_Int_Float_Int_Int(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); } +int Create_Bool_Float_Int_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Void_Entvar_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); @@ -63,6 +68,16 @@ int Create_Void_Int_Int(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); } +int Create_Void_Int_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_Bool_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Int_Int_Str_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_DONE); @@ -73,11 +88,21 @@ int Create_Int_Int_Str_Int_Int(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_CELL, FP_DONE); } +int Create_Int_Int_Str_Int_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_CELL, FP_DONE); + +} int Create_Int_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); } +int Create_Bool_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Int_Entvar(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); @@ -143,6 +168,11 @@ int Create_Int_pVector(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE); } +int Create_Bool_pVector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE); +} + int Create_Void_Entvar_Float_Float(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE); @@ -168,6 +198,11 @@ int Create_Int_ItemInfo(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); } +int Create_Bool_ItemInfo(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Float_Void(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); @@ -223,6 +258,11 @@ int Create_Int_Int_Int(AMX* amx, const char* func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); } +int Create_Bool_Bool_Int(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Void_Str_Float_Float_Float(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_DONE); @@ -233,6 +273,11 @@ int Create_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); } +int Create_Void_Str_Float_Float_Float_Bool_Cbase(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Int_Vector_Vector_Float_Float(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_DONE); @@ -298,16 +343,27 @@ int Create_Void_Str_Int(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_CELL, FP_DONE); } +int Create_Bool_Cbase_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Void_Cbase_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); } +int Create_Void_Cbase_Int_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Void_Str(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_DONE); } + int Create_Void_Vector(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE); @@ -338,6 +394,11 @@ int Create_Int_pVector_pVector_Cbase_pFloat(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_CELL, FP_FLOAT, FP_DONE); } +int Create_Bool_pVector_pVector_Cbase_pFloat(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_CELL, FP_FLOAT, FP_DONE); +} + int Create_Void_Cbase_pVector_Float(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_ARRAY, FP_FLOAT, FP_DONE); @@ -353,16 +414,36 @@ int Create_Int_Cbase_Bool(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); } +int Create_Bool_Cbase_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Int_Vector_Vector(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE); } +int Create_Int_pVector_pVector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE); +} + +int Create_Bool_pVector_pVector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE); +} + int Create_Int_Entvar_Float(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); } +int Create_Bool_Entvar_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); +} + int Create_Float_Float(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE); @@ -408,6 +489,11 @@ int Create_Bool_Cbase(AMX *amx, const char *func) return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); } +int Create_Bool_Entvar(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + int Create_Bool_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); diff --git a/modules/hamsandwich/hook_create.h b/modules/hamsandwich/hook_create.h index 9bdd24ca..b9579d9d 100644 --- a/modules/hamsandwich/hook_create.h +++ b/modules/hamsandwich/hook_create.h @@ -27,6 +27,8 @@ int Create_Int_Float_Int(AMX *amx, const char *func); int Create_Int_Float_Int_Int(AMX *amx, const char *func); +int Create_Bool_Float_Int_Int(AMX *amx, const char *func); + int Create_Void_Entvar_Int(AMX *amx, const char *func); int Create_Void_Entvar_Entvar_Int(AMX *amx, const char *func); @@ -35,12 +37,20 @@ int Create_Int_Cbase(AMX *amx, const char *func); int Create_Void_Int_Int(AMX *amx, const char *func); +int Create_Void_Int_Bool(AMX *amx, const char *func); + +int Create_Void_Bool_Bool(AMX *amx, const char *func); + int Create_Int_Int_Str_Int(AMX *amx, const char *func); int Create_Int_Int_Str_Int_Int(AMX *amx, const char *func); +int Create_Int_Int_Str_Int_Bool(AMX *amx, const char *func); + int Create_Int_Int(AMX *amx, const char *func); +int Create_Bool_Bool(AMX *amx, const char *func); + int Create_Int_Entvar(AMX *amx, const char *func); int Create_Int_Entvar_Entvar_Float_Int(AMX *amx, const char *func); @@ -67,6 +77,8 @@ int Create_Vector_pVector(AMX *amx, const char *func); int Create_Int_pVector(AMX *amx, const char *func); +int Create_Bool_pVector(AMX *amx, const char *func); + int Create_Void_Entvar_Float_Float(AMX *amx, const char *func); int Create_Void_pFloat_pFloat(AMX *amx, const char *func); @@ -77,6 +89,8 @@ int Create_Void_Int_Int_Int(AMX *amx, const char *func); int Create_Int_ItemInfo(AMX *amx, const char *func); +int Create_Bool_ItemInfo(AMX *amx, const char *func); + int Create_Float_Void(AMX *amx, const char *func); int Create_Float_Int(AMX *amx, const char *func); @@ -99,10 +113,14 @@ int Create_Int_Float(AMX* amx, const char* func); int Create_Int_Int_Int(AMX* amx, const char* func); +int Create_Bool_Bool_Int(AMX* amx, const char* func); + int Create_Void_Str_Float_Float_Float(AMX* amx, const char* func); int Create_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, const char *func); +int Create_Void_Str_Float_Float_Float_Bool_Cbase(AMX *amx, const char *func); + int Create_Int_Vector_Vector_Float_Float(AMX *amx, const char *func); int Create_Int_Short(AMX* amx, const char* func); @@ -129,8 +147,12 @@ int Create_Int_Int_Int_Float_Int(AMX *amx, const char *func); int Create_Void_Str_Int(AMX *amx, const char *func); +int Create_Bool_Cbase_Int(AMX *amx, const char *func); + int Create_Void_Cbase_Int(AMX *amx, const char *func); +int Create_Void_Cbase_Int_Float(AMX *amx, const char *func); + int Create_Void_Str(AMX *amx, const char *func); int Create_Void_Vector(AMX *amx, const char *func); @@ -151,10 +173,18 @@ int Create_Int_pVector_pVector_Float_Cbase_pVector(AMX *amx, const char *func); int Create_Int_Cbase_Bool(AMX *amx, const char *func); +int Create_Bool_Cbase_Bool(AMX *amx, const char *func); + int Create_Int_Vector_Vector(AMX *amx, const char *func); +int Create_Int_pVector_pVector(AMX *amx, const char *func); + +int Create_Bool_pVector_pVector(AMX *amx, const char *func); + int Create_Int_Entvar_Float(AMX *amx, const char *func); +int Create_Bool_Entvar_Float(AMX *amx, const char *func); + int Create_Float_Float(AMX *amx, const char *func); int Create_Void_Entvar_Entvar_Float(AMX *amx, const char *func); @@ -173,6 +203,8 @@ int Create_Void_Bool(AMX *amx, const char *func); int Create_Bool_Cbase(AMX *amx, const char *func); +int Create_Bool_Entvar(AMX *amx, const char *func); + int Create_Bool_Int(AMX *amx, const char *func); int Create_Void_Cbase_Float(AMX *amx, const char *func); diff --git a/modules/hamsandwich/hook_native.cpp b/modules/hamsandwich/hook_native.cpp index c88c364f..2fc197bf 100644 --- a/modules/hamsandwich/hook_native.cpp +++ b/modules/hamsandwich/hook_native.cpp @@ -37,7 +37,8 @@ bool gDoForwards=true; ke::Vector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; CHamSpecialBotHandler SpecialbotHandler; -#define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, RT_##__STUFF__, RB_##__STUFF__, PC_##__STUFF__, reinterpret_cast(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__ +#define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, false, RT_##__STUFF__, RB_##__STUFF__, PC_##__STUFF__, reinterpret_cast(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__ +#define V_REMOVED(__KEYNAME) 0, 0, __KEYNAME, true, RT_Void_Void, RB_Void_Void, PC_Void_Void, nullptr, 0, 0 hook_t hooklist[] = { @@ -229,7 +230,7 @@ hook_t hooklist[] = { V("checkmeleeattack2", Int_Float_Float) }, { V("schedulechange", Void_Void) }, { V("canplaysequence", Int_Int_Int) }, - { V("canplaysentence", Int_Int) }, + { V("canplaysentence2", Int_Int) }, { V("playsentence", Void_Str_Float_Float_Float) }, { V("playscriptedsentence", Void_Str_Float_Float_Float_Int_Cbase) }, { V("sentencestop", Void_Void) }, @@ -401,23 +402,23 @@ hook_t hooklist[] = /* Sven co-op */ { V("sc_getclassification", Int_Int) }, - { V("sc_ismonster", Int_Void) }, - { V("sc_isphysx", Int_Void) }, - { V("sc_ispointentity", Int_Void) }, - { V("sc_ismachine", Int_Void) }, - { V("sc_criticalremove", Int_Void) }, + { V("sc_ismonster", Bool_Void) }, + { V_REMOVED("sc_isphysx") }, + { V("sc_ispointentity", Bool_Void) }, + { V("sc_ismachine", Bool_Void) }, + { V("sc_criticalremove", Bool_Void) }, { V("sc_updateonremove", Void_Void) }, - { V("sc_fvisible", Int_Cbase_Bool) }, - { V("sc_fvisiblefrompos", Int_Vector_Vector) }, - { V("sc_isfacing", Int_Entvar_Float) }, + { V("sc_fvisible", Bool_Cbase_Bool) }, + { V("sc_fvisiblefrompos", Bool_pVector_pVector) }, + { V("sc_isfacing", Bool_Entvar_Float) }, { V("sc_getpointsfordamage", Float_Float) }, { V("sc_getdamagepoints", Void_Entvar_Entvar_Float) }, { V("sc_oncreate", Void_Void) }, { V("sc_ondestroy", Void_Void) }, - { V("sc_isvalidentity", Bool_Void) }, + { V_REMOVED("sc_isvalidentity") }, { V("sc_shouldfadeondeath", Int_Void) }, { V("sc_setupfriendly", Void_Void) }, - { V("sc_revivethink", Void_Void) }, + { V_REMOVED("sc_revivethink") }, { V("sc_revive", Void_Void) }, { V("sc_startmonster", Void_Void) }, { V("sc_checkrangeattack1_move",Int_Float_Float) }, @@ -440,10 +441,10 @@ hook_t hooklist[] = { V("sc_finbulletcone", Int_Cbase_pVector) }, { V("sc_callgibmonster", Void_Void) }, { V("sc_checktimebaseddamage", Void_Void) }, - { V("sc_ismoving", Int_Void) }, + { V("sc_ismoving", Bool_Void) }, { V("sc_isplayerfollowing", Int_Void) }, - { V("sc_startplayerfollowing", Void_Cbase) }, - { V("sc_stopplayerfollowing", Void_Int) }, + { V("sc_startplayerfollowing", Void_Cbase_Bool) }, + { V("sc_stopplayerfollowing", Void_Bool_Bool) }, { V("sc_usesound", Void_Void) }, { V("sc_unusesound", Void_Void) }, { V("sc_ridemonster", Void_Cbase) }, @@ -454,8 +455,8 @@ hook_t hooklist[] = { V("sc_checkrevival", Void_Void) }, { V("sc_mediccallsound", Void_Void) }, - { V("sc_player_menuinputperformed", Void_Bool) }, - { V("sc_player_ismenuinputdone",Bool_Void) }, + { V_REMOVED("sc_player_menuinputperformed") }, + { V_REMOVED("sc_player_ismenuinputdone") }, { V("sc_player_specialspawn", Void_Void) }, { V("sc_player_isvalidinfoentity", Bool_Void) }, { V("sc_player_levelend", Void_Void) }, @@ -470,9 +471,9 @@ hook_t hooklist[] = { V("sc_player_resetview", Void_Void) }, { V("sc_player_getlogfrequency",Float_Void) }, { V("sc_player_logplayerstats", Bool_Void) }, - { V("sc_player_disablecollisionwithplayer", Void_Cbase_Float) }, - { V("sc_player_enablecollisionwithplayer", Void_Cbase_Bool) }, - { V("sc_player_cantouchplayer", Bool_Cbase) }, + { V_REMOVED("sc_player_disablecollisionwithplayer") }, + { V_REMOVED("sc_player_enablecollisionwithplayer") }, + { V_REMOVED("sc_player_cantouchplayer") }, { V("sc_item_materialize", Void_Void) }, @@ -483,10 +484,10 @@ hook_t hooklist[] = { V("sc_weapon_getw_model", Str_Str) }, { V("sc_weapon_getv_model", Str_Str) }, { V("sc_weapon_precachecustommodels", Void_Void) }, - { V("sc_weapon_ismultiplayer", Int_Void) }, - { V("sc_weapon_frunfuncs", Int_Void) }, + { V("sc_weapon_ismultiplayer", Bool_Void) }, + { V("sc_weapon_frunfuncs", Bool_Void) }, { V("sc_weapon_setfov", Void_Int) }, - { V("sc_weapon_fcanrun", Int_Void) }, + { V("sc_weapon_fcanrun", Bool_Void) }, { V("sc_weapon_customdecrement",Void_Float) }, { V("sc_weapon_setv_model", Void_Str) }, { V("sc_weapon_setp_model", Void_Str) }, @@ -499,11 +500,11 @@ hook_t hooklist[] = { V("tfc_weapon_sendweaponanim", Void_Int_Int) }, { V("tfc_weapon_getnextattackdelay", Float_Float) }, - { V("sc_takehealth",Int_Float_Int_Int) }, - { V("sc_takearmor", Int_Float_Int_Int) }, - { V("sc_giveammo", Int_Int_Str_Int_Int) }, + { V("sc_takehealth",Bool_Float_Int_Int) }, + { V("sc_takearmor", Bool_Float_Int_Int) }, + { V("sc_giveammo", Int_Int_Str_Int_Bool) }, { V("sc_checkattacker", Int_Cbase) }, - { V("sc_player_isconnected", Int_Void) }, + { V("sc_player_isconnected", Bool_Void) }, { V("dod_weapon_sendweaponanim", Void_Int_Int) }, @@ -514,7 +515,69 @@ hook_t hooklist[] = { V("ts_weapon_alternateattack", Void_Void) }, - { V("item_getiteminfo", Int_ItemInfo) } + { V("item_getiteminfo", Int_ItemInfo) }, + + { V("sc_prespawn", Void_Void) }, + { V("sc_postspawn", Void_Void) }, + { V("sc_onkeyvalueupdate", Void_Str) }, + { V("sc_setclassification", Void_Int) }, + { V("sc_istriggered", Bool_Void) }, + { V("sc_mycustompointer", Cbase_Void) }, + { V("sc_myitempointer", Cbase_Void) }, + { V("sc_addpoints", Void_Int_Bool) }, + { V("sc_addpointstoteam", Void_Int_Bool) }, + { V("sc_removeplayeritem", Bool_Cbase) }, + { V("sc_oncontrols", Bool_Entvar) }, + { V("sc_issneaking", Bool_Void) }, + { V("sc_isalive", Bool_Void) }, + { V("sc_isbspmodel", Bool_Void) }, + { V("sc_reflectgauss", Bool_Void) }, + { V("sc_hastarget", Bool_Int) }, + { V("sc_isinworld", Bool_Void) }, + { V("sc_isplayer", Bool_Void) }, + { V("sc_isnetclient", Bool_Void) }, + { V("sc_isbreakable", Bool_Void) }, + { V("sc_subusetargets", Void_Cbase_Int_Float) }, + { V("sc_islockedbymaster", Bool_Void) }, + { V("sc_fbecomeprone", Bool_Cbase) }, + { V("sc_fvecvisible", Bool_pVector) }, + { V("sc_setplayerally", Void_Bool) }, + { V("sc_onsetoriginbymap", Void_Void) }, + { V("sc_isrevivable", Bool_Void) }, + { V("sc_beginrevive", Void_Float) }, + { V("sc_endrevive", Void_Float) }, + { V("sc_canplaysequence", Bool_Bool_Int) }, + { V("sc_canplaysentence2", Bool_Bool) }, + { V("sc_playscriptedsentence", Void_Str_Float_Float_Float_Bool_Cbase) }, + { V("sc_item_addtoplayer", Bool_Cbase) }, + { V("sc_item_addduplicate", Bool_Cbase) }, + { V("sc_item_addammofromitem", Bool_Cbase) }, + { V("sc_item_getpickupsound", Str_Void) }, + { V("sc_item_cancollect", Bool_Cbase_Int) }, + { V("sc_item_collect", Void_Cbase_Int) }, + { V("sc_item_getiteminfo", Bool_ItemInfo) }, + { V("sc_item_candeploy", Bool_Void) }, + { V("sc_item_deploy", Bool_Void) }, + { V("sc_item_canholster", Bool_Void) }, + { V("sc_item_inactiveitempreframe", Void_Void) }, + { V("sc_item_inactiveitempostframe",Void_Void) }, + { V("sc_item_detachfromplayer", Void_Void) }, + { V("sc_item_updateclientdata", Bool_Cbase) }, + { V("sc_item_getrespawntime", Float_Void) }, + { V("sc_item_canhaveduplicates",Bool_Void) }, + { V("sc_weapon_extractammofromitem",Bool_Cbase) }, + { V("sc_weapon_addweapon", Bool_Void) }, + { V("sc_weapon_getammo1drop", Int_Void) }, + { V("sc_weapon_getammo2drop", Int_Void) }, + { V("sc_weapon_playemptysound", Bool_Void) }, + { V("sc_weapon_isusable", Bool_Void) }, + { V("sc_weapon_finishreload", Void_Void) }, + { V("sc_weapon_shouldreload", Bool_Void) }, + { V("sc_weapon_shouldweaponidle",Bool_Void) }, + { V("sc_weapon_usedecrement", Bool_Void) }, + { V("sc_player_enteredobserver",Void_Void) }, + { V("sc_player_leftobserver", Void_Void) }, + { V("sc_player_isobserver", Bool_Void) }, }; diff --git a/modules/hamsandwich/hooklist.h b/modules/hamsandwich/hooklist.h index a4b07fb7..bc48aa0e 100644 --- a/modules/hamsandwich/hooklist.h +++ b/modules/hamsandwich/hooklist.h @@ -19,6 +19,7 @@ typedef struct hook_s int isset; // whether or not this hook is registered with hamdata int vtid; // vtable index of this function const char *name; // name used in the keys + bool isremoved; // whether or not this function is no more available in the mod bool isvoid; // whether or not the target trampoline uses voids bool needsretbuf; // whether or not a pointer to a memory buffer is needed to store a return value int paramcount; // how many parameters are in the func diff --git a/plugins/include/ham_const.inc b/plugins/include/ham_const.inc index b7564fca..3d656c2f 100644 --- a/plugins/include/ham_const.inc +++ b/plugins/include/ham_const.inc @@ -174,7 +174,9 @@ enum Ham /** * Description: Returns whether an entity is activated. * This function is not supported by Day Of Defeat. - * This function has different version for Team Fortress Classic, see Ham_TFC_IsTriggered instead. + * This function has different version for the following mods: + * Team Fortress Classic, see Ham_TFC_IsTriggered instead. + * Sven-Coop 5.0+, see Ham_SC_IsTriggered instead. * Forward params: function(this, idActivator); * Return type: Integer. * Execute params: ExecuteHam(Ham_IsTriggered, this, idActivator); @@ -207,7 +209,9 @@ enum Ham /** * Description: Typically adds points to the entity. - * This function is not supported by Team Fortress Classic mod. + * This function is not supported for the following mods: + * Team Fortress Classic. + * Sven-Coop 5.0-, see Ham_SC_AddPoints instead. * Forward params: function(this, points, bool:cangonegative); * Return type: None. * Execute params: ExecuteHam(Ham_AddPoints, this, points, bool:cangonegative); @@ -216,7 +220,9 @@ enum Ham /** * Description: Typically adds points to everybody on the entity's team. - * This function is not supported by Team Fortress Classic mod. + * This function is not supported for the following mods: + * Team Fortress Classic. + * Sven-Coop 5.0-, see Ham_SC_AddPointsToTeam instead. * Forward params: function(this, points, bool:cangonegative); * Return type: None. * Execute params: ExecuteHam(Ham_AddPointsToTeam, this, points, bool:cangonegative); @@ -233,7 +239,8 @@ enum Ham /** * Description: Removes an item to the player's inventory. - * Forward params: function(this, idother); + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_RemovePlayerItem instead. * Return type: Integer. * Execute params: ExecuteHam(Ham_RemovePlayerItem, this, idother); */ @@ -261,6 +268,8 @@ enum Ham /** * Description: Whether or not the entity is moving. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsMoving instead. * Forward params: function(this); * Return type: Integer. * Execute params: ExecuteHam(Ham_IsMoving, this); @@ -309,6 +318,8 @@ enum Ham /** * Description: Not entirely sure. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_OnControls instead. * Forward params: function(this, idOn) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_OnControls, this, idOn); @@ -317,6 +328,8 @@ enum Ham /** * Description: Whether or not the entity is sneaking. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsSneaking instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_IsSneaking, this); @@ -325,6 +338,8 @@ enum Ham /** * Description: Whether or not the entity is alive. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsAlive instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_IsAlive, this); @@ -333,6 +348,8 @@ enum Ham /** * Description: Whether or not the entity uses a BSP model. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsBSPModel instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_IsBSPModel, this); @@ -341,6 +358,8 @@ enum Ham /** * Description: Whether or not the entity can reflect gauss shots.. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_ReflectGauss instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_ReflectGauss, this); @@ -352,7 +371,8 @@ enum Ham * Note the strindex parameter is a string passed that has been allocated by the engine. * Use fakemeta's EngFunc_SzFromIndex to convert to a normal string, or fakemeta's * EngFunc_AllocString to create a new string. - * Forward params: function(this, strindex). + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_HasTarget instead. * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_HasTarget, this, strindex); */ @@ -360,6 +380,8 @@ enum Ham /** * Description: Whether or not the entity is in the world. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsInWorld instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_IsInWorld, this); @@ -368,6 +390,8 @@ enum Ham /** * Description: Whether or not the entity is a player. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsPlayer instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_IsPlayer, this); @@ -376,6 +400,8 @@ enum Ham /** * Description: Whether or not the entity is a net client. + * This function is not supported for the following mods: + * Sven-Coop 5.0+, see Ham_SC_IsNetClient instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_IsNetClient, this); @@ -449,6 +475,8 @@ enum Ham /** * Description: Normally called whenever a barnacle grabs the entity. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_FBecomeProne instead. * Forward params: function(this); * Return type: Integer. * Execute params: ExecuteHam(Ham_FBecomeProne, this); @@ -497,6 +525,8 @@ enum Ham /** * Description: Returns true if a line can be traced from the caller's eyes to the target. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_FVisible instead. * Forward params: function(this, idOther); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_FVisible, this, idOther); @@ -505,6 +535,8 @@ enum Ham /** * Description: Returns true if a line can be traced from the caller's eyes to given vector. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_FVecVisible instead. * Forward params: function(this, const Float:origin[3]); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_FVecVisible, this, const Float:origin[3]); @@ -590,6 +622,8 @@ enum Ham /** * Description: Adds the item to the player. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Item_AddToPlayer instead. * Forward params: function(this, idPlayer); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Item_AddToPlayer, this, idPlayer); @@ -598,6 +632,8 @@ enum Ham /** * Description: Unsure. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Item_AddDuplicate instead. * Forward params: function(this, idOriginal); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Item_AddDuplicate, this, idOriginal); @@ -606,6 +642,8 @@ enum Ham /** * Description: Whether or not this entity can be deployed. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Item_CanDeploy instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Item_CanDeploy, this); @@ -614,6 +652,8 @@ enum Ham /** * Description: Deploys the entity (usually a weapon). + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Item_Deploy instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Item_Deploy, this); @@ -622,6 +662,8 @@ enum Ham /** * Description: Whether or not the entity can be holstered. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Item_CanHolster instead. * Forward params: function(this); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Item_CanHolster, this); @@ -702,6 +744,8 @@ enum Ham /** * Description: Updates item data for the client. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Item_UpdateClientData instead. * Forward params: function(this, idPlayer) * Return type: Integer. * Execute params: ExecuteHam(Ham_Item_UpdateClientData, this, idPlayer); @@ -750,6 +794,8 @@ enum Ham /** * Description: Unsure. * This function is not supported in Earth's Special Forces mod. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Weapon_AddWeapon instead. * Forward params: function(this) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Weapon_AddWeapon, this); @@ -758,6 +804,8 @@ enum Ham /** * Description: Plays the weapon's empty sound. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Weapon_PlayEmptySound instead. * Forward params: function(this) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Weapon_PlayEmptySound, this); @@ -787,6 +835,8 @@ enum Ham /** * Description: Whether or not the weapon is usable (has ammo, etc.) * This function is not supported in Earth's Special Forces mod. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Weapon_IsUsable instead. * Forward params: function(this) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Weapon_IsUsable, this) @@ -836,6 +886,8 @@ enum Ham /** * Description: Whether or not the weapon should idle. + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Weapon_ShouldWeaponIdle instead. * Forward params: function(this) * Return type: Integer (boolean). * Execute Params: ExecuteHam(Ham_Weapon_ShouldWeaponIdle, this) @@ -845,7 +897,8 @@ enum Ham /** * Description: Unsure. * This function is not supported by Team Fortress Classic. - * Forward params: function(this) + * This function has different version for the following mods: + * Sven-Coop 5.0+, see Ham_SC_Weapon_UseDecrement instead. * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_Weapon_UseDecrement, this); */ @@ -1446,6 +1499,8 @@ enum Ham * trying to possess it. If DisregardState is set, the monster will be sucked into the script * no matter what state it is in. ONLY Scripted AI ents should allow this. * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * This function has different versions for the following mod: + * Sven Coop: see Ham_SC_CanPlaySequence * Forward params: function(this, bool:disregardState, interruptLevel); * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_CanPlaySequence, this, bool:disregardState, interruptLevel); @@ -1455,11 +1510,13 @@ enum Ham /** * Description: - * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * This function has different versions for the following mod: + * Sven Coop: see Ham_SC_CanPlaySentence2 * Forward params: function(this, bool:disregardState); * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_CanPlaySentence, this, bool:disregardState); + * Execute params: ExecuteHam(Ham_CanPlaySentence2, this, bool:disregardState); */ - Ham_CanPlaySentence, + Ham_CanPlaySentence2, /** * Description: - @@ -1473,6 +1530,7 @@ enum Ham /** * Description: - * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * This function has different version for Sven Coop, see Ham_SC_PlayScriptedSentence instead. * Forward params: function(this, const sentence[], Float:duration, Float:volume, Float:attenuation, bool:concurrent, idListener); * Return type: None. * Execute params: ExecuteHam(Ham_PlayScriptedSentence, this, const sentence[], Float:duration, Float:volume, Float:attenuation, bool:concurrent, idListener); @@ -2891,7 +2949,8 @@ enum Ham Ham_SC_IsMonster, /** - * Description: Whether entity uses PhysX feature. + * Description: (!) This function is no more available in the mod. + * Whether entity uses PhysX feature. * Forward params: function(this) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_SC_IsPhysX, this) @@ -2992,7 +3051,8 @@ enum Ham Ham_SC_OnDestroy, /** - * Description: Returns false if the entity is somehow invalid. + * Description: (!) This function is no more available in the mod. + * Returns false if the entity is somehow invalid. * Forward params: function(this) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_SC_IsValidEntity, this) @@ -3016,7 +3076,8 @@ enum Ham Ham_SC_SetupFriendly, /** - * Description: Tries to revive a monster. + * Description: (!) This function is no more available in the mod. + * Tries to revive a monster. * Forward params: function(this) * Return type: None. * Execute params: ExecuteHam(Ham_SC_ReviveThink, this) @@ -3224,17 +3285,17 @@ enum Ham /** * Description: - - * Forward params: function(this, idleader) + * Forward params: function(this, idleader, bool:noSound) * Return type: None. - * Execute params: ExecuteHam(Ham_SC_StartPlayerFollowing, this, idleader) + * Execute params: ExecuteHam(Ham_SC_StartPlayerFollowing, this, idleader, bool:noSound) */ Ham_SC_StartPlayerFollowing, /** * Description: - - * Forward params: function(this, bool:clearSchedule) + * Forward params: function(this, bool:clearSchedule, bool:noSound) * Return type: None. - * Execute params: ExecuteHam(Ham_SC_StopPlayerFollowing, this, bool:clearSchedule) + * Execute params: ExecuteHam(Ham_SC_StopPlayerFollowing, this, bool:clearSchedule, bool:noSound) */ Ham_SC_StopPlayerFollowing, @@ -3303,7 +3364,7 @@ enum Ham Ham_SC_CheckRevival, /** - * Description: - + * Description: (!) This function is no more available in the mod. * Forward params: function(this) * Return type: None. * Execute params: ExecuteHam(Ham_SC_MedicCallSound, this) @@ -3312,10 +3373,10 @@ enum Ham /** - * Description: - + * Description: (!) This function is no more available in the mod. * Forward params: function(this) * Return type: None. - * Execute params: ExecuteHam(Ham_SC_MedicCallSound, this) + * Execute params: ExecuteHam(Ham_SC_Player_MenuInputPerformed, this) */ Ham_SC_Player_MenuInputPerformed, @@ -3440,7 +3501,7 @@ enum Ham Ham_SC_Player_LogPlayerStats, /** - * Description: - + * Description: (!) This function is no more available in the mod. * Forward params: function(this, idPlayer, Float:time) * Return type: None. * Execute params: ExecuteHam(Ham_SC_Player_DisableCollision, this, idPlayer, Float:time) @@ -3448,7 +3509,7 @@ enum Ham Ham_SC_Player_DisableCollisionWithPlayer, /** - * Description: - + * Description: (!) This function is no more available in the mod. * Forward params: function(this, idPlayer, bool:testIntersection) * Return type: None. * Execute params: ExecuteHam(Ham_SC_Player_EnableCollision, this, idPlayer, bool:testIntersection) @@ -3456,7 +3517,7 @@ enum Ham Ham_SC_Player_EnableCollisionWithPlayer, /** - * Description: - + * Description: (!) This function is no more available in the mod. * Forward params: function(this, idPlayer) * Return type: Integer (boolean). * Execute params: ExecuteHam(Ham_SC_Player_CanTouchPlayer, this, idPlayer) @@ -3726,6 +3787,533 @@ enum Ham Ham_Item_GetItemInfo, + /** + * LATE ADDITIONS (2017) + */ + + /** + * Description: Performs checks that must occur before Spawn itself is called. Always call baseclass version first. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_PreSpawn, this); + */ + Ham_SC_PreSpawn, + + /** + * Description: Performs checks that must occur after Spawn itself is called. Always call baseclass version first. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_PostSpawn, this); + */ + Ham_SC_PostSpawn, + + /** + * Description: - + * Forward params: function(this, key); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_PostSpawn, this, const key[]); + */ + Ham_SC_OnKeyValueUpdate, + + /** + * Description: - + * Forward params: function(this, classification); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_SetClassification, this, classification); + */ + Ham_SC_SetClassification, + + /** + * Description: Returns whether an entity is activated. + * This function is not supported by Day Of Defeat. + * This function has different version for Team Fortress Classic, see Ham_TFC_IsTriggered instead. + * Forward params: function(this, idActivator); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_IsTriggered, this, idActivator); + */ + Ham_SC_IsTriggered, + + /** + * Description: Returns the id of the entity if its class is derived off of ICustomEntity, -1 otherwise. + * Forward params: function(this) + * Return type: Entity. + * Execute params: ExecuteHam(Ham_SC_MyCustomPointer, this); + */ + Ham_SC_MyCustomPointer, + + /** + * Description: Returns the id of the entity if its class is derived off of CBasePlayerItem, -1 otherwise. + * Forward params: function(this) + * Return type: Entity. + * Execute params: ExecuteHam(Ham_SC_MyItemPointer, this); + */ + Ham_SC_MyItemPointer, + + /** + * Description: Typically adds points to the entity. + * Forward params: function(this, points, bool:cangonegative); + * Return type: None. + * Execute params: ExecuteHam(Ham_AddPoints, this, points, bool:cangonegative); + */ + Ham_SC_AddPoints, + + /** + * Description: Typically adds points to everybody on the entity's team. + * Forward params: function(this, points, bool:cangonegative); + * Return type: None. + * Execute params: ExecuteHam(Ham_AddPointsToTeam, this, points, bool:cangonegative); + */ + Ham_SC_AddPointsToTeam, + + /** + * Description: Removes an item to the player's inventory. + * Forward params: function(this, idother); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_RemovePlayerItem, this, idother); + */ + Ham_SC_RemovePlayerItem, + + /** + * Description: Not entirely sure. + * Forward params: function(this, idOn) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_OnControls, this, idOn); + */ + Ham_SC_OnControls, + + /** + * Description: Whether or not the entity is sneaking. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsSneaking, this); + */ + Ham_SC_IsSneaking, + + /** + * Description: Whether or not the entity is alive. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsAlive, this); + */ + Ham_SC_IsAlive, + + /** + * Description: Whether or not the entity uses a BSP model. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsBSPModel, this); + */ + Ham_SC_IsBSPModel, + + /** + * Description: Whether or not the entity can reflect gauss shots. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_ReflectGauss, this); + */ + Ham_SC_ReflectGauss, + + /** + * Description: Whether or not the target is the same as the one passed. + * Note the strindex parameter is a string passed that has been allocated by the engine. + * Use fakemeta's EngFunc_SzFromIndex to convert to a normal string, or fakemeta's + * EngFunc_AllocString to create a new string. + * Forward params: function(this, strindex). + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_HasTarget, this, strindex); + */ + Ham_SC_HasTarget, + + /** + * Description: Whether or not the entity is in the world. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsInWorld, this); + */ + Ham_SC_IsInWorld, + + /** + * Description: Whether or not the entity is a player. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Sc_IsPlayer, this); + */ + Ham_Sc_IsPlayer, + + /** + * Description: Whether or not the entity is a net client. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsNetClient, this); + */ + Ham_SC_IsNetClient, + + /** + * Description: Whether or not the entity is a brush entity breakable. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsBreakable, this); + */ + Ham_SC_IsBreakable, + + /** + * Description: - + * Forward params: function(this, idActivator, useType, value); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_SUB_UseTargets, this, idActivator, useType, value); + */ + Ham_SC_SUB_UseTargets, + + /** + * Description: - + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsLockedByMaster, this); + */ + Ham_SC_IsLockedByMaster, + + /** + * Description: Normally called whenever a barnacle grabs the entity. + * Forward params: function(this, idOther); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FBecomeProne, this, idOther); + */ + Ham_SC_FBecomeProne, + + /** + * Description: Returns true if a line can be traced from the caller's eyes to given vector. + * Forward params: function(this, const Float:origin[3]); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FVecVisible, this, const Float:origin[3]); + */ + Ham_SC_FVecVisible, + + /** + * Description: Sets the player ally state + * Forward params: function(this, bool:state); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_SetPlayerAlly, this, bool:state); + */ + Ham_SC_SetPlayerAlly, + + /** + * Description: Callback after trigger_setorigin has moved the entity. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_OnSetOriginByMap, this); + */ + Ham_SC_OnSetOriginByMap, + + /** + * Description: Return true if you want to be revivable. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsRevivable, this); + */ + Ham_SC_IsRevivable, + + /** + * Description: - + * timeUntilRevive is the time until the actual revive event occurs. + * Forward params: function(this, Float:timeUntilRevive); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_BeginRevive, Float:timeUntilRevive); + */ + Ham_SC_BeginRevive, + + /** + * Description: - + * timeUntilRevive is the time before the monster is supposed to be revived + * Forward params: function(this, Float:timeUntilRevive); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_EndRevive, Float:timeUntilRevive); + */ + Ham_SC_EndRevive, + + /** + * Description: Determines whether or not the monster can play the scripted sequence or AI sequence that is + * trying to possess it. If DisregardState is set, the monster will be sucked into the script + * no matter what state it is in. ONLY Scripted AI ents should allow this. + * Forward params: function(this, bool:disregardState, interruptLevel); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CanPlaySequence, this, bool:disregardState, interruptLevel); + */ + Ham_SC_CanPlaySequence, + + /** + * Description: - + * Forward params: function(this, bool:disregardState); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CanPlaySentence2, this, bool:disregardState); + */ + Ham_SC_CanPlaySentence2, + + /** + * Description: - + * Forward params: function(this, const sentence[], Float:duration, Float:volume, Float:attenuation, bool:concurrent, idListener); + * Return type: None. + * Execute params: ExecuteHam(Ham_PlayScriptedSentence, this, const sentence[], Float:duration, Float:volume, Float:attenuation, bool:concurrent, idListener); + */ + Ham_SC_PlayScriptedSentence, + + + /** + * Items have all the attributes of normal entities in addition to these. + */ + + /** + * Description: Adds the item to the player. + * Forward params: function(this, idPlayer); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Item_AddToPlayer, this, idPlayer); + */ + Ham_SC_Item_AddToPlayer, + + /** + * Description: Returns true if you want your duplicate removed from world. + * Forward params: function(this, idOriginal); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_AddDuplicate, this, idOriginal); + */ + Ham_SC_Item_AddDuplicate, + + /** + * Description: - + * Forward params: function(this, idOther); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_AddAmmoFromItem, this, idOther); + */ + Ham_SC_Item_AddAmmoFromItem, + + /** + * Description: - + * Forward params: function(this) + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_SC_Item_GetPickupSound, this) + */ + Ham_SC_Item_GetPickupSound, + + /** + * Description: - + * Collect Types: + * COLLECT_TOUCH 0 + * COLLECT_USE_DIRECT 1 + * COLLECT_USE_INDIRECT 2 + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_CanCollect, this, idOther, collectType); + */ + Ham_SC_Item_CanCollect, + + /** + * Description: - + * Forward params: function(this, idOther, collectType); + * Collect Types: + * COLLECT_TOUCH 0 + * COLLECT_USE_DIRECT 1 + * COLLECT_USE_INDIRECT 2 + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Item_Collect, this, idOther, collectType); + */ + Ham_SC_Item_Collect, + + /** + * Description: Gets item infos. + * Forward params: function(this, iteminfo_handle); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_Item_GetItemInfo, this, iteminfo_handle); + * Use CreateHamItemInfo() to pass a new ItemInfo handle. + */ + Ham_SC_Item_GetItemInfo, + + /** + * Description: Whether or not this entity can be deployed. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_CanDeploy, this); + */ + Ham_SC_Item_CanDeploy, + + /** + * Description: Deploys the entity (usually a weapon). + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_Deploy, this); + */ + Ham_SC_Item_Deploy, + + /** + * Description: Whether or not the entity can be holstered. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_CanHolster, this); + */ + Ham_SC_Item_CanHolster, + + /** + * Description: Called each frame by the player PreThink if inactive. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Item_InactiveItemPreFrame, this); + */ + Ham_SC_Item_InactiveItemPreFrame, + + /** + * Description: Called each frame by the player PostThink if inactive. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Item_InactiveItemPostFrame, this); + */ + Ham_SC_Item_InactiveItemPostFrame, + + /** + * Description: - + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Item_DetachFromPlayer, this); + */ + Ham_SC_Item_DetachFromPlayer, + + /** + * Description: Updates item data for the client. + * Forward params: function(this, idPlayer) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_Item_UpdateClientData, this, idPlayer); + */ + Ham_SC_Item_UpdateClientData, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_SC_Item_GetRespawnTime, this); + */ + Ham_SC_Item_GetRespawnTime, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Item_CanHaveDuplicates, this); + */ + Ham_SC_Item_CanHaveDuplicates, + + + /** + * Weapons have all the attributes to Ham_Item_*, in addition to these. + */ + + /** + * Description: - + * Forward params: function(this, idOriginal) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_ExtractAmmoFromItem, idOriginal); + */ + Ham_SC_Weapon_ExtractAmmoFromItem, + + /** + * Description: Unsure. + * This function is not supported in Earth's Special Forces mod. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_AddWeapon, this); + */ + Ham_SC_Weapon_AddWeapon, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_Weapon_GetAmmo1Drop); + */ + Ham_SC_Weapon_GetAmmo1Drop, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_Weapon_GetAmmo2Drop, idOriginal); + */ + Ham_SC_Weapon_GetAmmo2Drop, + + /** + * Description: Plays the weapon's empty sound. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_PlayEmptySound, this); + */ + Ham_SC_Weapon_PlayEmptySound, + + /** + * Description: Whether or not the weapon is usable (has ammo, etc.) + * This function is not supported in Earth's Special Forces mod. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_IsUsable, this) + */ + Ham_SC_Weapon_IsUsable, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_FinishReload, idOriginal); + */ + Ham_SC_Weapon_FinishReload, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_ShouldReload, idOriginal); + */ + Ham_SC_Weapon_ShouldReload, + + /** + * Description: Whether or not the weapon should idle. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute Params: ExecuteHam(Ham_SC_Weapon_ShouldWeaponIdle, this) + */ + Ham_SC_Weapon_ShouldWeaponIdle, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_UseDecrement, this); + */ + Ham_SC_Weapon_UseDecrement, + + + /** + * Players have all the attributes of normal entities, in addition to these. + */ + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_EnteredObserver, this); + */ + Ham_SC_Player_EnteredObserver, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_LeftObserver, this); + */ + Ham_SC_Player_LeftObserver, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Player_IsObserver, this); + */ + Ham_SC_Player_IsObserver, + + /** * DONT USE ME LOL */ @@ -3741,6 +4329,7 @@ enum HamError HAM_INVALID_FUNC, // The function is not valid HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini + HAM_FUNC_NOT_AVAILABLE, // This function is not more available in the mod HAM_ERR_END };