diff --git a/configs/hamdata.ini b/configs/hamdata.ini index a8a10268..4b4b1430 100644 --- a/configs/hamdata.ini +++ b/configs/hamdata.ini @@ -1,824 +1,1003 @@ -; Ham Sandwich module config file. -; -; IMPORTANT: It is highly suggested that you do not modify this file unless -; you know _exactly_ what you are doing! -; -; NOTE: Just because a mod contains a function does not means it will work -; as expected. If, for example, HamKilled() does not work as you think -; it should in Counter-Strike DO NOT FILE A BUG REPORT. This just -; exposes the function for you, whether or not it works, or how it -; works is up to plugin authors to figure out. -; -; NOTE: If a mod is missing keys for a certain native, that particular native -; will not be loaded! Example: Say CS is missing the "takedamage" index -; but has the use and pev indexes. The HamUse and HamePdataCbase natives -; will be registered, but the HamTakeDamage native will not register. -; In addition, any attempts to hook a function who's key is missing will -; result in the plugin failing. -; -; NOTE: The base key is only needed for the linux configs. -; -; NOTE: Any keys that begin with a modname (eg: cstrike_restart) will, -; obviously, only work on that mod and all mirrors of it (eg: czero). -; -; NOTE: If you change this file while the module is already loaded, you will -; need to restart the server for the changes to take effect. Changes to -; this file before the module is loaded will take effect when the module -; loads. -; -; NOTE: All of these offsets and settings are for the latest (at the time of -; release) legitimate version of the mod. However, there is a _chance_ -; that they will work on older (and even newer) versions. -; eg: If they work on non-Steam CS 1.6 this is coincidental, if they do -; not work on non-Steam CS 1.6 this will not be officially fixed. -; -; Mirrors: These take the name of one mod, and copy all of its data to another -; name. An example of a use for this would be cstrike and czero: they -; use the same binary so all of its vtable offsets are guaranteed to -; be identical. Mirrors should always come first in the file! -; -; Version: $Id: hamdata.ini 3687 2008-03-04 18:51:35Z sawce $ +; Ham Sandwich module config file. +; +; IMPORTANT: It is highly suggested that you do not modify this file unless +; you know _exactly_ what you are doing! +; +; NOTE: Just because a mod contains a function does not means it will work +; as expected. If, for example, HamKilled() does not work as you think +; it should in Counter-Strike DO NOT FILE A BUG REPORT. This just +; exposes the function for you, whether or not it works, or how it +; works is up to plugin authors to figure out. +; +; NOTE: If a mod is missing keys for a certain native, that particular native +; will not be loaded! Example: Say CS is missing the "takedamage" index +; but has the use and pev indexes. The HamUse and HamePdataCbase natives +; will be registered, but the HamTakeDamage native will not register. +; In addition, any attempts to hook a function who's key is missing will +; result in the plugin failing. +; +; NOTE: The base key is only needed for the linux configs. +; +; NOTE: Any keys that begin with a modname (eg: cstrike_restart) will, +; obviously, only work on that mod and all mirrors of it (eg: czero). +; +; NOTE: If you change this file while the module is already loaded, you will +; need to restart the server for the changes to take effect. Changes to +; this file before the module is loaded will take effect when the module +; loads. +; +; NOTE: All of these offsets and settings are for the latest (at the time of +; release) legitimate version of the mod. However, there is a _chance_ +; that they will work on older (and even newer) versions. +; eg: If they work on non-Steam CS 1.6 this is coincidental, if they do +; not work on non-Steam CS 1.6 this will not be officially fixed. +; +; Mirrors: These take the name of one mod, and copy all of its data to another +; name. An example of a use for this would be cstrike and czero: they +; use the same binary so all of its vtable offsets are guaranteed to +; be identical. Mirrors should always come first in the file! +; +; Version: $Id: hamdata.ini 3687 2008-03-04 18:51:35Z sawce $ + + +@mirror cstrike czero +@mirror ns nsp +@mirror valve dmc + +; TODO: check these - all are estimates +@section cstrike linux + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 3 + objectcaps 6 + activate 7 + setobjectcollisionbox 8 + classify 9 + deathnotice 10 + traceattack 11 + takedamage 12 + takehealth 13 + killed 14 + bloodcolor 15 + tracebleed 16 + istriggered 17 + mymonsterpointer 18 + mysquadmonsterpointer 19 + gettogglestate 20 + addpoints 21 + addpointstoteam 22 + addplayeritem 23 + removeplayeritem 24 + giveammo 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 + isnetclient 41 + teamid 42 + getnexttarget 43 + think 44 + touch 45 + use 46 + blocked 47 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 + fvisible 56 + fvecvisible 57 + changeyaw 59 + hashumangibs 60 + hasaliengibs 61 + fademonster 62 + gibmonster 63 + getdeathactivity 64 + becomedead 65 + irelationship 67 + painsound 68 + reportaistate 70 + monsterinitdead 71 + look 72 + bestvisibleenemy 73 + finviewcone 74 + fvecinviewcone 75 - -@mirror cstrike czero -@mirror ns nsp - -; TODO: check these - all are estimates -@section cstrike linux - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 76 - player_duck 77 - player_prethink 78 - player_postthink 79 - player_getgunposition 80 - player_shouldfadeondeath 66 - player_impulsecommands 83 - player_updateclientdata 82 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 64 - item_canholster 66 - item_holster 67 - item_updateiteminfo 68 - item_preframe 69 - item_postframe 70 - item_drop 71 - item_kill 72 - item_attachtoplayer 73 - item_primaryammoindex 74 - item_secondaryammoindex 75 - item_updateclientdata 76 - item_getweaponptr 77 - item_itemslot 79 - - weapon_extractammo 80 - weapon_extractclipammo 81 - weapon_addweapon 82 - weapon_playemptysound 83 - weapon_resetemptysound 84 - weapon_sendweaponanim 85 - weapon_isusable 86 - weapon_primaryattack 87 - weapon_secondaryattack 88 - weapon_reload 89 - weapon_weaponidle 90 - weapon_retireweapon 91 - weapon_shouldweaponidle 92 - weapon_usedecrement 93 - - cstrike_restart 2 - cstrike_roundrespawn 84 - cstrike_item_candrop 63 - cstrike_item_getmaxspeed 78 - -@end -@section cstrike windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 76 - player_duck 77 - player_prethink 78 - player_postthink 79 - player_getgunposition 80 - player_shouldfadeondeath 66 - player_impulsecommands 83 - player_updateclientdata 82 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 64 - item_canholster 66 - item_holster 67 - item_updateiteminfo 68 - item_preframe 69 - item_postframe 70 - item_drop 71 - item_kill 72 - item_attachtoplayer 73 - item_primaryammoindex 74 - item_secondaryammoindex 75 - item_updateclientdata 76 - item_getweaponptr 77 - item_itemslot 79 - - weapon_extractammo 80 - weapon_extractclipammo 81 - weapon_addweapon 82 - weapon_playemptysound 83 - weapon_resetemptysound 84 - weapon_sendweaponanim 85 - weapon_isusable 86 - weapon_primaryattack 87 - weapon_secondaryattack 88 - weapon_reload 89 - weapon_weaponidle 90 - weapon_retireweapon 91 - weapon_shouldweaponidle 92 - weapon_usedecrement 93 - - cstrike_restart 2 - cstrike_roundrespawn 84 - cstrike_item_candrop 63 - cstrike_item_getmaxspeed 78 -@end - -@section cstrike mac - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 76 - player_duck 77 - player_prethink 78 - player_postthink 79 - player_getgunposition 80 - player_shouldfadeondeath 66 - player_impulsecommands 83 - player_updateclientdata 82 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 64 - item_canholster 66 - item_holster 67 - item_updateiteminfo 68 - item_preframe 69 - item_postframe 70 - item_drop 71 - item_kill 72 - item_attachtoplayer 73 - item_primaryammoindex 74 - item_secondaryammoindex 75 - item_updateclientdata 76 - item_getweaponptr 77 - item_itemslot 79 - - weapon_extractammo 80 - weapon_extractclipammo 81 - weapon_addweapon 82 - weapon_playemptysound 83 - weapon_resetemptysound 84 - weapon_sendweaponanim 85 - weapon_isusable 86 - weapon_primaryattack 87 - weapon_secondaryattack 88 - weapon_reload 89 - weapon_weaponidle 90 - weapon_retireweapon 91 - weapon_shouldweaponidle 92 - weapon_usedecrement 93 - - cstrike_restart 2 - cstrike_roundrespawn 84 - cstrike_item_candrop 63 - cstrike_item_getmaxspeed 78 -@end - -@section dod linux - pev 4 - base 0x0 - - spawn 3 - precache 4 - keyvalue 5 - objectcaps 8 - activate 9 - objectcollisionbox 12 - classify 13 - deathnotice 14 - traceattack 17 - takedamage 18 - takehealth 19 - killed 20 - bloodcolor 21 - tracebleed 22 - mymonsterpointer 23 - mysquadmonsterpointer 24 - gettogglestate 25 - addpoints 26 - addpointstoteam 27 - addplayeritem 28 - removeplayeritem 29 - giveammo 30 - getdelay 31 - ismoving 32 - overridereset 33 - damagedecal 34 - settogglestate 35 - startsneaking 36 - stopsneaking 37 - oncontrols 38 - issneaking 39 - isalive 40 - isbspmodel 41 - reflectgauss 42 - hastarget 43 - isinworld 44 - isplayer 45 - isnetclient 46 - teamid 47 - getnexttarget 48 - think 49 - touch 50 - use 51 - blocked 52 - respawn 53 - updateowner 54 - fbecomeprone 55 - center 56 - eyeposition 57 - earposition 58 - bodytarget 59 - illumination 60 - fvisible 61 - fvecvisible 62 - - player_jump 134 - player_duck 135 - player_prethink 132 - player_postthink 133 - player_getgunposition 126 - player_shouldfadeondeath 66 - player_impulsecommands 137 - player_updateclientdata 136 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 66 - item_candeploy 67 - item_deploy 68 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 85 - - weapon_extractammo 86 - weapon_extractclipammo 87 - weapon_addweapon 88 - weapon_playemptysound 89 - weapon_resetemptysound 90 - weapon_sendweaponanim 91 - weapon_isusable 92 - weapon_primaryattack 102 - weapon_secondaryattack 103 - weapon_reload 104 - weapon_weaponidle 106 - weapon_retireweapon 107 - weapon_shouldweaponidle 108 - weapon_usedecrement 109 - - dod_roundrespawn 0 - dod_roundrespawnent 1 - dod_roundstore 2 - dod_areasetindex 10 - dod_areasendstatus 11 - dod_getstate 15 - dod_getstateent 16 - dod_item_candrop 70 -@end - -@section dod windows - pev 4 - base 0x0 - - spawn 3 - precache 4 - keyvalue 5 - objectcaps 8 - activate 9 - objectcollisionbox 12 - classify 13 - deathnotice 14 - traceattack 17 - takedamage 18 - takehealth 19 - killed 20 - bloodcolor 21 - tracebleed 22 - mymonsterpointer 23 - mysquadmonsterpointer 24 - gettogglestate 25 - addpoints 26 - addpointstoteam 27 - addplayeritem 28 - removeplayeritem 29 - giveammo 30 - getdelay 31 - ismoving 32 - overridereset 33 - damagedecal 34 - settogglestate 35 - startsneaking 36 - stopsneaking 37 - oncontrols 48 - issneaking 39 - isalive 40 - isbspmodel 41 - reflectgauss 42 - hastarget 43 - isinworld 44 - isplayer 45 - isnetclient 46 - teamid 47 - getnexttarget 48 - think 49 - touch 50 - use 51 - blocked 52 - respawn 53 - updateowner 54 - fbecomeprone 55 - center 56 - eyeposition 57 - earposition 58 - bodytarget 59 - illumination 60 - fvisible 61 - fvecvisible 62 - - player_jump 134 - player_duck 135 - player_prethink 132 - player_postthink 133 - player_getgunposition 126 - player_shouldfadeondeath 66 - player_impulsecommands 137 - player_updateclientdata 136 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 66 - item_candeploy 67 - item_deploy 68 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 85 - - weapon_extractammo 86 - weapon_extractclipammo 87 - weapon_addweapon 88 - weapon_playemptysound 89 - weapon_resetemptysound 90 - weapon_sendweaponanim 91 - weapon_isusable 92 - weapon_primaryattack 102 - weapon_secondaryattack 103 - weapon_reload 104 - weapon_weaponidle 106 - weapon_retireweapon 107 - weapon_shouldweaponidle 108 - weapon_usedecrement 109 - - dod_roundrespawn 0 - dod_roundrespawnent 1 - dod_roundstore 2 - dod_areasetindex 10 - dod_areasendstatus 11 - dod_getstate 15 - dod_getstateent 16 - dod_item_candrop 70 -@end - -@section dod mac - pev 4 - base 0x0 - - spawn 3 - precache 4 - keyvalue 5 - objectcaps 8 - activate 9 - objectcollisionbox 12 - classify 13 - deathnotice 14 - traceattack 17 - takedamage 18 - takehealth 19 - killed 20 - bloodcolor 21 - tracebleed 22 - mymonsterpointer 23 - mysquadmonsterpointer 24 - gettogglestate 25 - addpoints 26 - addpointstoteam 27 - addplayeritem 28 - removeplayeritem 29 - giveammo 30 - getdelay 31 - ismoving 32 - overridereset 33 - damagedecal 34 - settogglestate 35 - startsneaking 36 - stopsneaking 37 - oncontrols 38 - issneaking 39 - isalive 40 - isbspmodel 41 - reflectgauss 42 - hastarget 43 - isinworld 44 - isplayer 45 - isnetclient 46 - teamid 47 - getnexttarget 48 - think 49 - touch 50 - use 51 - blocked 52 - respawn 53 - updateowner 54 - fbecomeprone 55 - center 56 - eyeposition 57 - earposition 58 - bodytarget 59 - illumination 60 - fvisible 61 - fvecvisible 62 - - player_jump 134 - player_duck 135 - player_prethink 132 - player_postthink 133 - player_getgunposition 126 - player_shouldfadeondeath 66 - player_impulsecommands 137 - player_updateclientdata 136 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 66 - item_candeploy 67 - item_deploy 68 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 85 - - weapon_extractammo 86 - weapon_extractclipammo 87 - weapon_addweapon 88 - weapon_playemptysound 89 - weapon_resetemptysound 90 - weapon_sendweaponanim 91 - weapon_isusable 92 - weapon_primaryattack 102 - weapon_secondaryattack 103 - weapon_reload 104 - weapon_weaponidle 106 - weapon_retireweapon 107 - weapon_shouldweaponidle 108 - weapon_usedecrement 109 - - dod_roundrespawn 0 - dod_roundrespawnent 1 - dod_roundstore 2 - dod_areasetindex 10 - dod_areasendstatus 11 - dod_getstate 15 - dod_getstateent 16 - dod_item_candrop 70 -@end - -; TFC Does not have the following "standard" entries in its vtable: -; addpoints, addpointstoteam -@section tfc linux - pev 4 - base 0x0 - - spawn 2 - precache 3 - keyvalue 4 - objectcaps 7 - activate 8 - setobjectcollisionbox 9 - classify 10 - deathnotice 11 - traceattack 12 - takedamage 13 - takehealth 14 - killed 15 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 + player_jump 76 + player_duck 77 + player_prethink 78 + player_postthink 79 + player_getgunposition 80 + player_shouldfadeondeath 66 + player_impulsecommands 83 + player_updateclientdata 82 + + item_addtoplayer 59 + item_addduplicate 60 + item_getiteminfo 61 + item_candeploy 62 + item_deploy 64 + item_canholster 66 + item_holster 67 + item_updateiteminfo 68 + item_preframe 69 + item_postframe 70 + item_drop 71 + item_kill 72 + item_attachtoplayer 73 + item_primaryammoindex 74 + item_secondaryammoindex 75 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 79 + + weapon_extractammo 80 + weapon_extractclipammo 81 + weapon_addweapon 82 + weapon_playemptysound 83 + weapon_resetemptysound 84 + weapon_isusable 86 + weapon_primaryattack 87 + weapon_secondaryattack 88 + weapon_reload 89 + weapon_weaponidle 90 + weapon_retireweapon 91 + weapon_shouldweaponidle 92 + weapon_usedecrement 93 + + cstrike_restart 2 + cstrike_roundrespawn 84 + cstrike_item_candrop 63 + cstrike_item_isweapon 65 + cstrike_item_getmaxspeed 78 + cstrike_weapon_sendweaponanim 85 + cstrike_player_resetmaxspeed 69 + cstrike_player_isbot 81 + cstrike_player_getautoaimvector 85 + cstrike_player_blind 86 + cstrike_player_ontouchingweapon 87 + +@end +@section cstrike windows + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 3 + objectcaps 6 + activate 7 + setobjectcollisionbox 8 + classify 9 + deathnotice 10 + traceattack 11 + takedamage 12 + takehealth 13 + killed 14 + bloodcolor 15 + tracebleed 16 + istriggered 17 + mymonsterpointer 18 + mysquadmonsterpointer 19 + gettogglestate 20 + addpoints 21 + addpointstoteam 22 + addplayeritem 23 + removeplayeritem 24 + giveammo 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 + isnetclient 41 + teamid 42 + getnexttarget 43 + think 44 + touch 45 + use 46 + blocked 47 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 fvecvisible 56 - - player_jump 134 - player_duck 135 - player_prethink 136 - player_postthink 137 - player_shouldfadeondeath 68 - player_impulsecommands 138 - - item_addtoplayer 66 - item_addduplicate 67 - item_getiteminfo 69 - item_candeploy 70 - item_deploy 71 - item_canholster 72 - item_holster 73 - item_updateiteminfo 74 - item_preframe 75 - item_postframe 76 - item_drop 77 - item_kill 78 - item_attachtoplayer 79 - item_primaryammoindex 80 - item_secondaryammoindex 81 - item_updateclientdata 82 - item_getweaponptr 83 - item_itemslot 68 - - weapon_extractammo 84 - weapon_extractclipammo 85 - weapon_addweapon 86 - weapon_playemptysound 87 - weapon_resetemptysound 88 - weapon_sendweaponanim 89 - weapon_isusable 90 - weapon_primaryattack 91 - weapon_secondaryattack 92 - weapon_reload 93 - weapon_weaponidle 94 - weapon_retireweapon 95 - weapon_shouldweaponidle 96 - - tfc_engineeruse 57 - tfc_finished 58 - tfc_empexplode 59 - tfc_calcempdmgrad 60 - tfc_takeempblast 61 - tfc_empremove 62 - tfc_takeconcussionblast 63 - tfc_concuss 64 + fvisible 57 + changeyaw 59 + hashumangibs 60 + hasaliengibs 61 + fademonster 62 + gibmonster 63 + getdeathactivity 64 + becomedead 65 + irelationship 67 + painsound 68 + reportaistate 70 + monsterinitdead 71 + look 72 + bestvisibleenemy 73 + finviewcone 75 + fvecinviewcone 74 + + player_jump 76 + player_duck 77 + player_prethink 78 + player_postthink 79 + player_getgunposition 80 + player_shouldfadeondeath 66 + player_impulsecommands 83 + player_updateclientdata 82 + + item_addtoplayer 59 + item_addduplicate 60 + item_getiteminfo 61 + item_candeploy 62 + item_deploy 64 + item_canholster 66 + item_holster 67 + item_updateiteminfo 68 + item_preframe 69 + item_postframe 70 + item_drop 71 + item_kill 72 + item_attachtoplayer 73 + item_primaryammoindex 74 + item_secondaryammoindex 75 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 79 + + weapon_extractammo 80 + weapon_extractclipammo 81 + weapon_addweapon 82 + weapon_playemptysound 83 + weapon_resetemptysound 84 + weapon_isusable 86 + weapon_primaryattack 87 + weapon_secondaryattack 88 + weapon_reload 89 + weapon_weaponidle 90 + weapon_retireweapon 91 + weapon_shouldweaponidle 92 + weapon_usedecrement 93 + + cstrike_restart 2 + cstrike_roundrespawn 84 + cstrike_item_candrop 63 + cstrike_item_isweapon 65 + cstrike_item_getmaxspeed 78 + cstrike_weapon_sendweaponanim 85 + cstrike_player_resetmaxspeed 69 + cstrike_player_isbot 81 + cstrike_player_getautoaimvector 85 + cstrike_player_blind 86 + cstrike_player_ontouchingweapon 87 +@end + +@section cstrike mac + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 3 + objectcaps 6 + activate 7 + setobjectcollisionbox 8 + classify 9 + deathnotice 10 + traceattack 11 + takedamage 12 + takehealth 13 + killed 14 + bloodcolor 15 + tracebleed 16 + istriggered 17 + mymonsterpointer 18 + mysquadmonsterpointer 19 + gettogglestate 20 + addpoints 21 + addpointstoteam 22 + addplayeritem 23 + removeplayeritem 24 + giveammo 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 + isnetclient 41 + teamid 42 + getnexttarget 43 + think 44 + touch 45 + use 46 + blocked 47 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 + fvecvisible 56 + fvisible 57 + changeyaw 59 + hashumangibs 60 + hasaliengibs 61 + fademonster 62 + gibmonster 63 + getdeathactivity 64 + becomedead 65 + irelationship 67 + painsound 68 + reportaistate 70 + monsterinitdead 71 + look 72 + bestvisibleenemy 73 + finviewcone 74 + fvecinviewcone 75 + + player_jump 76 + player_duck 77 + player_prethink 78 + player_postthink 79 + player_getgunposition 80 + player_shouldfadeondeath 66 + player_impulsecommands 83 + player_updateclientdata 82 + + item_addtoplayer 59 + item_addduplicate 60 + item_getiteminfo 61 + item_candeploy 62 + item_deploy 64 + item_canholster 66 + item_holster 67 + item_updateiteminfo 68 + item_preframe 69 + item_postframe 70 + item_drop 71 + item_kill 72 + item_attachtoplayer 73 + item_primaryammoindex 74 + item_secondaryammoindex 75 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 79 + + weapon_extractammo 80 + weapon_extractclipammo 81 + weapon_addweapon 82 + weapon_playemptysound 83 + weapon_resetemptysound 84 + weapon_isusable 86 + weapon_primaryattack 87 + weapon_secondaryattack 88 + weapon_reload 89 + weapon_weaponidle 90 + weapon_retireweapon 91 + weapon_shouldweaponidle 92 + weapon_usedecrement 93 + + cstrike_restart 2 + cstrike_roundrespawn 84 + cstrike_item_candrop 63 + cstrike_item_isweapon 65 + cstrike_item_getmaxspeed 78 + cstrike_weapon_sendweaponanim 85 + cstrike_player_resetmaxspeed 69 + cstrike_player_isbot 81 + cstrike_player_getautoaimvector 85 + cstrike_player_blind 86 + cstrike_player_ontouchingweapon 87 @end -@section tfc windows - pev 4 - base 0x0 + +@section dod linux + pev 4 + base 0x0 + + spawn 3 + precache 4 + keyvalue 5 + objectcaps 8 + activate 9 + setobjectcollisionbox 12 + classify 13 + deathnotice 14 + traceattack 17 + takedamage 18 + takehealth 19 + killed 20 + bloodcolor 21 + tracebleed 22 + mymonsterpointer 23 + mysquadmonsterpointer 24 + gettogglestate 25 + addpoints 26 + addpointstoteam 27 + addplayeritem 28 + removeplayeritem 29 + giveammo 30 + getdelay 31 + ismoving 32 + overridereset 33 + damagedecal 34 + settogglestate 35 + startsneaking 36 + stopsneaking 37 + oncontrols 38 + issneaking 39 + isalive 40 + isbspmodel 41 + reflectgauss 42 + hastarget 43 + isinworld 44 + isplayer 45 + isnetclient 46 + teamid 47 + getnexttarget 48 + think 49 + touch 50 + use 51 + blocked 52 + respawn 53 + updateowner 54 + fbecomeprone 55 + center 56 + eyeposition 57 + earposition 58 + bodytarget 59 + illumination 60 + fvisible 61 + fvecvisible 62 + + look 64 + changeyaw 67 + irelationship 69 + monsterinitdead 71 + bestvisibleenemy 74 + finviewcone 75 + fvecinviewcone 76 + + runai 65 + monsterthink 68 + monsterinit 70 + checklocalmove 77 + move 78 + moveexecute 79 + shouldadvanceroute 80 + getstoppedactivity 81 + stop 82 + checkrangeattack1 83 + checkrangeattack2 84 + checkmeleeattack1 85 + checkmeleeattack2 86 + schedulechange 92 + canplaysequence 93 + canplaysentence 94 + playsentence 95 + playscriptedsentence 96 + sentencestop 97 + getidealstate 98 + setactivity 99 + reportaistate 100 + checkenemy 101 + ftriangulate 102 + setyawspeed 103 + buildnearestroute 104 + findcover 105 + coverradius 107 + fcancheckattacks 108 + checkammo 109 + ignoreconditions 110 + fvalidatehinttype 111 + fcanactiveidle 112 + isoundmask 113 + hearingsensitivity 116 + barnaclevictimbitten 117 + barnaclevictimreleased 118 + preschedulethink 120 + getdeathactivity 121 + gibmonster 122 + hashumangibs 123 + hasaliengibs 124 + fademonster 125 + deathsound 127 + alertsound 128 + idlesound 129 + painsound 130 + stopfollowing 131 + + player_jump 134 + player_duck 135 + player_prethink 132 + player_postthink 133 + player_getgunposition 126 + player_shouldfadeondeath 66 + player_impulsecommands 137 + player_updateclientdata 136 + + item_addtoplayer 64 + item_addduplicate 65 + item_getiteminfo 66 + item_candeploy 67 + item_deploy 68 + item_canholster 73 + item_holster 74 + item_updateiteminfo 75 + item_preframe 76 + item_postframe 77 + item_drop 78 + item_kill 79 + item_attachtoplayer 80 + item_primaryammoindex 81 + item_secondaryammoindex 82 + item_updateclientdata 83 + item_getweaponptr 84 + item_itemslot 85 + + weapon_extractammo 86 + weapon_extractclipammo 87 + weapon_addweapon 88 + weapon_playemptysound 89 + weapon_resetemptysound 90 + weapon_isusable 92 + weapon_primaryattack 102 + weapon_secondaryattack 103 + weapon_reload 104 + weapon_weaponidle 105 + weapon_retireweapon 106 + weapon_shouldweaponidle 107 + weapon_usedecrement 108 + + dod_roundrespawn 0 + dod_roundrespawnent 1 + dod_roundstore 2 + dod_areasetindex 10 + dod_areasendstatus 11 + dod_getstate 15 + dod_getstateent 16 + dod_setscriptreset 119 + dod_item_candrop 70 + dod_item_spawndeploy 69 + dod_item_setdmgtime 71 + dod_item_dropgren 72 + + dod_weapon_sendweaponanim 91 + dod_weapon_isuseable 92 + dod_weapon_aim 93 + dod_weapon_flaim 94 + dod_weapon_removestamina 95 + dod_weapon_changefov 96 + dod_weapon_zoomout 97 + dod_weapon_zoomin 98 + dod_weapon_getfov 99 + dod_weapon_playeriswatersniping 100 + dod_weapon_updatezoomspeed 101 + dod_weapon_special 105 +@end +@section dod windows + pev 4 + base 0x0 + + spawn 3 + precache 4 + keyvalue 5 + objectcaps 8 + activate 9 + setobjectcollisionbox 12 + classify 13 + deathnotice 14 + traceattack 17 + takedamage 18 + takehealth 19 + killed 20 + bloodcolor 21 + tracebleed 22 + mymonsterpointer 23 + mysquadmonsterpointer 24 + gettogglestate 25 + addpoints 26 + addpointstoteam 27 + addplayeritem 28 + removeplayeritem 29 + giveammo 30 + getdelay 31 + ismoving 32 + overridereset 33 + damagedecal 34 + settogglestate 35 + startsneaking 36 + stopsneaking 37 + oncontrols 38 + issneaking 39 + isalive 40 + isbspmodel 41 + reflectgauss 42 + hastarget 43 + isinworld 44 + isplayer 45 + isnetclient 46 + teamid 47 + getnexttarget 48 + think 49 + touch 50 + use 51 + blocked 52 + respawn 53 + updateowner 54 + fbecomeprone 55 + center 56 + eyeposition 57 + earposition 58 + bodytarget 59 + illumination 60 + fvisible 62 + fvecvisible 61 + + look 64 + changeyaw 67 + irelationship 69 + monsterinitdead 71 + bestvisibleenemy 74 + finviewcone 76 + fvecinviewcone 75 + + runai 65 + monsterthink 68 + monsterinit 70 + checklocalmove 77 + move 78 + moveexecute 79 + shouldadvanceroute 80 + getstoppedactivity 81 + stop 82 + checkrangeattack1 83 + checkrangeattack2 84 + checkmeleeattack1 85 + checkmeleeattack2 86 + schedulechange 92 + canplaysequence 93 + canplaysentence 94 + playsentence 95 + playscriptedsentence 96 + sentencestop 97 + getidealstate 98 + setactivity 99 + reportaistate 100 + checkenemy 101 + ftriangulate 102 + setyawspeed 103 + buildnearestroute 104 + findcover 105 + coverradius 107 + fcancheckattacks 108 + checkammo 109 + ignoreconditions 110 + fvalidatehinttype 111 + fcanactiveidle 112 + isoundmask 113 + hearingsensitivity 116 + barnaclevictimbitten 117 + barnaclevictimreleased 118 + preschedulethink 120 + getdeathactivity 121 + gibmonster 122 + hashumangibs 123 + hasaliengibs 124 + fademonster 125 + deathsound 127 + alertsound 128 + idlesound 129 + painsound 130 + stopfollowing 131 + + player_jump 134 + player_duck 135 + player_prethink 132 + player_postthink 133 + player_getgunposition 126 + player_shouldfadeondeath 66 + player_impulsecommands 137 + player_updateclientdata 136 + + item_addtoplayer 64 + item_addduplicate 65 + item_getiteminfo 66 + item_candeploy 67 + item_deploy 68 + item_canholster 73 + item_holster 74 + item_updateiteminfo 75 + item_preframe 76 + item_postframe 77 + item_drop 78 + item_kill 79 + item_attachtoplayer 80 + item_primaryammoindex 81 + item_secondaryammoindex 82 + item_updateclientdata 83 + item_getweaponptr 84 + item_itemslot 85 + + weapon_extractammo 86 + weapon_extractclipammo 87 + weapon_addweapon 88 + weapon_playemptysound 89 + weapon_resetemptysound 90 + weapon_isusable 92 + weapon_primaryattack 102 + weapon_secondaryattack 103 + weapon_reload 104 + weapon_weaponidle 105 + weapon_retireweapon 106 + weapon_shouldweaponidle 107 + weapon_usedecrement 108 + + dod_roundrespawn 0 + dod_roundrespawnent 1 + dod_roundstore 2 + dod_areasetindex 10 + dod_areasendstatus 11 + dod_getstate 16 + dod_getstateent 15 + dod_setscriptreset 119 + + dod_item_candrop 70 + dod_item_spawndeploy 69 + dod_item_setdmgtime 71 + dod_item_dropgren 72 + + dod_weapon_sendweaponanim 91 + dod_weapon_isuseable 92 + dod_weapon_aim 93 + dod_weapon_flaim 94 + dod_weapon_removestamina 95 + dod_weapon_changefov 96 + dod_weapon_zoomout 97 + dod_weapon_zoomin 98 + dod_weapon_getfov 99 + dod_weapon_playeriswatersniping 100 + dod_weapon_updatezoomspeed 101 + dod_weapon_special 105 +@end + +@section dod mac + pev 4 + base 0x0 + + spawn 3 + precache 4 + keyvalue 5 + objectcaps 8 + activate 9 + setobjectcollisionbox 12 + classify 13 + deathnotice 14 + traceattack 17 + takedamage 18 + takehealth 19 + killed 20 + bloodcolor 21 + tracebleed 22 + mymonsterpointer 23 + mysquadmonsterpointer 24 + gettogglestate 25 + addpoints 26 + addpointstoteam 27 + addplayeritem 28 + removeplayeritem 29 + giveammo 30 + getdelay 31 + ismoving 32 + overridereset 33 + damagedecal 34 + settogglestate 35 + startsneaking 36 + stopsneaking 37 + oncontrols 38 + issneaking 39 + isalive 40 + isbspmodel 41 + reflectgauss 42 + hastarget 43 + isinworld 44 + isplayer 45 + isnetclient 46 + teamid 47 + getnexttarget 48 + think 49 + touch 50 + use 51 + blocked 52 + respawn 53 + updateowner 54 + fbecomeprone 55 + center 56 + eyeposition 57 + earposition 58 + bodytarget 59 + illumination 60 + fvisible 61 + fvecvisible 62 + + look 64 + changeyaw 67 + irelationship 69 + monsterinitdead 71 + bestvisibleenemy 74 + finviewcone 75 + fvecinviewcone 76 + + runai 65 + monsterthink 68 + monsterinit 70 + checklocalmove 77 + move 78 + moveexecute 79 + shouldadvanceroute 80 + getstoppedactivity 81 + stop 82 + checkrangeattack1 83 + checkrangeattack2 84 + checkmeleeattack1 85 + checkmeleeattack2 86 + schedulechange 92 + canplaysequence 93 + canplaysentence 94 + playsentence 95 + playscriptedsentence 96 + sentencestop 97 + getidealstate 98 + setactivity 99 + reportaistate 100 + checkenemy 101 + ftriangulate 102 + setyawspeed 103 + buildnearestroute 104 + findcover 105 + coverradius 107 + fcancheckattacks 108 + checkammo 109 + ignoreconditions 110 + fvalidatehinttype 111 + fcanactiveidle 112 + isoundmask 113 + hearingsensitivity 116 + barnaclevictimbitten 117 + barnaclevictimreleased 118 + preschedulethink 120 + getdeathactivity 121 + gibmonster 122 + hashumangibs 123 + hasaliengibs 124 + fademonster 125 + deathsound 127 + alertsound 128 + idlesound 129 + painsound 130 + stopfollowing 131 + + player_jump 134 + player_duck 135 + player_prethink 132 + player_postthink 133 + player_getgunposition 126 + player_shouldfadeondeath 66 + player_impulsecommands 137 + player_updateclientdata 136 + + item_addtoplayer 64 + item_addduplicate 65 + item_getiteminfo 66 + item_candeploy 67 + item_deploy 68 + item_canholster 73 + item_holster 74 + item_updateiteminfo 75 + item_preframe 76 + item_postframe 77 + item_drop 78 + item_kill 79 + item_attachtoplayer 80 + item_primaryammoindex 81 + item_secondaryammoindex 82 + item_updateclientdata 83 + item_getweaponptr 84 + item_itemslot 85 + + weapon_extractammo 86 + weapon_extractclipammo 87 + weapon_addweapon 88 + weapon_playemptysound 89 + weapon_resetemptysound 90 + weapon_isusable 92 + weapon_primaryattack 102 + weapon_secondaryattack 103 + weapon_reload 104 + weapon_weaponidle 105 + weapon_retireweapon 106 + weapon_shouldweaponidle 107 + weapon_usedecrement 108 + + dod_roundrespawn 0 + dod_roundrespawnent 1 + dod_roundstore 2 + dod_areasetindex 10 + dod_areasendstatus 11 + dod_getstate 15 + dod_getstateent 16 + dod_setscriptreset 119 + + dod_item_candrop 70 + dod_item_spawndeploy 69 + dod_item_setdmgtime 71 + dod_item_dropgren 72 + + dod_weapon_sendweaponanim 91 + dod_weapon_isuseable 92 + dod_weapon_aim 93 + dod_weapon_flaim 94 + dod_weapon_removestamina 95 + dod_weapon_changefov 96 + dod_weapon_zoomout 97 + dod_weapon_zoomin 98 + dod_weapon_getfov 99 + dod_weapon_playeriswatersniping 100 + dod_weapon_updatezoomspeed 101 + dod_weapon_special 105 +@end + +; TFC Does not have the following "standard" entries in its vtable: +; addpoints, addpointstoteam, getgunposition, teamid, usedecrement, updateclientdata +@section tfc linux + pev 4 + base 0x0 + spawn 1 precache 2 keyvalue 3 @@ -830,16 +1009,13 @@ traceattack 11 takedamage 12 takehealth 13 - killed 14 bloodcolor 15 tracebleed 16 - istriggered 17 mymonsterpointer 18 mysquadmonsterpointer 19 gettogglestate 20 addplayeritem 21 removeplayeritem 22 - giveammo 23 getdelay 24 ismoving 25 overridereset 26 @@ -871,7 +1047,401 @@ illumination 53 fvisible 54 fvecvisible 55 + + look 65 + changeyaw 68 + irelationship 70 + monsterinitdead 72 + becomedead 73 + bestvisibleenemy 75 + finviewcone 76 + fvecinviewcone 77 + + runai 66 + monsterthink 69 + monsterinit 71 + checklocalmove 78 + move 79 + moveexecute 80 + shouldadvanceroute 81 + getstoppedactivity 82 + stop 83 + checkrangeattack1 84 + checkrangeattack2 85 + checkmeleeattack1 86 + checkmeleeattack2 87 + schedulechange 93 + canplaysequence 94 + canplaysentence 95 + playsentence 96 + playscriptedsentence 97 + sentencestop 98 + getidealstate 99 + setactivity 100 + reportaistate 101 + checkenemy 102 + ftriangulate 103 + setyawspeed 104 + buildnearestroute 105 + findcover 106 + coverradius 108 + fcancheckattacks 109 + checkammo 110 + ignoreconditions 111 + fvalidatehinttype 112 + fcanactiveidle 113 + isoundmask 114 + hearingsensitivity 117 + barnaclevictimbitten 118 + barnaclevictimreleased 119 + preschedulethink 120 + getdeathactivity 121 + gibmonster 122 + hashumangibs 123 + hasaliengibs 124 + fademonster 125 + deathsound 128 + alertsound 129 + idlesound 130 + painsound 131 + stopfollowing 132 + + player_jump 133 + player_duck 134 + player_prethink 135 + player_postthink 136 + player_shouldfadeondeath 67 + player_impulsecommands 137 + item_addtoplayer 65 + item_addduplicate 66 + item_getiteminfo 68 + item_candeploy 69 + item_deploy 70 + item_canholster 71 + item_holster 72 + item_updateiteminfo 73 + item_preframe 74 + item_postframe 75 + item_drop 76 + item_kill 77 + item_attachtoplayer 78 + item_primaryammoindex 79 + item_secondaryammoindex 80 + item_updateclientdata 81 + item_getweaponptr 82 + item_itemslot 67 + + weapon_extractammo 83 + weapon_extractclipammo 84 + weapon_addweapon 85 + weapon_playemptysound 86 + weapon_resetemptysound 87 + weapon_sendweaponanim 88 + weapon_isusable 89 + weapon_primaryattack 90 + weapon_secondaryattack 91 + weapon_reload 92 + weapon_weaponidle 93 + weapon_retireweapon 94 + weapon_shouldweaponidle 95 + weapon_getnextattackdelay 96 + + tfc_killed 14 + tfc_istriggered 17 + tfc_giveammo 23 + tfc_dbgetitemname 40 + tfc_engineeruse 56 + tfc_finished 57 + tfc_empexplode 58 + tfc_calcempdmgrad 59 + tfc_takeempblast 60 + tfc_empremove 61 + tfc_takeconcussionblast 62 + tfc_concuss 63 + tfc_radiusdamage 126 + tfc_radiusdamage2 127 +@end +@section tfc windows + pev 4 + base 0x0 + + spawn 1 + precache 2 + keyvalue 3 + objectcaps 6 + activate 7 + setobjectcollisionbox 8 + classify 9 + deathnotice 10 + traceattack 11 + takedamage 12 + takehealth 13 + bloodcolor 15 + tracebleed 16 + mymonsterpointer 18 + mysquadmonsterpointer 19 + gettogglestate 20 + addplayeritem 21 + removeplayeritem 22 + getdelay 24 + ismoving 25 + overridereset 26 + damagedecal 27 + settogglestate 28 + startsneaking 29 + stopsneaking 30 + oncontrols 31 + issneaking 32 + isalive 33 + isbspmodel 34 + reflectgauss 35 + hastarget 36 + isinworld 37 + isplayer 38 + isnetclient 39 + getnexttarget 41 + think 42 + touch 43 + use 44 + blocked 45 + respawn 46 + updateowner 47 + fbecomeprone 48 + center 49 + eyeposition 50 + earposition 51 + bodytarget 52 + illumination 53 + fvisible 55 + fvecvisible 54 + + look 65 + changeyaw 68 + irelationship 70 + monsterinitdead 72 + becomedead 73 + bestvisibleenemy 75 + finviewcone 77 + fvecinviewcone 76 + + runai 66 + monsterthink 69 + monsterinit 71 + checklocalmove 78 + move 79 + moveexecute 80 + shouldadvanceroute 81 + getstoppedactivity 82 + stop 83 + checkrangeattack1 84 + checkrangeattack2 85 + checkmeleeattack1 86 + checkmeleeattack2 87 + schedulechange 93 + canplaysequence 94 + canplaysentence 95 + playsentence 96 + playscriptedsentence 97 + sentencestop 98 + getidealstate 99 + setactivity 100 + reportaistate 101 + checkenemy 102 + ftriangulate 103 + setyawspeed 104 + buildnearestroute 105 + findcover 106 + coverradius 108 + fcancheckattacks 109 + checkammo 110 + ignoreconditions 111 + fvalidatehinttype 112 + fcanactiveidle 113 + isoundmask 114 + hearingsensitivity 117 + barnaclevictimbitten 118 + barnaclevictimreleased 119 + preschedulethink 120 + getdeathactivity 121 + gibmonster 122 + hashumangibs 123 + hasaliengibs 124 + fademonster 125 + deathsound 128 + alertsound 129 + idlesound 130 + painsound 131 + stopfollowing 132 + + player_jump 133 + player_duck 134 + player_prethink 135 + player_postthink 136 + player_shouldfadeondeath 67 + player_impulsecommands 137 + + item_addtoplayer 65 + item_addduplicate 66 + item_getiteminfo 68 + item_candeploy 69 + item_deploy 70 + item_canholster 71 + item_holster 72 + item_updateiteminfo 73 + item_preframe 74 + item_postframe 75 + item_drop 76 + item_kill 77 + item_attachtoplayer 78 + item_primaryammoindex 79 + item_secondaryammoindex 80 + item_updateclientdata 81 + item_getweaponptr 82 + item_itemslot 67 + + weapon_extractammo 83 + weapon_extractclipammo 84 + weapon_addweapon 85 + weapon_playemptysound 86 + weapon_resetemptysound 87 + weapon_sendweaponanim 88 + weapon_isusable 89 + weapon_primaryattack 90 + weapon_secondaryattack 91 + weapon_reload 92 + weapon_weaponidle 93 + weapon_retireweapon 94 + weapon_shouldweaponidle 95 + wepaon_getnextattackdelay 96 + + tfc_killed 14 + tfc_istriggered 17 + tfc_giveammo 23 + tfc_dbgetitemname 40 + tfc_engineeruse 56 + tfc_finished 57 + tfc_empexplode 58 + tfc_calcempdmgrad 59 + tfc_takeempblast 60 + tfc_empremove 61 + tfc_takeconcussionblast 62 + tfc_concuss 63 + tfc_radiusdamage 127 + tfc_radiusdamage2 126 +@end + +@section tfc mac + pev 4 + base 0x0 + + spawn 1 + precache 2 + keyvalue 3 + objectcaps 6 + activate 7 + setobjectcollisionbox 8 + classify 9 + deathnotice 10 + traceattack 11 + takedamage 12 + takehealth 13 + bloodcolor 15 + tracebleed 16 + mymonsterpointer 18 + mysquadmonsterpointer 19 + gettogglestate 20 + addplayeritem 21 + removeplayeritem 22 + getdelay 24 + ismoving 25 + overridereset 26 + damagedecal 27 + settogglestate 28 + startsneaking 29 + stopsneaking 30 + oncontrols 31 + issneaking 32 + isalive 33 + isbspmodel 34 + reflectgauss 35 + hastarget 36 + isinworld 37 + isplayer 38 + isnetclient 39 + getnexttarget 41 + think 42 + touch 43 + use 44 + blocked 45 + respawn 46 + updateowner 47 + fbecomeprone 48 + center 49 + eyeposition 50 + earposition 51 + bodytarget 52 + illumination 53 + fvisible 54 + fvecvisible 55 + + look 65 + changeyaw 68 + irelationship 70 + monsterinitdead 72 + becomedead 73 + bestvisibleenemy 75 + finviewcone 76 + fvecinviewcone 77 + + runai 66 + monsterthink 69 + monsterinit 71 + checklocalmove 78 + move 79 + moveexecute 80 + shouldadvanceroute 81 + getstoppedactivity 82 + stop 83 + checkrangeattack1 84 + checkrangeattack2 85 + checkmeleeattack1 86 + checkmeleeattack2 87 + schedulechange 93 + canplaysequence 94 + canplaysentence 95 + playsentence 96 + playscriptedsentence 97 + sentencestop 98 + getidealstate 99 + setactivity 100 + reportaistate 101 + checkenemy 102 + ftriangulate 103 + setyawspeed 104 + buildnearestroute 105 + findcover 106 + coverradius 108 + fcancheckattacks 109 + checkammo 110 + ignoreconditions 111 + fvalidatehinttype 112 + fcanactiveidle 113 + isoundmask 114 + hearingsensitivity 117 + barnaclevictimbitten 118 + barnaclevictimreleased 119 + preschedulethink 120 + getdeathactivity 121 + gibmonster 122 + hashumangibs 123 + hasaliengibs 124 + fademonster 125 + deathsound 128 + alertsound 129 + idlesound 130 + painsound 131 + stopfollowing 132 player_jump 133 player_duck 134 @@ -911,8 +1481,13 @@ weapon_reload 92 weapon_weaponidle 93 weapon_retireweapon 94 - weapon_shouldweaponidle 95 + weapon_shouldweaponidle 95 + weapon_getnextattackdelay 96 + tfc_killed 14 + tfc_istriggered 17 + tfc_giveammo 23 + tfc_dbgetitemname 40 tfc_engineeruse 56 tfc_finished 57 tfc_empexplode 58 @@ -921,577 +1496,1258 @@ tfc_empremove 61 tfc_takeconcussionblast 62 tfc_concuss 63 -@end - -@section tfc mac - pev 4 - base 0x0 - - spawn 2 - precache 3 - keyvalue 4 - objectcaps 7 - activate 8 - setobjectcollisionbox 9 - classify 10 - deathnotice 11 - traceattack 12 - takedamage 13 - takehealth 14 - killed 15 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 134 - player_duck 135 - player_prethink 136 - player_postthink 137 - player_shouldfadeondeath 68 - player_impulsecommands 138 - - item_addtoplayer 66 - item_addduplicate 67 - item_getiteminfo 69 - item_candeploy 70 - item_deploy 71 - item_canholster 72 - item_holster 73 - item_updateiteminfo 74 - item_preframe 75 - item_postframe 76 - item_drop 77 - item_kill 78 - item_attachtoplayer 79 - item_primaryammoindex 80 - item_secondaryammoindex 81 - item_updateclientdata 82 - item_getweaponptr 83 - item_itemslot 68 - - weapon_extractammo 84 - weapon_extractclipammo 85 - weapon_addweapon 86 - weapon_playemptysound 87 - weapon_resetemptysound 88 - weapon_sendweaponanim 89 - weapon_isusable 90 - weapon_primaryattack 91 - weapon_secondaryattack 92 - weapon_reload 93 - weapon_weaponidle 94 - weapon_retireweapon 95 - weapon_shouldweaponidle 96 - - tfc_engineeruse 57 - tfc_finished 58 - tfc_empexplode 59 - tfc_calcempdmgrad 60 - tfc_takeempblast 61 - tfc_empremove 62 - tfc_takeconcussionblast 63 - tfc_concuss 64 + tfc_radiusdamage 126 + tfc_radiusdamage2 127 @end ; ns's linux binary is compiled with gcc 3.3, so the "base" is 0, and pev is 4 @section ns linux pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 14 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addpoints 22 - addpointstoteam 23 - addplayeritem 24 - removeplayeritem 25 - giveammo 26 - getdelay 27 - ismoving 28 - overridereset 29 - damagedecal 30 - settogglestate 31 - startsneaking 32 - stopsneaking 33 - oncontrols 34 - issneaking 35 - isalive 36 - isbspmodel 37 - reflectgauss 38 - hastarget 39 - isinworld 40 - isplayer 41 - isnetclient 42 - teamid 43 - getnexttarget 46 - think 47 - touch 48 - use 49 - blocked 50 - respawn 52 - updateowner 53 - fbecomeprone 54 - center 55 - eyeposition 56 - earposition 57 - bodytarget 58 - illumination 59 - fvisible 60 - fvecvisible 61 - - player_jump 83 - player_duck 84 - player_prethink 85 - player_postthink 86 - player_getgunposition 87 - player_shouldfadeondeath 72 - player_impulsecommands 101 - player_updateclientdata 99 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 68 - item_candeploy 69 - item_deploy 70 - item_canholster 71 - item_holster 72 - item_updateiteminfo 74 - item_preframe 75 - item_postframe 76 - item_drop 77 - item_kill 78 - item_attachtoplayer 79 - item_primaryammoindex 80 - item_secondaryammoindex 81 - item_updateclientdata 82 - item_getweaponptr 83 - item_itemslot 84 - - weapon_extractammo 85 - weapon_extractclipammo 86 - weapon_addweapon 87 - weapon_playemptysound 88 - weapon_resetemptysound 89 - weapon_sendweaponanim 94 - weapon_isusable 73 - weapon_primaryattack 98 - weapon_secondaryattack 99 - weapon_reload 100 - weapon_weaponidle 101 - weapon_retireweapon 102 - weapon_shouldweaponidle 103 - weapon_usedecrement 104 - - ns_getpointvalue 13 - ns_awardkill 15 - ns_resetentity 45 - ns_updateonremove 51 -@end -@section ns windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 14 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addpoints 22 - addpointstoteam 23 - addplayeritem 24 - removeplayeritem 25 - giveammo 26 - getdelay 27 - ismoving 28 - overridereset 29 - damagedecal 30 - settogglestate 31 - startsneaking 32 - stopsneaking 33 - oncontrols 34 - issneaking 35 - isalive 36 - isbspmodel 37 - reflectgauss 38 - hastarget 39 - isinworld 40 - isplayer 41 - isnetclient 42 - teamid 43 - getnexttarget 46 - think 47 - touch 48 - use 49 - blocked 50 - respawn 52 - updateowner 53 - fbecomeprone 54 - center 55 - eyeposition 56 - earposition 57 - bodytarget 58 - illumination 59 - fvisible 60 - fvecvisible 61 - - player_jump 83 - player_duck 84 - player_prethink 85 - player_postthink 86 - player_getgunposition 87 - player_shouldfadeondeath 72 - player_impulsecommands 101 - player_updateclientdata 99 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 68 - item_candeploy 69 - item_deploy 70 - item_canholster 71 - item_holster 72 - item_updateiteminfo 74 - item_preframe 75 - item_postframe 76 - item_drop 77 - item_kill 78 - item_attachtoplayer 79 - item_primaryammoindex 80 - item_secondaryammoindex 81 - item_updateclientdata 82 - item_getweaponptr 83 - item_itemslot 84 - - weapon_extractammo 85 - weapon_extractclipammo 86 - weapon_addweapon 87 - weapon_playemptysound 88 - weapon_resetemptysound 89 - weapon_sendweaponanim 94 - weapon_isusable 73 - weapon_primaryattack 98 - weapon_secondaryattack 99 - weapon_reload 100 - weapon_weaponidle 101 - weapon_retireweapon 102 - weapon_shouldweaponidle 103 - weapon_usedecrement 104 - - ns_getpointvalue 13 - ns_awardkill 15 - ns_resetentity 45 - ns_updateonremove 51 -@end + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 14 + bloodcolor 16 + tracebleed 17 + istriggered 18 + mymonsterpointer 19 + mysquadmonsterpointer 20 + gettogglestate 21 + addpoints 22 + addpointstoteam 23 + addplayeritem 24 + removeplayeritem 25 + giveammo 26 + getdelay 27 + ismoving 28 + overridereset 29 + damagedecal 30 + settogglestate 31 + startsneaking 32 + stopsneaking 33 + oncontrols 34 + issneaking 35 + isalive 36 + isbspmodel 37 + reflectgauss 38 + hastarget 39 + isinworld 40 + isplayer 41 + isnetclient 42 + teamid 43 + getnexttarget 46 + think 47 + touch 48 + use 49 + blocked 50 + respawn 52 + updateowner 53 + fbecomeprone 54 + center 55 + eyeposition 56 + earposition 57 + bodytarget 58 + illumination 59 + fvisible 60 + fvecvisible 61 -@section ts linux - pev 0 - base 0x60 - - spawn 9 - precache 10 - keyvalue 11 - objectcaps 14 - activate 15 - setobjectcollisionbox 18 - classify 19 - deathnotice 20 - traceattack 21 - takedamage 22 - takehealth 23 - killed 24 - bloodcolor 25 - tracebleed 26 - istriggered 27 - mymonsterpointer 28 - mysquadmonsterpointer 29 - gettogglestate 30 - addpoints 31 - addpointstoteam 32 - addplayeritem 33 - removeplayeritem 34 - giveammo 35 - getdelay 36 - ismoving 37 - overridereset 38 - damagedecal 39 - settogglestate 40 - startsneaking 41 - stopsneaking 42 - oncontrols 43 - issneaking 44 - isalive 45 - isbspmodel 46 - reflectgauss 47 - hastarget 48 - isinworld 49 - isplayer 50 - isnetclient 51 - teamid 52 - getnexttarget 53 - think 54 - touch 55 - use 56 - blocked 57 - respawn 59 - updateowner 60 - fbecomeprone 61 - center 62 - eyeposition 63 - earposition 64 - bodytarget 65 - illumination 66 - fvisible 67 - fvecvisible 68 + changeyaw 65 + hashumangibs 66 + hasaliengibs 67 + fademonster 68 + gibmonster 69 + getdeathactivity 70 + becomedead 71 + irelationship 73 + painsound 74 + reportaistate 75 + monsterinitdead 76 + look 77 + bestvisibleenemy 78 + finviewcone 80 + fvecinviewcone 81 - player_jump 86 - player_duck 87 - player_prethink 88 - player_postthink 89 - player_getgunposition 90 - player_shouldfadeondeath 77 - player_impulsecommands 92 - player_updateclientdata 91 - - item_addtoplayer 70 - item_addduplicate 71 - item_candeploy 73 - item_deploy 74 - item_canholster 75 - item_holster 76 - item_updateiteminfo 77 - item_preframe 78 - item_postframe 79 - item_drop 80 - item_kill 81 - item_attachtoplayer 82 - item_primaryammoindex 83 - item_secondaryammoindex 84 - item_updateclientdata 85 - item_getweaponptr 86 - item_itemslot 87 - - weapon_extractammo 88 - weapon_extractclipammo 89 - weapon_addweapon 90 - weapon_playemptysound 91 - weapon_resetemptysound 92 - weapon_sendweaponanim 93 - weapon_isusable 94 - weapon_primaryattack 95 - weapon_secondaryattack 96 - weapon_reload 98 - weapon_weaponidle 99 - weapon_retireweapon 100 - weapon_shouldweaponidle 101 - weapon_usedecrement 102 - - ts_breakablerespawn 2 - ts_canusedthroughwalls 3 - ts_giveslowmul 4 - ts_goslow 5 - ts_inslow 6 - ts_isobjective 7 - ts_enableobjective 8 - ts_onfreeentprivatedata 12 - ts_shouldcollide 13 - - ts_weapon_alternateattack 97 -@end -@section ts windows - pev 4 - base 0x0 - - spawn 7 - precache 8 - keyvalue 9 - objectcaps 12 - activate 13 - setobjectcollisionbox 16 - classify 17 - deathnotice 18 - traceattack 19 - takedamage 20 - takehealth 21 - killed 22 - bloodcolor 23 - tracebleed 24 - istriggered 25 - mymonsterpointer 26 - mysquadmonsterpointer 27 - gettogglestate 28 - addpoints 29 - addpointstoteam 30 - addplayeritem 31 - removeplayeritem 32 - giveammo 33 - getdelay 34 - ismoving 35 - overridereset 36 - damagedecal 37 - settogglestate 38 - startsneaking 39 - stopsneaking 40 - oncontrols 41 - issneaking 42 - isalive 43 - isbspmodel 44 - reflectgauss 45 - hastarget 46 - isinworld 47 - isplayer 48 - isnetclient 49 - teamid 50 - 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 - fvisible 65 - fvecvisible 66 + player_jump 83 + player_duck 84 + player_prethink 85 + player_postthink 86 + player_getgunposition 87 + player_shouldfadeondeath 72 + player_impulsecommands 101 + player_updateclientdata 99 + + item_addtoplayer 64 + item_addduplicate 65 + item_getiteminfo 68 + item_candeploy 69 + item_deploy 70 + item_canholster 71 + item_holster 72 + item_updateiteminfo 74 + item_preframe 75 + item_postframe 76 + item_drop 77 + item_kill 78 + item_attachtoplayer 79 + item_primaryammoindex 80 + item_secondaryammoindex 81 + item_updateclientdata 82 + item_getweaponptr 83 + item_itemslot 84 + + weapon_extractammo 85 + weapon_extractclipammo 86 + weapon_addweapon 87 + weapon_playemptysound 88 + weapon_resetemptysound 89 + weapon_sendweaponanim 94 + weapon_isusable 73 + weapon_primaryattack 98 + weapon_secondaryattack 99 + weapon_reload 100 + weapon_weaponidle 101 + weapon_retireweapon 102 + weapon_shouldweaponidle 103 + weapon_usedecrement 104 + + ns_getpointvalue 13 + ns_awardkill 15 + ns_resetentity 45 + ns_updateonremove 51 + ns_setbonecontroller 63 + ns_savedataforreset 64 + ns_gethull 79 + ns_getmaxwalkspeed 88 + ns_setteamid 90 + ns_geteffectiveplayerclass 91 + ns_getauthenticationmask 92 + ns_effectiveplayerclasschanged 93 + ns_needsteamupdate 94 + ns_sendteamupdate 95 + ns_sendweaponupdate 96 + ns_initplayerfromspawn 97 + ns_packdeadplayeritems 98 + ns_getanimationforactivity 100 + ns_startobserver 102 + ns_stopobserver 103 + ns_getadrenalinefactor 104 + ns_givenameditem 106 + ns_suicide 107 + ns_getcanuseweapon 108 - player_jump 84 - player_duck 85 - player_prethink 86 - player_postthink 87 - player_getgunposition 88 - player_shouldfadeondeath 75 - player_impulsecommands 90 - player_updateclientdata 89 - - item_addtoplayer 68 - item_addduplicate 69 - item_candeploy 71 - item_deploy 72 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 85 - - weapon_extractammo 86 - weapon_extractclipammo 87 - weapon_addweapon 88 - weapon_playemptysound 89 - weapon_resetemptysound 90 - weapon_sendweaponanim 91 - weapon_isusable 92 - weapon_primaryattack 93 - weapon_secondaryattack 94 - weapon_reload 96 - weapon_weaponidle 97 - weapon_retireweapon 98 - weapon_shouldweaponidle 99 - weapon_usedecrement 100 - - ts_breakablerespawn 0 - ts_canusedthroughwalls 1 - ts_giveslowmul 2 - ts_goslow 3 - ts_inslow 4 - ts_isobjective 5 - ts_enableobjective 6 - ts_onfreeentprivatedata 10 - ts_shouldcollide 11 - - ts_weapon_alternateattack 95 -@end + ns_weapon_getweaponprimetime 90 + ns_weapon_primeweapon 91 + ns_weapon_getisweaponprimed 92 + ns_weapon_getisweaponpriming 93 + ns_weapon_defaultdeploy 95 + ns_weapon_defaultreload 96 + ns_weapon_getdeploytime 97 +@end + +@section ns windows + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 14 + bloodcolor 16 + tracebleed 17 + istriggered 18 + mymonsterpointer 19 + mysquadmonsterpointer 20 + gettogglestate 21 + addpoints 22 + addpointstoteam 23 + addplayeritem 24 + removeplayeritem 25 + giveammo 26 + getdelay 27 + ismoving 28 + overridereset 29 + damagedecal 30 + settogglestate 31 + startsneaking 32 + stopsneaking 33 + oncontrols 34 + issneaking 35 + isalive 36 + isbspmodel 37 + reflectgauss 38 + hastarget 39 + isinworld 40 + isplayer 41 + isnetclient 42 + teamid 43 + getnexttarget 46 + think 47 + touch 48 + use 49 + blocked 50 + respawn 52 + updateowner 53 + fbecomeprone 54 + center 55 + eyeposition 56 + earposition 57 + bodytarget 58 + illumination 59 + fvisible 60 + fvecvisible 61 + changeyaw 65 + hashumangibs 66 + hasaliengibs 67 + fademonster 68 + gibmonster 69 + getdeathactivity 70 + becomedead 71 + irelationship 73 + painsound 74 + reportaistate 75 + monsterinitdead 76 + look 77 + bestvisibleenemy 78 + finviewcone 80 + fvecinviewcone 81 + + player_jump 83 + player_duck 84 + player_prethink 85 + player_postthink 86 + player_getgunposition 87 + player_shouldfadeondeath 72 + player_impulsecommands 101 + player_updateclientdata 99 + + item_addtoplayer 64 + item_addduplicate 65 + item_getiteminfo 68 + item_candeploy 69 + item_deploy 70 + item_canholster 71 + item_holster 72 + item_updateiteminfo 74 + item_preframe 75 + item_postframe 76 + item_drop 77 + item_kill 78 + item_attachtoplayer 79 + item_primaryammoindex 80 + item_secondaryammoindex 81 + item_updateclientdata 82 + item_getweaponptr 83 + item_itemslot 84 + + weapon_extractammo 85 + weapon_extractclipammo 86 + weapon_addweapon 87 + weapon_playemptysound 88 + weapon_resetemptysound 89 + weapon_sendweaponanim 94 + weapon_isusable 73 + weapon_primaryattack 98 + weapon_secondaryattack 99 + weapon_reload 100 + weapon_weaponidle 101 + weapon_retireweapon 102 + weapon_shouldweaponidle 103 + weapon_usedecrement 104 + + ns_getpointvalue 13 + ns_awardkill 15 + ns_resetentity 45 + ns_updateonremove 51 + ns_setbonecontroller 63 + ns_savedataforreset 64 + ns_gethull 79 + ns_getmaxwalkspeed 88 + ns_setteamid 90 + ns_geteffectiveplayerclass 91 + ns_getauthenticationmask 92 + ns_effectiveplayerclasschanged 93 + ns_needsteamupdate 94 + ns_sendteamupdate 95 + ns_sendweaponupdate 96 + ns_initplayerfromspawn 97 + ns_packdeadplayeritems 98 + ns_getanimationforactivity 100 + ns_startobserver 102 + ns_stopobserver 103 + ns_getadrenalinefactor 104 + ns_givenameditem 106 + ns_suicide 107 + ns_getcanuseweapon 108 + + ns_weapon_getweaponprimetime 90 + ns_weapon_primeweapon 91 + ns_weapon_getisweaponprimed 92 + ns_weapon_getisweaponpriming 93 + ns_weapon_defaultdeploy 95 + ns_weapon_defaultreload 96 + ns_weapon_getdeploytime 97 +@end + +@section ts linux + pev 0 + base 0x60 + + spawn 9 + precache 10 + keyvalue 11 + objectcaps 14 + activate 15 + setobjectcollisionbox 18 + classify 19 + deathnotice 20 + traceattack 21 + takedamage 22 + takehealth 23 + killed 24 + bloodcolor 25 + tracebleed 26 + istriggered 27 + mymonsterpointer 28 + mysquadmonsterpointer 29 + gettogglestate 30 + addpoints 31 + addpointstoteam 32 + addplayeritem 33 + removeplayeritem 34 + giveammo 35 + getdelay 36 + ismoving 37 + overridereset 38 + damagedecal 39 + settogglestate 40 + startsneaking 41 + stopsneaking 42 + oncontrols 43 + issneaking 44 + isalive 45 + isbspmodel 46 + reflectgauss 47 + hastarget 48 + isinworld 49 + isplayer 50 + isnetclient 51 + teamid 52 + getnexttarget 53 + think 54 + touch 55 + use 56 + blocked 57 + respawn 59 + updateowner 60 + fbecomeprone 61 + center 62 + eyeposition 63 + earposition 64 + bodytarget 65 + illumination 66 + fvisible 67 + fvecvisible 68 + + changeyaw 70 + hashumangibs 71 + hasaliengibs 72 + fademonster 73 + gibmonster 74 + getdeathactivity 75 + becomedead 76 + irelationship 78 + painsound 79 + reportaistate 80 + monsterinitdead 81 + look 82 + bestvisibleenemy 83 + finviewcone 84 + fvecinviewcone 85 + + player_jump 86 + player_duck 87 + player_prethink 88 + player_postthink 89 + player_getgunposition 90 + player_shouldfadeondeath 77 + player_impulsecommands 92 + player_updateclientdata 91 + + item_addtoplayer 70 + item_addduplicate 71 + item_candeploy 73 + item_deploy 74 + item_canholster 75 + item_holster 76 + item_updateiteminfo 77 + item_preframe 78 + item_postframe 79 + item_drop 80 + item_kill 81 + item_attachtoplayer 82 + item_primaryammoindex 83 + item_secondaryammoindex 84 + item_updateclientdata 85 + item_getweaponptr 86 + item_itemslot 87 + + weapon_extractammo 88 + weapon_extractclipammo 89 + weapon_addweapon 90 + weapon_playemptysound 91 + weapon_resetemptysound 92 + weapon_sendweaponanim 93 + weapon_isusable 94 + weapon_primaryattack 95 + weapon_secondaryattack 96 + weapon_reload 98 + weapon_weaponidle 99 + weapon_retireweapon 100 + weapon_shouldweaponidle 101 + weapon_usedecrement 102 + + ts_breakablerespawn 2 + ts_canusedthroughwalls 3 + ts_giveslowmul 4 + ts_goslow 5 + ts_inslow 6 + ts_isobjective 7 + ts_enableobjective 8 + ts_onfreeentprivatedata 12 + ts_shouldcollide 13 + + ts_weapon_alternateattack 97 +@end +@section ts windows + pev 4 + base 0x0 + + spawn 7 + precache 8 + keyvalue 9 + objectcaps 12 + activate 13 + setobjectcollisionbox 16 + classify 17 + deathnotice 18 + traceattack 19 + takedamage 20 + takehealth 21 + killed 22 + bloodcolor 23 + tracebleed 24 + istriggered 25 + mymonsterpointer 26 + mysquadmonsterpointer 27 + gettogglestate 28 + addpoints 29 + addpointstoteam 30 + addplayeritem 31 + removeplayeritem 32 + giveammo 33 + getdelay 34 + ismoving 35 + overridereset 36 + damagedecal 37 + settogglestate 38 + startsneaking 39 + stopsneaking 40 + oncontrols 41 + issneaking 42 + isalive 43 + isbspmodel 44 + reflectgauss 45 + hastarget 46 + isinworld 47 + isplayer 48 + isnetclient 49 + teamid 50 + 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 + fvisible 65 + fvecvisible 66 + + changeyaw 68 + hashumangibs 69 + hasaliengibs 70 + fademonster 71 + gibmonster 72 + getdeathactivity 73 + becomedead 74 + irelationship 76 + painsound 77 + reportaistate 78 + monsterinitdead 79 + look 80 + bestvisibleenemy 81 + finviewcone 82 + fvecinviewcone 83 + + player_jump 84 + player_duck 85 + player_prethink 86 + player_postthink 87 + player_getgunposition 88 + player_shouldfadeondeath 75 + player_impulsecommands 90 + player_updateclientdata 89 + + item_addtoplayer 68 + item_addduplicate 69 + item_candeploy 71 + item_deploy 72 + item_canholster 73 + item_holster 74 + item_updateiteminfo 75 + item_preframe 76 + item_postframe 77 + item_drop 78 + item_kill 79 + item_attachtoplayer 80 + item_primaryammoindex 81 + item_secondaryammoindex 82 + item_updateclientdata 83 + item_getweaponptr 84 + item_itemslot 85 + + weapon_extractammo 86 + weapon_extractclipammo 87 + weapon_addweapon 88 + weapon_playemptysound 89 + weapon_resetemptysound 90 + weapon_sendweaponanim 91 + weapon_isusable 92 + weapon_primaryattack 93 + weapon_secondaryattack 94 + weapon_reload 96 + weapon_weaponidle 97 + weapon_retireweapon 98 + weapon_shouldweaponidle 99 + weapon_usedecrement 100 + + ts_breakablerespawn 0 + ts_canusedthroughwalls 1 + ts_giveslowmul 2 + ts_goslow 3 + ts_inslow 4 + ts_isobjective 5 + ts_enableobjective 6 + ts_onfreeentprivatedata 10 + ts_shouldcollide 11 + + ts_weapon_alternateattack 95 +@end + +; Sven-Coop 4.8 +@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 + + 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 + + player_getgunposition 157 + player_jump 179 + player_duck 180 + player_prethink 181 + player_postthink 182 + player_updateclientdata 184 + player_impulsecommands 185 + + 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 + + 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 + + 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_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_item_materialize 79 + + 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 +@end + +; Sven-Coop 4.8 +@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 + + 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 + + player_getgunposition 156 + player_jump 178 + player_duck 179 + player_prethink 180 + player_postthink 181 + player_updateclientdata 183 + player_impulsecommands 184 + + 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 + + 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 + + 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_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_item_materialize 78 + + 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 +@end + +; Earth's Special Forces 1.2.3 +@section esf linux + pev 0 + base 0x60 + + spawn 2 + precache 3 + keyvalue 4 + objectcaps 7 + activate 8 + setobjectcollisionbox 9 + classify 10 + deathnotice 11 + traceattack 12 + takedamage 13 + takehealth 14 + killed 15 + bloodcolor 16 + tracebleed 17 + istriggered 18 + mymonsterpointer 19 + mysquadmonsterpointer 20 + gettogglestate 21 + addpoints 22 + addpointstoteam 23 + addplayeritem 24 + removeplayeritem 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 + isnetclient 41 + teamid 42 + getnexttarget 43 + think 44 + touch 45 + use 46 + blocked 47 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 + fvisible 56 + fvecvisible 57 + + look 59 + changeyaw 62 + irelationship 64 + monsterinitdead 66 + becomedead 67 + bestvisibleenemy 69 + finviewcone 70 + fvecinviewcone 71 + + runai 60 + monsterthink 63 + monsterinit 65 + checklocalmove 72 + move 73 + moveexecute 74 + shouldadvanceroute 75 + getstoppedactivity 76 + stop 77 + checkrangeattack1 78 + checkrangeattack2 79 + checkmeleeattack1 80 + checkmeleeattack2 81 + schedulechange 87 + canplaysequence 88 + canplaysentence 89 + playsentence 90 + playscriptedsentence 91 + sentencestop 92 + getidealstate 93 + setactivity 94 + reportaistate 95 + checkenemy 96 + ftriangulate 97 + setyawspeed 98 + buildnearestroute 99 + findcover 100 + coverradius 102 + fcancheckattacks 103 + checkammo 104 + ignoreconditions 105 + fvalidatehinttype 106 + fcanactiveidle 107 + isoundmask 108 + hearingsensitivity 111 + barnaclevictimbitten 112 + barnaclevictimreleased 113 + preschedulethink 114 + getdeathactivity 115 + gibmonster 116 + hashumangibs 117 + hasaliengibs 118 + fademonster 119 + deathsound 121 + alertsound 122 + idlesound 123 + painsound 124 + stopfollowing 125 + + player_jump 126 + player_prethink 127 + player_postthink 128 + player_getgunposition 120 + player_shouldfadeondeath 61 + player_impulsecommands 130 + player_updateclientdata 129 + + item_addtoplayer 59 + item_addduplicate 60 + item_getiteminfo 61 + item_candeploy 62 + item_deploy 63 + item_canholster 64 + item_holster 65 + item_updateiteminfo 66 + item_preframe 67 + item_postframe 68 + item_drop 69 + item_kill 70 + item_attachtoplayer 71 + item_primaryammoindex 72 + item_secondaryammoindex 73 + item_updateclientdata 74 + item_getweaponptr 75 + item_itemslot 76 + + weapon_playemptysound 77 + weapon_resetemptysound 78 + weapon_sendweaponanim 79 + weapon_primaryattack 80 + weapon_secondaryattack 81 + weapon_weaponidle 82 + weapon_retireweapon 83 + weapon_shouldweaponidle 84 + weapon_usedecrement 85 + + esf_weapon_holsterwhenmeleed 86 +@end @section esf windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 takehealth 12 killed 13 bloodcolor 14 @@ -1536,7 +2792,65 @@ illumination 53 fvisible 54 fvecvisible 55 + + look 57 + changeyaw 60 + irelationship 62 + monsterinitdead 64 + becomedead 65 + bestvisibleenemy 67 + finviewcone 68 + fvecinviewcone 69 + runai 58 + monsterthink 61 + monsterinit 63 + checklocalmove 70 + move 71 + moveexecute 72 + shouldadvanceroute 73 + getstoppedactivity 74 + stop 75 + checkrangeattack1 76 + checkrangeattack2 77 + checkmeleeattack1 78 + checkmeleeattack2 79 + schedulechange 85 + canplaysequence 86 + canplaysentence 87 + playsentence 88 + playscriptedsentence 89 + sentencestop 90 + getidealstate 91 + setactivity 92 + reportaistate 93 + checkenemy 94 + ftriangulate 95 + setyawspeed 96 + buildnearestroute 97 + findcover 98 + coverradius 100 + fcancheckattacks 101 + checkammo 102 + ignoreconditions 103 + fvalidatehinttype 104 + fcanactiveidle 105 + isoundmask 106 + hearingsensitivity 109 + barnaclevictimbitten 110 + barnaclevictimreleased 111 + preschedulethink 112 + getdeathactivity 113 + gibmonster 114 + hashumangibs 115 + hasaliengibs 116 + fademonster 117 + deathsound 119 + alertsound 120 + idlesound 121 + painsound 122 + stopfollowing 123 + player_jump 124 player_prethink 125 player_postthink 126 @@ -1573,102 +2887,8 @@ weapon_retireweapon 81 weapon_shouldweaponidle 82 weapon_usedecrement 83 -@end -@section esf linux - pev 0 - base 0x60 - - spawn 2 - precache 3 - keyvalue 4 - objectcaps 7 - activate 8 - setobjectcollisionbox 9 - classify 10 - deathnotice 11 - traceattack 12 - takedamage 13 - takehealth 14 - killed 15 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addpoints 22 - addpointstoteam 23 - addplayeritem 24 - removeplayeritem 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 120 - player_shouldfadeondeath 61 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 63 - item_canholster 64 - item_holster 65 - item_updateiteminfo 66 - item_preframe 67 - item_postframe 68 - item_drop 69 - item_kill 70 - item_attachtoplayer 71 - item_primaryammoindex 72 - item_secondaryammoindex 73 - item_updateclientdata 74 - item_getweaponptr 75 - item_itemslot 76 - - weapon_playemptysound 77 - weapon_resetemptysound 78 - weapon_sendweaponanim 79 - weapon_primaryattack 80 - weapon_secondaryattack 81 - weapon_weaponidle 82 - weapon_retireweapon 83 - weapon_shouldweaponidle 84 - weapon_usedecrement 85 + + esf_weapon_holsterwhenmeleed 84 @end ; ESF Open Beta is built with GCC 3.x, and the VTable was slightly changed @@ -1701,118 +2921,1147 @@ getdelay 25 ismoving 26 overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 + damagedecal 28 + settogglestate 29 + startsneaking 30 + stopsneaking 31 + oncontrols 32 + issneaking 33 + isalive 34 + isbspmodel 35 + reflectgauss 36 + hastarget 37 + isinworld 38 + isplayer 39 + isnetclient 43 + teamid 44 + getnexttarget 47 + think 48 + touch 49 + use 50 + blocked 51 + respawn 52 + updateowner 53 + fbecomeprone 54 + center 55 + eyeposition 56 + earposition 57 + bodytarget 58 + illumination 59 + fvisible 60 + fvecvisible 61 + + look 63 + changeyaw 66 + irelationship 68 + monsterinitdead 70 + becomedead 71 + bestvisibleenemy 73 + finviewcone 74 + fvecinviewcone 75 + + runai 64 + monsterthink 67 + monsterinit 69 + checklocalmove 76 + move 77 + moveexecute 78 + shouldadvanceroute 79 + getstoppedactivity 80 + stop 81 + checkrangeattack1 82 + checkrangeattack2 83 + checkmeleeattack1 84 + checkmeleeattack2 85 + schedulechange 91 + canplaysequence 92 + canplaysentence 93 + playsentence 94 + playscriptedsentence 95 + sentencestop 96 + getidealstate 97 + setactivity 98 + reportaistate 99 + checkenemy 100 + ftriangulate 101 + setyawspeed 102 + buildnearestroute 103 + findcover 104 + coverradius 106 + fcancheckattacks 107 + checkammo 108 + ignoreconditions 109 + fvalidatehinttype 110 + fcanactiveidle 111 + isoundmask 112 + hearingsensitivity 115 + barnaclevictimbitten 116 + barnaclevictimreleased 117 + preschedulethink 118 + getdeathactivity 119 + gibmonster 120 + hashumangibs 121 + hasaliengibs 122 + fademonster 123 + deathsound 125 + alertsound 126 + idlesound 127 + painsound 128 + stopfollowing 129 + + player_updateclientdata 186 + player_jump 187 + player_prethink 189 + player_postthink 190 + player_getgunposition 124 + player_shouldfadeondeath 65 + player_impulsecommands 193 + + item_addtoplayer 63 + item_addduplicate 64 + item_getiteminfo 65 + item_candeploy 66 + item_deploy 67 + item_canholster 68 + item_holster 69 + item_updateiteminfo 70 + item_preframe 71 + item_postframe 72 + item_drop 73 + item_kill 74 + item_attachtoplayer 75 + item_primaryammoindex 76 + item_secondaryammoindex 77 + item_updateclientdata 78 + item_getweaponptr 79 + item_itemslot 80 + + weapon_playemptysound 81 + weapon_resetemptysound 82 + weapon_sendweaponanim 83 + weapon_primaryattack 84 + weapon_secondaryattack 85 + weapon_weaponidle 86 + weapon_retireweapon 87 + weapon_shouldweaponidle 88 + weapon_usedecrement 89 + + esf_isenvmodel 40 + esf_takedamage2 12 + esf_isfighter 41 + esf_isbuddy 42 + esf_emitsound 45 + esf_emitnullsound 46 + esf_increasestrength 130 + esf_increasepl 131 + esf_setpowerlevel 132 + esf_setmaxpowerlevel 133 + esf_stopanitrigger 134 + esf_stopfly 135 + esf_hideweapon 136 + esf_clientremoveweapon 137 + esf_sendclientcustommodel 138 + esf_canturbo 139 + esf_canprimaryfire 140 + esf_cansecondaryfire 141 + esf_canstopfly 142 + esf_canblock 143 + esf_canraiseKi 144 + esf_canraisestamina 145 + esf_canteleport 146 + esf_canstartfly 147 + esf_canstartpowerup 148 + esf_canjump 149 + esf_canwalljump 150 + esf_issuperjump 151 + esf_ismoveback 152 + esf_checkwalljump 153 + esf_enablewalljump 154 + esf_disablewalljump 155 + esf_resetwalljumpvars 156 + esf_getwalljumpanim 157 + esf_getwalljumpanim2 158 + esf_setwalljumpanimation 159 + esf_setflymovetype 160 + esf_isflymovetype 161 + esf_iswalkmovetype 162 + esf_setwalkmovetype 163 + esf_drawchargebar 164 + esf_startblock 165 + esf_stopblock 166 + esf_startfly 167 + esf_getmaxspeed 168 + esf_setanimation 169 + esf_playanimation 170 + esf_getmoveforward 171 + esf_getmoveright 172 + esf_getmoveup 173 + esf_addblindfx 174 + esf_removeblindfx 175 + esf_disablepsbar 176 + esf_addbeamboxcrosshair 177 + esf_removebeamboxcrosshair 178 + esf_drawpswinbonus 179 + esf_drawpsbar 180 + esf_lockcrosshair 181 + esf_unlockcrosshair 182 + esf_rotatecrosshair 183 + esf_unrotatecrosshair 184 + esf_watermove 185 + esf_checktimebaseddamage 188 + esf_doessecondaryattack 191 + esf_doesprimaryattack 192 + esf_removespecialmodes 194 + esf_stopturbo 195 + esf_takebean 196 + esf_getpowerlevel 197 + esf_removeallotherweapons 198 + esf_stopswoop 199 + esf_setdeathanimation 201 + esf_setmodel 202 + esf_addattacks 203 + esf_emitclasssound 205 + esf_checklightning 206 + esf_freezecontrols 207 + esf_unfreezecontrols 208 + esf_updateki 209 + esf_updatehealth 210 + esf_getteleportdir 211 + + esf_weapon_holsterwhenmeleed 90 + +@end +@section esf_openbeta windows + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 13 + killed 14 + bloodcolor 15 + tracebleed 16 + istriggered 17 + mymonsterpointer 18 + mysquadmonsterpointer 19 + gettogglestate 20 + addpoints 21 + addpointstoteam 22 + addplayeritem 23 + removeplayeritem 24 + getdelay 25 + ismoving 26 + overridereset 27 + damagedecal 28 + settogglestate 29 + startsneaking 30 + stopsneaking 31 + oncontrols 32 + issneaking 33 + isalive 34 + isbspmodel 35 + reflectgauss 36 + hastarget 37 + isinworld 38 + isplayer 39 + isnetclient 43 + teamid 44 + getnexttarget 47 + think 48 + touch 49 + use 50 + blocked 51 + respawn 52 + updateowner 53 + fbecomeprone 54 + center 55 + eyeposition 56 + earposition 57 + bodytarget 58 + illumination 59 + fvisible 60 + fvecvisible 61 + + look 63 + changeyaw 66 + irelationship 68 + monsterinitdead 70 + becomedead 71 + bestvisibleenemy 73 + finviewcone 74 + fvecinviewcone 75 + + runai 64 + monsterthink 67 + monsterinit 69 + checklocalmove 76 + move 77 + moveexecute 78 + shouldadvanceroute 79 + getstoppedactivity 80 + stop 81 + checkrangeattack1 82 + checkrangeattack2 83 + checkmeleeattack1 84 + checkmeleeattack2 85 + schedulechange 91 + canplaysequence 92 + canplaysentence 93 + playsentence 94 + playscriptedsentence 95 + sentencestop 96 + getidealstate 97 + setactivity 98 + reportaistate 99 + checkenemy 100 + ftriangulate 101 + setyawspeed 102 + buildnearestroute 103 + findcover 104 + coverradius 106 + fcancheckattacks 107 + checkammo 108 + ignoreconditions 109 + fvalidatehinttype 110 + fcanactiveidle 111 + isoundmask 112 + hearingsensitivity 115 + barnaclevictimbitten 116 + barnaclevictimreleased 117 + preschedulethink 118 + getdeathactivity 119 + gibmonster 120 + hashumangibs 121 + hasaliengibs 122 + fademonster 123 + deathsound 125 + alertsound 126 + idlesound 127 + painsound 128 + stopfollowing 129 + + player_updateclientdata 186 + player_jump 187 + player_prethink 189 + player_postthink 190 + player_getgunposition 124 + player_shouldfadeondeath 65 + player_impulsecommands 193 + + item_addtoplayer 63 + item_addduplicate 64 + item_getiteminfo 65 + item_candeploy 66 + item_deploy 67 + item_canholster 68 + item_holster 69 + item_updateiteminfo 70 + item_preframe 71 + item_postframe 72 + item_drop 73 + item_kill 74 + item_attachtoplayer 75 + item_primaryammoindex 76 + item_secondaryammoindex 77 + item_updateclientdata 78 + item_getweaponptr 79 + item_itemslot 80 + + weapon_playemptysound 81 + weapon_resetemptysound 82 + weapon_sendweaponanim 83 + weapon_primaryattack 84 + weapon_secondaryattack 85 + weapon_weaponidle 86 + weapon_retireweapon 87 + weapon_shouldweaponidle 88 + weapon_usedecrement 89 + + esf_isenvmodel 40 + esf_takedamage2 12 + esf_isfighter 41 + esf_isbuddy 42 + esf_emitsound 45 + esf_emitnullsound 46 + esf_increasestrength 130 + esf_increasepl 131 + esf_setpowerlevel 132 + esf_setmaxpowerlevel 133 + esf_stopanitrigger 134 + esf_stopfly 135 + esf_hideweapon 136 + esf_clientremoveweapon 137 + esf_sendclientcustommodel 138 + esf_canturbo 139 + esf_canprimaryfire 140 + esf_cansecondaryfire 141 + esf_canstopfly 142 + esf_canblock 143 + esf_canraiseKi 144 + esf_canraisestamina 145 + esf_canteleport 146 + esf_canstartfly 147 + esf_canstartpowerup 148 + esf_canjump 149 + esf_canwalljump 150 + esf_issuperjump 151 + esf_ismoveback 152 + esf_checkwalljump 153 + esf_enablewalljump 154 + esf_disablewalljump 155 + esf_resetwalljumpvars 156 + esf_getwalljumpanim 157 + esf_getwalljumpanim2 158 + esf_setwalljumpanimation 159 + esf_setflymovetype 160 + esf_isflymovetype 161 + esf_iswalkmovetype 162 + esf_setwalkmovetype 163 + esf_drawchargebar 164 + esf_startblock 165 + esf_stopblock 166 + esf_startfly 167 + esf_getmaxspeed 168 + esf_setanimation 169 + esf_playanimation 170 + esf_getmoveforward 171 + esf_getmoveright 172 + esf_getmoveup 173 + esf_addblindfx 174 + esf_removeblindfx 175 + esf_disablepsbar 176 + esf_addbeamboxcrosshair 177 + esf_removebeamboxcrosshair 178 + esf_drawpswinbonus 179 + esf_drawpsbar 180 + esf_lockcrosshair 181 + esf_unlockcrosshair 182 + esf_rotatecrosshair 183 + esf_unrotatecrosshair 184 + esf_watermove 185 + esf_checktimebaseddamage 188 + esf_doessecondaryattack 191 + esf_doesprimaryattack 192 + esf_removespecialmodes 194 + esf_stopturbo 195 + esf_takebean 196 + esf_getpowerlevel 197 + esf_removeallotherweapons 198 + esf_stopswoop 199 + esf_setdeathanimation 201 + esf_setmodel 202 + esf_addattacks 203 + esf_emitclasssound 205 + esf_checklightning 206 + esf_freezecontrols 207 + esf_unfreezecontrols 208 + esf_updateki 209 + esf_updatehealth 210 + esf_getteleportdir 211 + + esf_weapon_holsterwhenmeleed 90 + +@end +@section valve linux + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 + gettogglestate 19 + addpoints 20 + addpointstoteam 21 + addplayeritem 22 + removeplayeritem 23 + giveammo 24 + getdelay 25 + ismoving 26 + overridereset 27 + damagedecal 28 + settogglestate 29 + startsneaking 30 + stopsneaking 31 + oncontrols 32 + issneaking 33 + isalive 34 + isbspmodel 35 + reflectgauss 36 + hastarget 37 + isinworld 38 + isplayer 39 + isnetclient 40 + teamid 41 + getnexttarget 42 + think 43 + touch 44 + use 45 + blocked 46 + respawn 47 + updateowner 48 + fbecomeprone 49 + center 50 + eyeposition 51 + earposition 52 + bodytarget 53 + illumination 54 + fvisible 55 + fvecvisible 56 + + look 58 + changeyaw 61 + irelationship 63 + monsterinitdead 65 + becomedead 66 + bestvisibleenemy 68 + finviewcone 69 + fvecinviewcone 70 + + runai 59 + monsterthink 62 + monsterinit 64 + checklocalmove 71 + move 72 + moveexecute 73 + shouldadvanceroute 74 + getstoppedactivity 75 + stop 76 + checkrangeattack1 77 + checkrangeattack2 78 + checkmeleeattack1 79 + checkmeleeattack2 80 + schedulechange 86 + canplaysequence 87 + canplaysentence 88 + playsentence 89 + playscriptedsentence 90 + sentencestop 91 + getidealstate 92 + setactivity 93 + reportaistate 94 + checkenemy 95 + ftriangulate 96 + setyawspeed 97 + buildnearestroute 98 + findcover 99 + coverradius 101 + fcancheckattacks 102 + checkammo 103 + ignoreconditions 104 + fvalidatehinttype 105 + fcanactiveidle 106 + isoundmask 107 + hearingsensitivity 110 + barnaclevictimbitten 111 + barnaclevictimreleased 112 + preschedulethink 113 + getdeathactivity 114 + gibmonster 115 + hashumangibs 116 + hasaliengibs 117 + fademonster 118 + deathsound 120 + alertsound 121 + idlesound 122 + painsound 123 + stopfollowing 124 + + player_jump 125 + player_duck 126 + player_prethink 127 + player_postthink 128 + player_getgunposition 119 + player_shouldfadeondeath 60 + player_impulsecommands 130 + player_updateclientdata 129 + + item_addtoplayer 58 + item_addduplicate 59 + item_getiteminfo 60 + item_candeploy 61 + item_deploy 62 + item_canholster 63 + item_holster 64 + item_updateiteminfo 65 + item_preframe 66 + item_postframe 67 + item_drop 68 + item_kill 69 + item_attachtoplayer 70 + item_primaryammoindex 71 + item_secondaryammoindex 72 + item_updateclientdata 73 + item_getweaponptr 74 + item_itemslot 75 + + weapon_extractammo 76 + weapon_extractclipammo 77 + weapon_addweapon 78 + weapon_playemptysound 79 + weapon_resetemptysound 80 + weapon_sendweaponanim 81 + weapon_isusable 82 + weapon_primaryattack 83 + weapon_secondaryattack 84 + weapon_reload 85 + weapon_weaponidle 86 + weapon_retireweapon 87 + weapon_shouldweaponidle 88 + weapon_usedecrement 89 +@end +@section valve windows + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 + gettogglestate 19 + addpoints 20 + addpointstoteam 21 + addplayeritem 22 + removeplayeritem 23 + giveammo 24 + getdelay 25 + ismoving 26 + overridereset 27 + damagedecal 28 + settogglestate 29 + startsneaking 30 + stopsneaking 31 + oncontrols 32 + issneaking 33 + isalive 34 + isbspmodel 35 + reflectgauss 36 + hastarget 37 + isinworld 38 + isplayer 39 + isnetclient 40 + teamid 41 + getnexttarget 42 + think 43 + touch 44 + use 45 + blocked 46 + respawn 47 + updateowner 48 + fbecomeprone 49 + center 50 + eyeposition 51 + earposition 52 + bodytarget 53 + illumination 54 + fvisible 55 + fvecvisible 56 + + look 58 + changeyaw 61 + irelationship 63 + monsterinitdead 65 + becomedead 66 + bestvisibleenemy 68 + finviewcone 69 + fvecinviewcone 70 - player_jump 131 - player_prethink 132 - player_postthink 133 - player_getgunposition 120 - player_shouldfadeondeath 61 - player_impulsecommands 135 - player_updateclientdata 134 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 63 - item_canholster 64 - item_holster 65 - item_updateiteminfo 66 - item_preframe 67 - item_postframe 68 - item_drop 69 - item_kill 70 - item_attachtoplayer 71 - item_primaryammoindex 72 - item_secondaryammoindex 73 - item_updateclientdata 74 - item_getweaponptr 75 - item_itemslot 76 - - weapon_playemptysound 77 - weapon_resetemptysound 78 - weapon_sendweaponanim 79 - weapon_primaryattack 80 - weapon_secondaryattack 81 - weapon_weaponidle 82 - weapon_retireweapon 83 - weapon_shouldweaponidle 84 - weapon_usedecrement 85 - - esf_isenvmodel 40 - esf_takedamage2 12 - -@end -@section esf_openbeta windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 + runai 59 + monsterthink 62 + monsterinit 64 + checklocalmove 71 + move 72 + moveexecute 73 + shouldadvanceroute 74 + getstoppedactivity 75 + stop 76 + checkrangeattack1 77 + checkrangeattack2 78 + checkmeleeattack1 79 + checkmeleeattack2 80 + schedulechange 86 + canplaysequence 87 + canplaysentence 88 + playsentence 89 + playscriptedsentence 90 + sentencestop 91 + getidealstate 92 + setactivity 93 + reportaistate 94 + checkenemy 95 + ftriangulate 96 + setyawspeed 97 + buildnearestroute 98 + findcover 99 + coverradius 101 + fcancheckattacks 102 + checkammo 103 + ignoreconditions 104 + fvalidatehinttype 105 + fcanactiveidle 106 + isoundmask 107 + hearingsensitivity 110 + barnaclevictimbitten 111 + barnaclevictimreleased 112 + preschedulethink 113 + getdeathactivity 114 + gibmonster 115 + hashumangibs 116 + hasaliengibs 117 + fademonster 118 + deathsound 120 + alertsound 121 + idlesound 122 + painsound 123 + stopfollowing 124 + + player_jump 125 + player_duck 126 + player_prethink 127 + player_postthink 128 + player_getgunposition 119 + player_shouldfadeondeath 60 + player_impulsecommands 130 + player_updateclientdata 129 + + item_addtoplayer 58 + item_addduplicate 59 + item_getiteminfo 60 + item_candeploy 61 + item_deploy 62 + item_canholster 63 + item_holster 64 + item_updateiteminfo 65 + item_preframe 66 + item_postframe 67 + item_drop 68 + item_kill 69 + item_attachtoplayer 70 + item_primaryammoindex 71 + item_secondaryammoindex 72 + item_updateclientdata 73 + item_getweaponptr 74 + item_itemslot 75 + + weapon_extractammo 76 + weapon_extractclipammo 77 + weapon_addweapon 78 + weapon_playemptysound 79 + weapon_resetemptysound 80 + weapon_sendweaponanim 81 + weapon_isusable 82 + weapon_primaryattack 83 + weapon_secondaryattack 84 + weapon_reload 85 + weapon_weaponidle 86 + weapon_retireweapon 87 + weapon_shouldweaponidle 88 + weapon_usedecrement 89 +@end + +@section valve mac + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 + gettogglestate 19 + addpoints 20 + addpointstoteam 21 + addplayeritem 22 + removeplayeritem 23 + giveammo 24 + getdelay 25 + ismoving 26 + overridereset 27 + damagedecal 28 + settogglestate 29 + startsneaking 30 + stopsneaking 31 + oncontrols 32 + issneaking 33 + isalive 34 + isbspmodel 35 + reflectgauss 36 + hastarget 37 + isinworld 38 + isplayer 39 + isnetclient 40 + teamid 41 + getnexttarget 42 + think 43 + touch 44 + use 45 + blocked 46 + respawn 47 + updateowner 48 + fbecomeprone 49 + center 50 + eyeposition 51 + earposition 52 + bodytarget 53 + illumination 54 + fvisible 55 + fvecvisible 56 + + look 58 + changeyaw 61 + irelationship 63 + monsterinitdead 65 + becomedead 66 + bestvisibleenemy 68 + finviewcone 69 + fvecinviewcone 70 + + runai 59 + monsterthink 62 + monsterinit 64 + checklocalmove 71 + move 72 + moveexecute 73 + shouldadvanceroute 74 + getstoppedactivity 75 + stop 76 + checkrangeattack1 77 + checkrangeattack2 78 + checkmeleeattack1 79 + checkmeleeattack2 80 + schedulechange 86 + canplaysequence 87 + canplaysentence 88 + playsentence 89 + playscriptedsentence 90 + sentencestop 91 + getidealstate 92 + setactivity 93 + reportaistate 94 + checkenemy 95 + ftriangulate 96 + setyawspeed 97 + buildnearestroute 98 + findcover 99 + coverradius 101 + fcancheckattacks 102 + checkammo 103 + ignoreconditions 104 + fvalidatehinttype 105 + fcanactiveidle 106 + isoundmask 107 + hearingsensitivity 110 + barnaclevictimbitten 111 + barnaclevictimreleased 112 + preschedulethink 113 + getdeathactivity 114 + gibmonster 115 + hashumangibs 116 + hasaliengibs 117 + fademonster 118 + deathsound 120 + alertsound 121 + idlesound 122 + painsound 123 + stopfollowing 124 + + player_jump 125 + player_duck 126 + player_prethink 127 + player_postthink 128 + player_getgunposition 119 + player_shouldfadeondeath 60 + player_impulsecommands 130 + player_updateclientdata 129 + + item_addtoplayer 58 + item_addduplicate 59 + item_getiteminfo 60 + item_candeploy 61 + item_deploy 62 + item_canholster 63 + item_holster 64 + item_updateiteminfo 65 + item_preframe 66 + item_postframe 67 + item_drop 68 + item_kill 69 + item_attachtoplayer 70 + item_primaryammoindex 71 + item_secondaryammoindex 72 + item_updateclientdata 73 + item_getweaponptr 74 + item_itemslot 75 + + weapon_extractammo 76 + weapon_extractclipammo 77 + weapon_addweapon 78 + weapon_playemptysound 79 + weapon_resetemptysound 80 + weapon_sendweaponanim 81 + weapon_isusable 82 + weapon_primaryattack 83 + weapon_secondaryattack 84 + weapon_reload 85 + weapon_weaponidle 86 + weapon_retireweapon 87 + weapon_shouldweaponidle 88 + weapon_usedecrement 89 +@end + +@section gearbox windows + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 activate 6 setobjectcollisionbox 7 classify 8 deathnotice 9 traceattack 10 - takedamage 11 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 gettogglestate 20 addpoints 21 addpointstoteam 22 addplayeritem 23 removeplayeritem 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 + giveammo 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 + isnetclient 41 + teamid 42 + getnexttarget 43 + think 44 + touch 45 + use 46 + blocked 47 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 + fvisible 57 + fvecvisible 56 + + look 60 + changeyaw 63 + irelationship 65 + monsterinitdead 67 + becomedead 68 + bestvisibleenemy 70 + finviewcone 72 + fvecinviewcone 71 + + runai 61 + monsterthink 64 + monsterinit 66 + checklocalmove 73 + move 74 + moveexecute 75 + shouldadvanceroute 76 + getstoppedactivity 77 + stop 78 + checkrangeattack1 79 + checkrangeattack2 80 + checkmeleeattack1 81 + checkmeleeattack2 82 + schedulechange 88 + canplaysequence 89 + canplaysentence 90 + playsentence 91 + playscriptedsentence 92 + sentencestop 93 + getidealstate 94 + setactivity 95 + reportaistate 96 + checkenemy 97 + ftriangulate 98 + setyawspeed 99 + buildnearestroute 100 + findcover 101 + coverradius 103 + fcancheckattacks 104 + checkammo 105 + ignoreconditions 106 + fvalidatehinttype 107 + fcanactiveidle 108 + isoundmask 109 + hearingsensitivity 112 + barnaclevictimbitten 113 + barnaclevictimreleased 114 + preschedulethink 115 + getdeathactivity 116 + gibmonster 117 + hashumangibs 118 + hasaliengibs 119 + fademonster 120 + deathsound 123 + alertsound 124 + idlesound 125 + painsound 126 + stopfollowing 127 + + player_jump 127 + player_duck 128 + player_prethink 129 + player_postthink 130 + player_getgunposition 121 + player_shouldfadeondeath 62 + player_impulsecommands 132 + player_updateclientdata 131 + + item_addtoplayer 60 + item_addduplicate 61 + item_getiteminfo 62 + item_candeploy 63 + item_deploy 64 + item_canholster 65 + item_holster 66 + item_updateiteminfo 67 + item_preframe 68 + item_postframe 69 + item_drop 70 + item_kill 71 + item_attachtoplayer 72 + item_primaryammoindex 73 + item_secondaryammoindex 74 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 78 + + weapon_extractammo 79 + weapon_extractclipammo 80 + weapon_addweapon 81 + weapon_playemptysound 82 + weapon_resetemptysound 83 + weapon_sendweaponanim 84 + weapon_isusable 85 + weapon_primaryattack 86 + weapon_secondaryattack 87 + weapon_reload 88 + weapon_weaponidle 89 + weapon_retireweapon 90 + weapon_shouldweaponidle 91 + weapon_usedecrement 92 + + gearbox_mysquadtalkmonsterpointer 19 + gearbox_weapontimebase 58 +@end + +@section gearbox linux + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 + gettogglestate 20 + addpoints 21 + addpointstoteam 22 + addplayeritem 23 + removeplayeritem 24 + giveammo 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 isnetclient 41 teamid 42 getnexttarget 43 @@ -1830,14 +4079,565 @@ illumination 55 fvisible 56 fvecvisible 57 + + look 60 + changeyaw 63 + irelationship 65 + monsterinitdead 67 + becomedead 68 + bestvisibleenemy 70 + finviewcone 71 + fvecinviewcone 72 + + runai 61 + monsterthink 64 + monsterinit 66 + checklocalmove 73 + move 74 + moveexecute 75 + shouldadvanceroute 76 + getstoppedactivity 77 + stop 78 + checkrangeattack1 79 + checkrangeattack2 80 + checkmeleeattack1 81 + checkmeleeattack2 82 + schedulechange 88 + canplaysequence 89 + canplaysentence 90 + playsentence 91 + playscriptedsentence 92 + sentencestop 93 + getidealstate 94 + setactivity 95 + reportaistate 96 + checkenemy 97 + ftriangulate 98 + setyawspeed 99 + buildnearestroute 100 + findcover 101 + coverradius 103 + fcancheckattacks 104 + checkammo 105 + ignoreconditions 106 + fvalidatehinttype 107 + fcanactiveidle 108 + isoundmask 109 + hearingsensitivity 112 + barnaclevictimbitten 113 + barnaclevictimreleased 114 + preschedulethink 115 + getdeathactivity 116 + gibmonster 117 + hashumangibs 118 + hasaliengibs 119 + fademonster 120 + deathsound 123 + alertsound 124 + idlesound 125 + painsound 126 + stopfollowing 127 + + player_jump 127 + player_duck 128 + player_prethink 129 + player_postthink 130 + player_getgunposition 121 + player_shouldfadeondeath 62 + player_impulsecommands 132 + player_updateclientdata 131 - player_jump 131 - player_prethink 132 - player_postthink 133 - player_getgunposition 120 - player_shouldfadeondeath 61 - player_impulsecommands 135 - player_updateclientdata 134 + item_addtoplayer 60 + item_addduplicate 61 + item_getiteminfo 62 + item_candeploy 63 + item_deploy 64 + item_canholster 65 + item_holster 66 + item_updateiteminfo 67 + item_preframe 68 + item_postframe 69 + item_drop 70 + item_kill 71 + item_attachtoplayer 72 + item_primaryammoindex 73 + item_secondaryammoindex 74 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 78 + + weapon_extractammo 79 + weapon_extractclipammo 80 + weapon_addweapon 81 + weapon_playemptysound 82 + weapon_resetemptysound 83 + weapon_sendweaponanim 84 + weapon_isusable 85 + weapon_primaryattack 86 + weapon_secondaryattack 87 + weapon_reload 88 + weapon_weaponidle 89 + weapon_retireweapon 90 + weapon_shouldweaponidle 91 + weapon_usedecrement 92 + + gearbox_mysquadtalkmonsterpointer 19 + gearbox_weapontimebase 58 +@end + +@section gearbox mac + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 + gettogglestate 20 + addpoints 21 + addpointstoteam 22 + addplayeritem 23 + removeplayeritem 24 + giveammo 25 + getdelay 26 + ismoving 27 + overridereset 28 + damagedecal 29 + settogglestate 30 + startsneaking 31 + stopsneaking 32 + oncontrols 33 + issneaking 34 + isalive 35 + isbspmodel 36 + reflectgauss 37 + hastarget 38 + isinworld 39 + isplayer 40 + isnetclient 41 + teamid 42 + getnexttarget 43 + think 44 + touch 45 + use 46 + blocked 47 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 + fvisible 56 + fvecvisible 57 + + look 60 + changeyaw 63 + irelationship 65 + monsterinitdead 67 + becomedead 68 + bestvisibleenemy 70 + finviewcone 71 + fvecinviewcone 72 + + runai 61 + monsterthink 64 + monsterinit 66 + checklocalmove 73 + move 74 + moveexecute 75 + shouldadvanceroute 76 + getstoppedactivity 77 + stop 78 + checkrangeattack1 79 + checkrangeattack2 80 + checkmeleeattack1 81 + checkmeleeattack2 82 + schedulechange 88 + canplaysequence 89 + canplaysentence 90 + playsentence 91 + playscriptedsentence 92 + sentencestop 93 + getidealstate 94 + setactivity 95 + reportaistate 96 + checkenemy 97 + ftriangulate 98 + setyawspeed 99 + buildnearestroute 100 + findcover 101 + coverradius 103 + fcancheckattacks 104 + checkammo 105 + ignoreconditions 106 + fvalidatehinttype 107 + fcanactiveidle 108 + isoundmask 109 + hearingsensitivity 112 + barnaclevictimbitten 113 + barnaclevictimreleased 114 + preschedulethink 115 + getdeathactivity 116 + gibmonster 117 + hashumangibs 118 + hasaliengibs 119 + fademonster 120 + deathsound 123 + alertsound 124 + idlesound 125 + painsound 126 + stopfollowing 127 + + player_jump 127 + player_duck 128 + player_prethink 129 + player_postthink 130 + player_getgunposition 121 + player_shouldfadeondeath 62 + player_impulsecommands 132 + player_updateclientdata 131 + + item_addtoplayer 60 + item_addduplicate 61 + item_getiteminfo 62 + item_candeploy 63 + item_deploy 64 + item_canholster 65 + item_holster 66 + item_updateiteminfo 67 + item_preframe 68 + item_postframe 69 + item_drop 70 + item_kill 71 + item_attachtoplayer 72 + item_primaryammoindex 73 + item_secondaryammoindex 74 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 78 + + weapon_extractammo 79 + weapon_extractclipammo 80 + weapon_addweapon 81 + weapon_playemptysound 82 + weapon_resetemptysound 83 + weapon_sendweaponanim 84 + weapon_isusable 85 + weapon_primaryattack 86 + weapon_secondaryattack 87 + weapon_reload 88 + weapon_weaponidle 89 + weapon_retireweapon 90 + weapon_shouldweaponidle 91 + weapon_usedecrement 92 + + gearbox_mysquadtalkmonsterpointer 19 + gearbox_weapontimebase 58 +@end + +@section ag linux + pev 0 + base 0x60 + + spawn 2 + precache 3 + keyvalue 4 + objectcaps 7 + activate 8 + setobjectcollisionbox 9 + classify 10 + deathnotice 11 + traceattack 12 + takedamage 13 + takehealth 14 + killed 15 + bloodcolor 16 + tracebleed 17 + istriggered 18 + mymonsterpointer 19 + mysquadmonsterpointer 20 + gettogglestate 21 + addpoints 22 + addpointstoteam 23 + addplayeritem 24 + removeplayeritem 25 + giveammo 26 + getdelay 27 + ismoving 28 + overridereset 29 + damagedecal 30 + settogglestate 31 + startsneaking 32 + stopsneaking 33 + oncontrols 34 + issneaking 35 + isalive 36 + isbspmodel 37 + reflectgauss 38 + hastarget 39 + isinworld 40 + isplayer 41 + isnetclient 42 + teamid 43 + getnexttarget 44 + think 45 + touch 46 + use 47 + blocked 48 + respawn 50 + updateowner 51 + fbecomeprone 52 + center 53 + eyeposition 54 + earposition 55 + bodytarget 56 + illumination 57 + fvisible 58 + fvecvisible 59 + + look 62 + changeyaw 65 + irelationship 67 + monsterinitdead 69 + becomedead 70 + bestvisibleenemy 72 + finviewcone 73 + fvecinviewcone 74 + + runai 63 + monsterthink 66 + monsterinit 68 + checklocalmove 75 + move 76 + moveexecute 77 + shouldadvanceroute 78 + getstoppedactivity 79 + stop 80 + checkrangeattack1 81 + checkrangeattack2 82 + checkmeleeattack1 83 + checkmeleeattack2 84 + schedulechange 90 + canplaysequence 91 + canplaysentence 92 + playsentence 93 + playscriptedsentence 94 + sentencestop 95 + getidealstate 96 + setactivity 97 + reportaistate 98 + checkenemy 99 + ftriangulate 100 + setyawspeed 101 + buildnearestroute 102 + findcover 103 + coverradius 105 + fcancheckattacks 106 + checkammo 107 + ignoreconditions 108 + fvalidatehinttype 109 + fcanactiveidle 110 + isoundmask 111 + hearingsensitivity 114 + barnaclevictimbitten 115 + barnaclevictimreleased 116 + preschedulethink 117 + getdeathactivity 118 + gibmonster 119 + hashumangibs 120 + hasaliengibs 121 + fademonster 122 + deathsound 124 + alertsound 125 + idlesound 126 + painsound 127 + stopfollowing 128 + + player_jump 129 + player_duck 130 + player_prethink 131 + player_postthink 132 + player_getgunposition 123 + player_shouldfadeondeath 64 + player_impulsecommands 134 + player_updateclientdata 133 + + item_addtoplayer 61 + item_addduplicate 62 + item_getiteminfo 63 + item_candeploy 64 + item_deploy 65 + item_canholster 66 + item_holster 67 + item_updateiteminfo 68 + item_preframe 69 + item_postframe 70 + item_drop 71 + item_kill 72 + item_attachtoplayer 73 + item_primaryammoindex 74 + item_secondaryammoindex 75 + item_updateclientdata 76 + item_getweaponptr 77 + item_itemslot 78 + + weapon_extractammo 79 + weapon_extractclipammo 80 + weapon_addweapon 81 + weapon_playemptysound 82 + weapon_resetemptysound 83 + weapon_sendweaponanim 84 + weapon_isusable 85 + weapon_primaryattack 86 + weapon_secondaryattack 87 + weapon_reload 88 + weapon_weaponidle 89 + weapon_retireweapon 90 + weapon_shouldweaponidle 91 + weapon_usedecrement 92 + +@end +@section ag windows + pev 4 + base 0x0 + + spawn 0 + precache 1 + keyvalue 2 + objectcaps 5 + activate 6 + setobjectcollisionbox 7 + classify 8 + deathnotice 9 + traceattack 10 + takedamage 11 + takehealth 12 + killed 13 + bloodcolor 14 + tracebleed 15 + istriggered 16 + mymonsterpointer 17 + mysquadmonsterpointer 18 + gettogglestate 19 + addpoints 20 + addpointstoteam 21 + addplayeritem 22 + removeplayeritem 23 + giveammo 24 + getdelay 25 + ismoving 26 + overridereset 27 + damagedecal 28 + settogglestate 29 + startsneaking 30 + stopsneaking 31 + oncontrols 32 + issneaking 33 + isalive 34 + isbspmodel 35 + reflectgauss 36 + hastarget 37 + isinworld 38 + isplayer 39 + isnetclient 40 + teamid 41 + getnexttarget 42 + think 43 + touch 44 + use 45 + blocked 46 + respawn 48 + updateowner 49 + fbecomeprone 50 + center 51 + eyeposition 52 + earposition 53 + bodytarget 54 + illumination 55 + fvisible 56 + fvecvisible 57 + + look 60 + changeyaw 63 + irelationship 65 + monsterinitdead 67 + becomedead 68 + bestvisibleenemy 70 + finviewcone 71 + fvecinviewcone 72 + + runai 61 + monsterthink 64 + monsterinit 66 + checklocalmove 73 + move 74 + moveexecute 75 + shouldadvanceroute 76 + getstoppedactivity 77 + stop 78 + checkrangeattack1 79 + checkrangeattack2 80 + checkmeleeattack1 81 + checkmeleeattack2 82 + schedulechange 88 + canplaysequence 89 + canplaysentence 90 + playsentence 91 + playscriptedsentence 92 + sentencestop 93 + getidealstate 94 + setactivity 95 + reportaistate 96 + checkenemy 97 + ftriangulate 98 + setyawspeed 99 + buildnearestroute 100 + findcover 101 + coverradius 103 + fcancheckattacks 104 + checkammo 105 + ignoreconditions 106 + fvalidatehinttype 107 + fcanactiveidle 108 + isoundmask 109 + hearingsensitivity 112 + barnaclevictimbitten 113 + barnaclevictimreleased 114 + preschedulethink 115 + getdeathactivity 116 + gibmonster 117 + hashumangibs 118 + hasaliengibs 119 + fademonster 120 + deathsound 122 + alertsound 123 + idlesound 124 + painsound 125 + stopfollowing 126 + + player_jump 127 + player_duck 128 + player_prethink 129 + player_postthink 130 + player_getgunposition 121 + player_shouldfadeondeath 62 + player_impulsecommands 132 + player_updateclientdata 131 item_addtoplayer 59 item_addduplicate 60 @@ -1849,7 +4649,7 @@ item_updateiteminfo 66 item_preframe 67 item_postframe 68 - item_drop 69 + item_drop 69 item_kill 70 item_attachtoplayer 71 item_primaryammoindex 72 @@ -1858,367 +4658,19 @@ item_getweaponptr 75 item_itemslot 76 - weapon_playemptysound 77 - weapon_resetemptysound 78 - weapon_sendweaponanim 79 - weapon_primaryattack 80 - weapon_secondaryattack 81 - weapon_weaponidle 82 - weapon_retireweapon 83 - weapon_shouldweaponidle 84 - weapon_usedecrement 85 - - esf_isenvmodel 40 - esf_takedamage2 12 - -@end -@section valve linux - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 41 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 125 - player_duck 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 119 - player_shouldfadeondeath 60 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 58 - item_addduplicate 59 - item_getiteminfo 60 - item_candeploy 61 - item_deploy 62 - item_canholster 63 - item_holster 64 - item_updateiteminfo 65 - item_preframe 66 - item_postframe 67 - item_drop 68 - item_kill 69 - item_attachtoplayer 70 - item_primaryammoindex 71 - item_secondaryammoindex 72 - item_updateclientdata 73 - item_getweaponptr 74 - item_itemslot 75 - - weapon_extractammo 76 - weapon_extractclipammo 77 - weapon_addweapon 78 - weapon_playemptysound 79 - weapon_resetemptysound 80 - weapon_sendweaponanim 81 - weapon_isusable 82 - weapon_primaryattack 83 - weapon_secondaryattack 84 - weapon_reload 85 - weapon_weaponidle 86 - weapon_retireweapon 87 - weapon_shouldweaponidle 88 - weapon_usedecrement 89 -@end -@section valve windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 41 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 125 - player_duck 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 119 - player_shouldfadeondeath 60 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 58 - item_addduplicate 59 - item_getiteminfo 60 - item_candeploy 61 - item_deploy 62 - item_canholster 63 - item_holster 64 - item_updateiteminfo 65 - item_preframe 66 - item_postframe 67 - item_drop 68 - item_kill 69 - item_attachtoplayer 70 - item_primaryammoindex 71 - item_secondaryammoindex 72 - item_updateclientdata 73 - item_getweaponptr 74 - item_itemslot 75 - - weapon_extractammo 76 - weapon_extractclipammo 77 - weapon_addweapon 78 - weapon_playemptysound 79 - weapon_resetemptysound 80 - weapon_sendweaponanim 81 - weapon_isusable 82 - weapon_primaryattack 83 - weapon_secondaryattack 84 - weapon_reload 85 - weapon_weaponidle 86 - weapon_retireweapon 87 - weapon_shouldweaponidle 88 - weapon_usedecrement 89 -@end - -@section valve mac - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 41 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 125 - player_duck 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 119 - player_shouldfadeondeath 60 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 58 - item_addduplicate 59 - item_getiteminfo 60 - item_candeploy 61 - item_deploy 62 - item_canholster 63 - item_holster 64 - item_updateiteminfo 65 - item_preframe 66 - item_postframe 67 - item_drop 68 - item_kill 69 - item_attachtoplayer 70 - item_primaryammoindex 71 - item_secondaryammoindex 72 - item_updateclientdata 73 - item_getweaponptr 74 - item_itemslot 75 - - weapon_extractammo 76 - weapon_extractclipammo 77 - weapon_addweapon 78 - weapon_playemptysound 79 - weapon_resetemptysound 80 - weapon_sendweaponanim 81 - weapon_isusable 82 - weapon_primaryattack 83 - weapon_secondaryattack 84 - weapon_reload 85 - weapon_weaponidle 86 - weapon_retireweapon 87 - weapon_shouldweaponidle 88 - weapon_usedecrement 89 -@end - -; Sven-Coop has no linux binaries. This makes disassembly much harder. -; These offsets were contributed by ts2do -@section SvenCoop windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - takedamage 11 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - oncontrols 32 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - -@end + weapon_extractammo 77 + weapon_extractclipammo 78 + weapon_addweapon 79 + weapon_playemptysound 80 + weapon_resetemptysound 81 + weapon_sendweaponanim 82 + weapon_isusable 83 + weapon_primaryattack 84 + weapon_secondaryattack 85 + weapon_reload 86 + weapon_weaponidle 87 + weapon_retireweapon 88 + weapon_shouldweaponidle 89 + weapon_usedecrement 90 +@end + \ No newline at end of file diff --git a/dlls/hamsandwich/DataHandler.cpp b/dlls/hamsandwich/DataHandler.cpp index bf1ce495..48b6d168 100644 --- a/dlls/hamsandwich/DataHandler.cpp +++ b/dlls/hamsandwich/DataHandler.cpp @@ -1,321 +1,512 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#include "amxxmodule.h" - -#include "CVector.h" -#include "CString.h" -#include "sh_stack.h" -#include "DataHandler.h" - -#include "ham_const.h" -#include "ham_utils.h" -#include "NEW_Util.h" - -CStack< Data * > ReturnStack; -CStack< Data * > OrigReturnStack; -CStack< CVector< Data * > * > ParamStack; -CStack< int * > ReturnStatus; -#define CHECK_STACK(__STACK__) \ - if ( ( __STACK__ ).size() <= 0) \ - { \ - MF_LogError(amx, AMX_ERR_NATIVE, "%s is empty!", #__STACK__); \ - return 0; \ +#include "amxxmodule.h" + +#include "CVector.h" +#include "CString.h" +#include "sh_stack.h" +#include "DataHandler.h" + +#include "ham_const.h" +#include "ham_utils.h" +#include "NEW_Util.h" + +CStack< Data * > ReturnStack; +CStack< Data * > OrigReturnStack; +CStack< CVector< Data * > * > ParamStack; +CStack< int * > ReturnStatus; +#define CHECK_STACK(__STACK__) \ + if ( ( __STACK__ ).size() <= 0) \ + { \ + MF_LogError(amx, AMX_ERR_NATIVE, "%s is empty!", #__STACK__); \ + return 0; \ + } + +#define PARSE_RETURN() \ + if (ret==-2) \ + { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Data pointer is NULL!"); \ + } \ + else if (ret==-1) \ + { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Wrong data type (data is of type %s)", returntypes[dat->GetType()]); \ + } \ + return ret + +static const char *returntypes[] = +{ + "void", + "integer", + "float", + "vector", + "string", + "entity", + "entity", + "traceresult", + "iteminfo" +}; + +static cell AMX_NATIVE_CALL GetHamReturnInteger(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->GetInt(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetOrigHamReturnInteger(AMX *amx, cell *params) +{ + CHECK_STACK(OrigReturnStack); + Data *dat=OrigReturnStack.front(); + + int ret=dat->GetInt(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetHamReturnFloat(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->GetFloat(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetOrigHamReturnFloat(AMX *amx, cell *params) +{ + CHECK_STACK(OrigReturnStack); + Data *dat=OrigReturnStack.front(); + + int ret=dat->GetFloat(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetHamReturnVector(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->GetVector(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetOrigHamReturnVector(AMX *amx, cell *params) +{ + CHECK_STACK(OrigReturnStack); + Data *dat=OrigReturnStack.front(); + + int ret=dat->GetVector(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetHamReturnEntity(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->GetEntity(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetOrigHamReturnEntity(AMX *amx, cell *params) +{ + CHECK_STACK(OrigReturnStack); + Data *dat=OrigReturnStack.front(); + + int ret=dat->GetEntity(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetHamReturnString(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->GetString(MF_GetAmxAddr(amx, params[1]), params[2]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL GetOrigHamReturnString(AMX *amx, cell *params) +{ + CHECK_STACK(OrigReturnStack); + Data *dat=OrigReturnStack.front(); + + int ret=dat->GetString(MF_GetAmxAddr(amx, params[1]), params[2]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamReturnInteger(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->SetInt(¶ms[1]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamReturnFloat(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->SetFloat(¶ms[1]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamReturnVector(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->SetVector(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamReturnEntity(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->SetEntity(¶ms[1]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamReturnString(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStack); + Data *dat=ReturnStack.front(); + + int ret=dat->SetString(MF_GetAmxAddr(amx, params[1])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamParamInteger(AMX *amx, cell *params) +{ + CHECK_STACK(ParamStack); + CVector *vec=ParamStack.front(); + if (vec->size() < (unsigned)params[1]) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + Data *dat=vec->at(params[1] - 1); + + int ret=dat->SetInt(¶ms[2]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamParamTraceResult(AMX *amx, cell *params) +{ + if (params[2] == 0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null traceresult provided."); + + return 0; + } + CHECK_STACK(ParamStack); + CVector *vec=ParamStack.front(); + if (vec->size() < (unsigned)params[1]) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + Data *dat=vec->at(params[1] - 1); + + int ret=dat->SetInt(¶ms[2]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamParamFloat(AMX *amx, cell *params) +{ + CHECK_STACK(ParamStack); + CVector *vec=ParamStack.front(); + if (vec->size() < (unsigned)params[1] || params[1] < 1) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + Data *dat=vec->at(params[1] - 1); + + int ret=dat->SetFloat(¶ms[2]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamParamVector(AMX *amx, cell *params) +{ + CHECK_STACK(ParamStack); + CVector *vec=ParamStack.front(); + if (vec->size() < (unsigned)params[1]) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + Data *dat=vec->at(params[1] - 1); + + int ret=dat->SetVector(MF_GetAmxAddr(amx, params[2])); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamParamEntity(AMX *amx, cell *params) +{ + CHECK_STACK(ParamStack); + CVector *vec=ParamStack.front(); + if (vec->size() < (unsigned)params[1]) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + Data *dat=vec->at(params[1] - 1); + + int ret=dat->SetEntity(¶ms[2]); + PARSE_RETURN(); +} +static cell AMX_NATIVE_CALL SetHamParamString(AMX *amx, cell *params) +{ + CHECK_STACK(ParamStack); + CVector *vec=ParamStack.front(); + if (vec->size() < (unsigned)params[1]) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + Data *dat=vec->at(params[1] - 1); + + int ret=dat->SetString(MF_GetAmxAddr(amx, params[2])); + PARSE_RETURN(); +} + +static cell AMX_NATIVE_CALL SetHamParamItemInfo(AMX *amx, cell *params) +{ + if (params[2] == 0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle provided."); + return 0; + } + + CHECK_STACK(ParamStack); + CVector *vec = ParamStack.front(); + + if (vec->size() < (unsigned)params[1]) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); + return 0; + } + + Data *dat = vec->at(params[1] - 1); + + int ret = dat->SetInt(¶ms[2]); + PARSE_RETURN(); +} + + +static cell AMX_NATIVE_CALL GetHamItemInfo(AMX *amx, cell *params) +{ + if (params[1] == 0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null iteminfo handle provided."); + return 0; } -#define PARSE_RETURN() \ - if (ret==-2) \ - { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Data pointer is NULL!"); \ - } \ - else if (ret==-1) \ - { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Wrong data type (data is of type %s)", returntypes[dat->GetType()]); \ - } \ - return ret + int type = params[2]; -static const char *returntypes[] = -{ - "void", - "integer", - "float", - "vector", - "string", - "entity", - "entity", - "traceresult", - "iteminfo" -}; - -static cell AMX_NATIVE_CALL GetHamReturnInteger(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->GetInt(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetOrigHamReturnInteger(AMX *amx, cell *params) -{ - CHECK_STACK(OrigReturnStack); - Data *dat=OrigReturnStack.front(); - - int ret=dat->GetInt(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetHamReturnFloat(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->GetFloat(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetOrigHamReturnFloat(AMX *amx, cell *params) -{ - CHECK_STACK(OrigReturnStack); - Data *dat=OrigReturnStack.front(); - - int ret=dat->GetFloat(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetHamReturnVector(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->GetVector(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetOrigHamReturnVector(AMX *amx, cell *params) -{ - CHECK_STACK(OrigReturnStack); - Data *dat=OrigReturnStack.front(); - - int ret=dat->GetVector(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetHamReturnEntity(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->GetEntity(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetOrigHamReturnEntity(AMX *amx, cell *params) -{ - CHECK_STACK(OrigReturnStack); - Data *dat=OrigReturnStack.front(); - - int ret=dat->GetEntity(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetHamReturnString(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->GetString(MF_GetAmxAddr(amx, params[1]), params[2]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetOrigHamReturnString(AMX *amx, cell *params) -{ - CHECK_STACK(OrigReturnStack); - Data *dat=OrigReturnStack.front(); - - int ret=dat->GetString(MF_GetAmxAddr(amx, params[1]), params[2]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamReturnInteger(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->SetInt(¶ms[1]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamReturnFloat(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->SetFloat(¶ms[1]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamReturnVector(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->SetVector(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamReturnEntity(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->SetEntity(¶ms[1]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamReturnString(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStack); - Data *dat=ReturnStack.front(); - - int ret=dat->SetString(MF_GetAmxAddr(amx, params[1])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamParamInteger(AMX *amx, cell *params) -{ - CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); - return 0; - } - Data *dat=vec->at(params[1] - 1); - - int ret=dat->SetInt(¶ms[2]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamParamTraceResult(AMX *amx, cell *params) -{ - if (params[2] == 0) + if ((type == ItemInfo_pszAmmo1 || type == ItemInfo_pszAmmo2 || type == ItemInfo_pszName) && (*params / sizeof(cell)) != 4) { - MF_LogError(amx, AMX_ERR_NATIVE, "Null traceresult provided."); - + MF_LogError(amx, AMX_ERR_NATIVE, "Bad arg count. Expected %d, got %d.", 4, *params / sizeof(cell)); return 0; } - CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); - return 0; - } - Data *dat=vec->at(params[1] - 1); - int ret=dat->SetInt(¶ms[2]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamParamFloat(AMX *amx, cell *params) + ItemInfo *pItem = reinterpret_cast(params[1]); + + switch (type) + { + case ItemInfo_iSlot: + return pItem->iSlot; + + case ItemInfo_iPosition: + return pItem->iPosition; + + case ItemInfo_pszAmmo1: + return MF_SetAmxString( amx, params[3], pItem->pszAmmo1 > 0 ? pItem->pszAmmo1 : "", params[4] ); + + case ItemInfo_iMaxAmmo1: + return pItem->iMaxAmmo1; + + case ItemInfo_pszAmmo2: + return MF_SetAmxString( amx, params[3], pItem->pszAmmo2 > 0 ? pItem->pszAmmo2 : "", params[4] ); + + case ItemInfo_iMaxAmmo2: + return pItem->iMaxAmmo2; + + case ItemInfo_pszName: + return MF_SetAmxString( amx, params[3], pItem->pszName > 0 ? pItem->pszName : "", params[4] ); + + case ItemInfo_iMaxClip: + return pItem->iMaxClip; + + case ItemInfo_iId: + return pItem->iId; + + case ItemInfo_iFlags: + return pItem->iFlags; + + case ItemInfo_iWeight: + return pItem->iWeight; + } + + MF_LogError(amx, AMX_ERR_NATIVE, "Unknown ItemInfo type %d", type); + return 0; +} + +CStack g_FreeIIs; + +static cell AMX_NATIVE_CALL CreateHamItemInfo(AMX *amx, cell *params) { - CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1] || params[1] < 1) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); - return 0; - } - Data *dat=vec->at(params[1] - 1); + ItemInfo *ii; - int ret=dat->SetFloat(¶ms[2]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamParamVector(AMX *amx, cell *params) -{ - CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); - return 0; - } - Data *dat=vec->at(params[1] - 1); + if (g_FreeIIs.empty()) + { + ii = new ItemInfo; + } + else + { + ii = g_FreeIIs.front(); + g_FreeIIs.pop(); + } - int ret=dat->SetVector(MF_GetAmxAddr(amx, params[2])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamParamEntity(AMX *amx, cell *params) -{ - CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); - return 0; - } - Data *dat=vec->at(params[1] - 1); + memset(ii, 0, sizeof(ItemInfo)); - int ret=dat->SetEntity(¶ms[2]); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL SetHamParamString(AMX *amx, cell *params) -{ - CHECK_STACK(ParamStack); - CVector *vec=ParamStack.front(); - if (vec->size() < (unsigned)params[1]) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size()); - return 0; - } - Data *dat=vec->at(params[1] - 1); - - int ret=dat->SetString(MF_GetAmxAddr(amx, params[2])); - PARSE_RETURN(); -} -static cell AMX_NATIVE_CALL GetHamReturnStatus(AMX *amx, cell *params) -{ - CHECK_STACK(ReturnStatus); - int *i=ReturnStatus.front(); - - return *i; + return reinterpret_cast(ii); } -AMX_NATIVE_INFO ReturnNatives[] = +static cell AMX_NATIVE_CALL FreeHamItemInfo(AMX *amx, cell *params) { - { "GetHamReturnInteger", GetHamReturnInteger }, - { "GetHamReturnFloat", GetHamReturnFloat }, - { "GetHamReturnVector", GetHamReturnVector }, - { "GetHamReturnEntity", GetHamReturnEntity }, - { "GetHamReturnString", GetHamReturnString }, - { "GetOrigHamReturnInteger", GetOrigHamReturnInteger }, - { "GetOrigHamReturnFloat", GetOrigHamReturnFloat }, - { "GetOrigHamReturnVector", GetOrigHamReturnVector }, - { "GetOrigHamReturnEntity", GetOrigHamReturnEntity }, - { "GetOrigHamReturnString", GetOrigHamReturnString }, - { "SetHamReturnInteger", SetHamReturnInteger }, - { "SetHamReturnFloat", SetHamReturnFloat }, - { "SetHamReturnVector", SetHamReturnVector }, - { "SetHamReturnEntity", SetHamReturnEntity }, - { "SetHamReturnString", SetHamReturnString }, + ItemInfo *ii = reinterpret_cast(params[1]); - { "GetHamReturnStatus", GetHamReturnStatus }, + if (!ii) + { + return 0; + } - { "SetHamParamInteger", SetHamParamInteger }, - { "SetHamParamFloat", SetHamParamFloat }, - { "SetHamParamVector", SetHamParamVector }, - { "SetHamParamEntity", SetHamParamEntity }, - { "SetHamParamString", SetHamParamString }, - { "SetHamParamTraceResult", SetHamParamTraceResult }, + g_FreeIIs.push(ii); - { NULL, NULL }, -}; + return 1; +} + + +static cell AMX_NATIVE_CALL SetHamItemInfo(AMX *amx, cell *params) +{ + if (params[1] == 0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null iteminfo handle provided."); + return 0; + } + + ItemInfo *pItem = reinterpret_cast(params[1]); + cell *ptr = MF_GetAmxAddr(amx, params[3]); + int iLen; + + switch (params[2]) + { + case ItemInfo_iSlot: + pItem->iSlot = *ptr; + break; + + case ItemInfo_iPosition: + pItem->iPosition = *ptr; + break; + + case ItemInfo_pszAmmo1: + pItem->pszAmmo1 = MF_GetAmxString(amx, params[3], 0, &iLen); + return iLen; + + case ItemInfo_iMaxAmmo1: + pItem->iMaxAmmo1 = *ptr; + break; + + case ItemInfo_pszAmmo2: + pItem->pszAmmo2 = MF_GetAmxString(amx, params[3], 0, &iLen); + return iLen; + + case ItemInfo_iMaxAmmo2: + pItem->iMaxAmmo2 = *ptr; + break; + + case ItemInfo_pszName: + pItem->pszName = MF_GetAmxString(amx, params[3], 0, &iLen); + return iLen; + + case ItemInfo_iMaxClip: + pItem->iMaxClip = *ptr; + break; + + case ItemInfo_iId: + pItem->iId = *ptr; + break; + + case ItemInfo_iFlags: + pItem->iFlags = *ptr; + break; + + case ItemInfo_iWeight: + pItem->iWeight = *ptr; + break; + + default: + MF_LogError(amx, AMX_ERR_NATIVE, "Unknown ItemInfo type %d", params[2]); + return 0; + } + + return 1; +} + +static cell AMX_NATIVE_CALL GetHamReturnStatus(AMX *amx, cell *params) +{ + CHECK_STACK(ReturnStatus); + int *i=ReturnStatus.front(); + + return *i; +} + +AMX_NATIVE_INFO ReturnNatives[] = +{ + { "GetHamReturnInteger", GetHamReturnInteger }, + { "GetHamReturnFloat", GetHamReturnFloat }, + { "GetHamReturnVector", GetHamReturnVector }, + { "GetHamReturnEntity", GetHamReturnEntity }, + { "GetHamReturnString", GetHamReturnString }, + { "GetOrigHamReturnInteger", GetOrigHamReturnInteger }, + { "GetOrigHamReturnFloat", GetOrigHamReturnFloat }, + { "GetOrigHamReturnVector", GetOrigHamReturnVector }, + { "GetOrigHamReturnEntity", GetOrigHamReturnEntity }, + { "GetOrigHamReturnString", GetOrigHamReturnString }, + { "SetHamReturnInteger", SetHamReturnInteger }, + { "SetHamReturnFloat", SetHamReturnFloat }, + { "SetHamReturnVector", SetHamReturnVector }, + { "SetHamReturnEntity", SetHamReturnEntity }, + { "SetHamReturnString", SetHamReturnString }, + + { "GetHamReturnStatus", GetHamReturnStatus }, + + { "SetHamParamInteger", SetHamParamInteger }, + { "SetHamParamFloat", SetHamParamFloat }, + { "SetHamParamVector", SetHamParamVector }, + { "SetHamParamEntity", SetHamParamEntity }, + { "SetHamParamString", SetHamParamString }, + { "SetHamParamTraceResult", SetHamParamTraceResult }, + { "SetHamParamItemInfo", SetHamParamItemInfo }, + + { "GetHamItemInfo", GetHamItemInfo }, + { "SetHamItemInfo", SetHamItemInfo }, + { "CreateHamItemInfo", CreateHamItemInfo }, + { "FreeHamItemInfo", FreeHamItemInfo }, + + { NULL, NULL }, +}; diff --git a/dlls/hamsandwich/DataHandler.h b/dlls/hamsandwich/DataHandler.h index 9a1b220d..883f8fa2 100644 --- a/dlls/hamsandwich/DataHandler.h +++ b/dlls/hamsandwich/DataHandler.h @@ -1,304 +1,389 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#ifndef RETURNHANDLER_H -#define RETURNHANDLER_H - -#include "ham_utils.h" -#include "CVector.h" -#include "CString.h" -#include "sh_stack.h" - -enum +#ifndef RETURNHANDLER_H +#define RETURNHANDLER_H + +#include "ham_utils.h" +#include "CVector.h" +#include "CString.h" +#include "sh_stack.h" + +enum +{ + RET_VOID, + RET_BOOL, + RET_INTEGER, + RET_SHORT, + RET_FLOAT, + RET_VECTOR, + RET_STRING, + RET_CBASE, + RET_ENTVAR, + RET_EDICT, + RET_TRACE, + RET_ITEMINFO +}; + +typedef struct { - RET_VOID, - RET_INTEGER, - RET_FLOAT, - RET_VECTOR, - RET_STRING, - RET_CBASE, - RET_ENTVAR, - RET_TRACE, - RET_ITEMINFO -}; -// Container for return and parameter data. -// Contains a void pointer, and a flag telling what it contains. -class Data -{ -private: - void *m_data; - int *m_index; - int m_type; - - bool IsSet(void) - { - return (m_type != RET_VOID && - m_data != NULL); - }; - bool IsType(const int type) - { - return (m_type == type); - }; - -public: - Data() : m_data(NULL), m_index(NULL), m_type(RET_VOID) - { /* nothing */ }; - - Data(int type, void *ptr) : m_data(ptr), m_index(NULL), m_type(type) - { /* nothing */ }; - - Data(int type, void *ptr, int *cptr) : m_data(ptr), m_index(NULL), m_type(type) - { /* nothing */ }; - - ~Data() - { /* nothing */ }; - - int GetType() - { - return m_type; - }; - - // All Get/Set value natives return < 0 on failure. - // -1: Wrong type - // -2: Bad data pointer (void, etc). - int SetInt(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (IsType(RET_INTEGER)) - { - *(reinterpret_cast(m_data))=*data; - return 0; - } - else if (IsType(RET_TRACE)) - { - *(reinterpret_cast(m_data))=*data; - return 0; - } - - return -1; - }; - - int SetFloat(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (!IsType(RET_FLOAT)) - { - return -1; - } - *(reinterpret_cast(m_data))=amx_ctof2(*data); - - return 0; - }; - int SetVector(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (!IsType(RET_VECTOR)) - { - return -1; - } - Vector *vec=reinterpret_cast(m_data); - - vec->x=amx_ctof2(data[0]); - vec->y=amx_ctof2(data[1]); - vec->z=amx_ctof2(data[2]); - - return 0; - }; - int SetString(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (!IsType(RET_STRING)) - { - return -1; - } - - String *str=reinterpret_cast(m_data); - - cell *i=data; - size_t len=0; - - while (*i!=0) - { - i++; - len++; - }; - char *temp=new char[len+1]; - i=data; - char *j=temp; - - while ((*j++=*i++)!=0) - { - /* nothing */ - } - - str->assign(temp); - - delete[] temp; - - return 0; - }; - - int SetEntity(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (IsType(RET_CBASE)) - { - *(reinterpret_cast(m_data))=IndexToPrivate(*data); - if (m_index != 0) - { - *m_index=*data; - } - - return 0; - } - else if (IsType(RET_ENTVAR)) - { - *(reinterpret_cast(m_data))=IndexToEntvar(*data); - if (m_index != 0) - { - *m_index=*data; - } - - return 0; - } - return -1; - }; - - int GetInt(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (IsType(RET_INTEGER)) - { - *data=*(reinterpret_cast(m_data)); - - return 0; - } - else if (IsType(RET_TRACE)) - { - *data=*(reinterpret_cast(m_data)); - - return 0; - } - - return -1; - }; - int GetFloat(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (!IsType(RET_FLOAT)) - { - return -1; - } - *data=amx_ftoc2(*(reinterpret_cast(m_data))); - - return 0; - }; - int GetVector(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (!IsType(RET_VECTOR)) - { - return -1; - } - Vector *vec=reinterpret_cast(m_data); - data[0]=amx_ftoc2(vec->x); - data[1]=amx_ftoc2(vec->y); - data[2]=amx_ftoc2(vec->z); - - return 0; - }; - int GetString(cell *data, int len) - { - if (!IsSet()) - { - return -2; - } - if (!IsType(RET_STRING)) - { - return -1; - } - const char *i=(reinterpret_cast(m_data)->c_str()); - - while (len-- && - (*data++=*i++)!='\0') - { - /* nothing */ - }; - return 0; - }; - int GetEntity(cell *data) - { - if (!IsSet()) - { - return -2; - } - if (IsType(RET_CBASE)) - { - *data=PrivateToIndex(m_data); - - return 0; - } - else if (IsType(RET_ENTVAR)) - { - *data=EntvarToIndex(reinterpret_cast(m_data)); - - return 0; - } - return -1; - } -}; - -extern CStack< Data * > ReturnStack; -extern CStack< Data * > OrigReturnStack; -extern CStack< CVector< Data * > * > ParamStack; -extern CStack< int * > ReturnStatus; -#endif + int iSlot; + int iPosition; + const char *pszAmmo1; + int iMaxAmmo1; + const char *pszAmmo2; + int iMaxAmmo2; + const char *pszName; + int iMaxClip; + int iId; + int iFlags; + int iWeight; +} +ItemInfo; + +enum +{ + ItemInfo_iSlot, + ItemInfo_iPosition, + ItemInfo_pszAmmo1, + ItemInfo_iMaxAmmo1, + ItemInfo_pszAmmo2, + ItemInfo_iMaxAmmo2, + ItemInfo_pszName, + ItemInfo_iMaxClip, + ItemInfo_iId, + ItemInfo_iFlags, + ItemInfo_iWeight +}; + +// Container for return and parameter data. +// Contains a void pointer, and a flag telling what it contains. +class Data +{ +private: + void *m_data; + int *m_index; + int m_type; + + bool IsSet(void) + { + return (m_type != RET_VOID && + m_data != NULL); + }; + bool IsType(const int type) + { + return (m_type == type); + }; + +public: + Data() : m_data(NULL), m_index(NULL), m_type(RET_VOID) + { /* nothing */ }; + + Data(int type, void *ptr) : m_data(ptr), m_index(NULL), m_type(type) + { /* nothing */ }; + + Data(int type, void *ptr, int *cptr) : m_data(ptr), m_index(NULL), m_type(type) + { /* nothing */ }; + + ~Data() + { /* nothing */ }; + + int GetType() + { + return m_type; + }; + + // All Get/Set value natives return < 0 on failure. + // -1: Wrong type + // -2: Bad data pointer (void, etc). + int SetInt(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (IsType(RET_INTEGER)) + { + *(reinterpret_cast(m_data))=*data; + return 0; + } + else if (IsType(RET_BOOL)) + { + *(reinterpret_cast(m_data)) = *data > 0; + return 0; + } + else if (IsType(RET_SHORT)) + { + *(reinterpret_cast(m_data)) = *data; + return 0; + } + else if (IsType(RET_ITEMINFO)) + { + *(reinterpret_cast(m_data)) = *data; + return 0; + } + else if (IsType(RET_TRACE)) + { + *(reinterpret_cast(m_data))=*data; + return 0; + } + + return -1; + }; + + int SetFloat(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (!IsType(RET_FLOAT)) + { + return -1; + } + *(reinterpret_cast(m_data))=amx_ctof2(*data); + + return 0; + }; + int SetVector(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (!IsType(RET_VECTOR)) + { + return -1; + } + Vector *vec=reinterpret_cast(m_data); + + vec->x=amx_ctof2(data[0]); + vec->y=amx_ctof2(data[1]); + vec->z=amx_ctof2(data[2]); + + return 0; + }; + int SetString(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (!IsType(RET_STRING)) + { + return -1; + } + + String *str=reinterpret_cast(m_data); + + cell *i=data; + size_t len=0; + + while (*i!=0) + { + i++; + len++; + }; + char *temp=new char[len+1]; + i=data; + char *j=temp; + + while ((*j++=*i++)!=0) + { + /* nothing */ + } + + str->assign(temp); + + delete[] temp; + + return 0; + }; + + int SetEntity(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (IsType(RET_CBASE)) + { + *(reinterpret_cast(m_data))=IndexToPrivate(*data); + if (m_index != 0) + { + *m_index=*data; + } + + return 0; + } + else if (IsType(RET_ENTVAR)) + { + *(reinterpret_cast(m_data))=IndexToEntvar(*data); + if (m_index != 0) + { + *m_index=*data; + } + + return 0; + } + else if (IsType(RET_EDICT)) + { + *(reinterpret_cast(m_data)) = IndexToEdict(*data); + if (m_index != 0) + { + *m_index = *data; + } + + return 0; + } + return -1; + }; + + int GetInt(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (IsType(RET_INTEGER)) + { + *data=*(reinterpret_cast(m_data)); + + return 0; + } + else if (IsType(RET_BOOL)) + { + *data = *(reinterpret_cast(m_data)); + + return 0; + } + + else if (IsType(RET_SHORT)) + { + *data = *(reinterpret_cast(m_data)); + + return 0; + } + else if (IsType(RET_ITEMINFO)) + { + *data = *(reinterpret_cast(m_data)); + + return 0; + } + else if (IsType(RET_TRACE)) + { + *data=*(reinterpret_cast(m_data)); + + return 0; + } + + return -1; + }; + int GetFloat(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (!IsType(RET_FLOAT)) + { + return -1; + } + *data=amx_ftoc2(*(reinterpret_cast(m_data))); + + return 0; + }; + int GetVector(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (!IsType(RET_VECTOR)) + { + return -1; + } + Vector *vec=reinterpret_cast(m_data); + data[0]=amx_ftoc2(vec->x); + data[1]=amx_ftoc2(vec->y); + data[2]=amx_ftoc2(vec->z); + + return 0; + }; + int GetString(cell *data, int len) + { + if (!IsSet()) + { + return -2; + } + if (!IsType(RET_STRING)) + { + return -1; + } + const char *i=(reinterpret_cast(m_data)->c_str()); + + while (len-- && + (*data++=*i++)!='\0') + { + /* nothing */ + }; + return 0; + }; + int GetEntity(cell *data) + { + if (!IsSet()) + { + return -2; + } + if (IsType(RET_CBASE)) + { + *data=PrivateToIndex(m_data); + + return 0; + } + else if (IsType(RET_ENTVAR)) + { + *data=EntvarToIndex(reinterpret_cast(m_data)); + + return 0; + } + else if (IsType(RET_EDICT)) + { + *data = EdictToIndex(reinterpret_cast(m_data)); + + return 0; + } + return -1; + } +}; + +extern CStack< Data * > ReturnStack; +extern CStack< Data * > OrigReturnStack; +extern CStack< CVector< Data * > * > ParamStack; +extern CStack< int * > ReturnStatus; +#endif diff --git a/dlls/hamsandwich/NEW_Util.h b/dlls/hamsandwich/NEW_Util.h index 9712b45d..31cffe5a 100644 --- a/dlls/hamsandwich/NEW_Util.h +++ b/dlls/hamsandwich/NEW_Util.h @@ -1,87 +1,87 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ - -/* Inlined replacements for INDEXENT/ENTINDEX - * It only really removes the overhead of the push/jump - * but since INDEXENT/ENTINDEX are used a lot with amxx - * it might be beneficial to include. - * NOTE: Bad stuff will happen if you call these before - * NEW_Initialize() - * NOTE: No bounds checking is done because natives - * should use their own bounds checking! - */ - -#ifndef NEW_UTIL_H -#define NEW_UTIL_H - - -extern edict_t *NEW_FirstEdict; -extern bool NEW_Initialized; - -/** - * This is called on the first Spawn() ever hooked. This would be worldspawn (index 0) - */ -inline void NEW_Initialize(edict_t *Entity) -{ - NEW_FirstEdict=Entity; - NEW_Initialized=true; -} - - -/** - * Converts an integer index into an edict pointer - */ -inline edict_t *INDEXENT_NEW(const int Index) -{ - return (edict_t *)(NEW_FirstEdict + Index); -}; - -/** - * Converts an edict pointer into an integer index - */ -inline int ENTINDEX_NEW(const edict_t *Ent) -{ - return (int)(Ent - NEW_FirstEdict); -}; - -// Inlined replacement of MF_GetAmxAddr - - -inline REAL amx_ctof2(cell x) -{ - return *(REAL*)&x; -} -inline cell amx_ftoc2(REAL x) -{ - return *(cell*)&x; -} - - -#endif // NEW_UTIL_H - +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +/* Inlined replacements for INDEXENT/ENTINDEX + * It only really removes the overhead of the push/jump + * but since INDEXENT/ENTINDEX are used a lot with amxx + * it might be beneficial to include. + * NOTE: Bad stuff will happen if you call these before + * NEW_Initialize() + * NOTE: No bounds checking is done because natives + * should use their own bounds checking! + */ + +#ifndef NEW_UTIL_H +#define NEW_UTIL_H + + +extern edict_t *NEW_FirstEdict; +extern bool NEW_Initialized; + +/** + * This is called on the first Spawn() ever hooked. This would be worldspawn (index 0) + */ +inline void NEW_Initialize(edict_t *Entity) +{ + NEW_FirstEdict=Entity; + NEW_Initialized=true; +} + + +/** + * Converts an integer index into an edict pointer + */ +inline edict_t *INDEXENT_NEW(const int Index) +{ + return (edict_t *)(NEW_FirstEdict + Index); +}; + +/** + * Converts an edict pointer into an integer index + */ +inline int ENTINDEX_NEW(const edict_t *Ent) +{ + return (int)(Ent - NEW_FirstEdict); +}; + +// Inlined replacement of MF_GetAmxAddr + + +inline REAL amx_ctof2(cell x) +{ + return *(REAL*)&x; +} +inline cell amx_ftoc2(REAL x) +{ + return *(cell*)&x; +} + + +#endif // NEW_UTIL_H + diff --git a/dlls/hamsandwich/Trampolines.h b/dlls/hamsandwich/Trampolines.h index d074037e..643b87f5 100644 --- a/dlls/hamsandwich/Trampolines.h +++ b/dlls/hamsandwich/Trampolines.h @@ -641,9 +641,9 @@ namespace Trampolines /** * Utility to make a generic trampoline. */ -inline void *CreateGenericTrampoline(bool thiscall, bool voidcall, int paramcount, void *extraptr, void *callee) +inline void *CreateGenericTrampoline(bool thiscall, bool voidcall, bool retbuf, int paramcount, void *extraptr, void *callee) { - Trampolines::TrampolineMaker tramp; + Trampolines::TrampolineMaker tramp; if (voidcall) { @@ -684,7 +684,14 @@ inline void *CreateGenericTrampoline(bool thiscall, bool voidcall, int paramcoun #if defined(_WIN32) tramp.VoidEpilogueAndFree(); #elif defined(__linux__) || defined(__APPLE__) - tramp.VoidEpilogue(); + if (retbuf) + { + tramp.VoidEpilogue(4); + } + else + { + tramp.ThisVoidPrologue(); + } #endif } else diff --git a/dlls/hamsandwich/amxx_api.cpp b/dlls/hamsandwich/amxx_api.cpp index a34d0b5f..0bb08ecb 100644 --- a/dlls/hamsandwich/amxx_api.cpp +++ b/dlls/hamsandwich/amxx_api.cpp @@ -1,122 +1,146 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +#include "amxxmodule.h" +#include + +#include "NEW_Util.h" +#include "CVector.h" +#include "forward.h" +#include "hook.h" +#include "ham_const.h" +#include "hooklist.h" +#include "offsets.h" +#include +#include "DataHandler.h" + +edict_t *NEW_FirstEdict; +bool NEW_Initialized; + +extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; + +extern AMX_NATIVE_INFO RegisterNatives[]; +extern AMX_NATIVE_INFO ReturnNatives[]; +extern AMX_NATIVE_INFO pdata_natives[]; +extern AMX_NATIVE_INFO pdata_natives_safe[]; + + +extern hook_t hooklist[]; + +int ReadConfig(void); + +void OnAmxxAttach(void) +{ + // Assert that the enum is aligned properly with the table + + assert(strcmp(hooklist[Ham_FVecVisible].name, "fvecvisible")==0); + assert(strcmp(hooklist[Ham_Player_UpdateClientData].name, "player_updateclientdata")==0); + assert(strcmp(hooklist[Ham_Item_AddToPlayer].name, "item_addtoplayer")==0); + assert(strcmp(hooklist[Ham_Weapon_ExtractAmmo].name, "weapon_extractammo")==0); + assert(strcmp(hooklist[Ham_TS_BreakableRespawn].name, "ts_breakablerespawn")==0); + assert(strcmp(hooklist[Ham_NS_UpdateOnRemove].name, "ns_updateonremove")==0); + assert(strcmp(hooklist[Ham_TS_ShouldCollide].name, "ts_shouldcollide")==0); + + assert(strcmp(hooklist[Ham_GetDeathActivity].name, "getdeathactivity")==0); + assert(strcmp(hooklist[Ham_StopFollowing].name, "stopfollowing")==0); + assert(strcmp(hooklist[Ham_CS_Player_OnTouchingWeapon].name, "cstrike_player_ontouchingweapon")==0); + assert(strcmp(hooklist[Ham_DOD_Weapon_Special].name, "dod_weapon_special")==0); + assert(strcmp(hooklist[Ham_TFC_RadiusDamage2].name, "tfc_radiusdamage2")==0); + assert(strcmp(hooklist[Ham_ESF_Weapon_HolsterWhenMeleed].name, "esf_weapon_holsterwhenmeleed") == 0); + assert(strcmp(hooklist[Ham_NS_Weapon_GetDeployTime].name, "ns_weapon_getdeploytime")==0); + assert(strcmp(hooklist[Ham_SC_MedicCallSound].name, "sc_mediccallsound")==0); + assert(strcmp(hooklist[Ham_SC_Player_CanTouchPlayer].name, "sc_player_cantouchplayer")==0); + assert(strcmp(hooklist[Ham_SC_Weapon_ChangeWeaponSkin].name, "sc_weapon_changeweaponskin")==0); + assert(strcmp(hooklist[Ham_Item_GetItemInfo].name, "item_getiteminfo") == 0); -#include "amxxmodule.h" -#include + MF_AddNatives(pdata_natives_safe); + if (ReadConfig() > 0) + { + if (Offsets.IsValid()) + { + MF_AddNatives(RegisterNatives); + MF_AddNatives(ReturnNatives); + MF_AddNatives(pdata_natives); + } + else + { +#ifdef _WIN32 + MF_Log("Error: pev and base not set for section \"%s windows\", cannot register natives.", MF_GetModname()); +#elif defined(__linux__) + MF_Log("Error: pev and base not set for section \"%s linux\", cannot register natives.", MF_GetModname()); +#elif defined(__APPLE__) + MF_Log("Error: pev and base not set for section \"%s mac\", cannot register natives.", MF_GetModname()); +#endif + } + } + else + { + MF_Log("Error: Cannot read config file, natives not registered!"); + } +} + +extern CStack g_FreeIIs; -#include "NEW_Util.h" -#include "CVector.h" -#include "forward.h" -#include "hook.h" -#include "ham_const.h" -#include "hooklist.h" -#include "offsets.h" -#include - -edict_t *NEW_FirstEdict; -bool NEW_Initialized; - -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; - -extern AMX_NATIVE_INFO RegisterNatives[]; -extern AMX_NATIVE_INFO ReturnNatives[]; -extern AMX_NATIVE_INFO pdata_natives[]; -extern AMX_NATIVE_INFO pdata_natives_safe[]; - - -extern hook_t hooklist[]; - -int ReadConfig(void); - -void OnAmxxAttach(void) +void OnAmxxDetach() { - // Assert that the enum is aligned properly with the table - - assert(strcmp(hooklist[Ham_FVecVisible].name, "fvecvisible")==0); - assert(strcmp(hooklist[Ham_Player_UpdateClientData].name, "player_updateclientdata")==0); - assert(strcmp(hooklist[Ham_Item_AddToPlayer].name, "item_addtoplayer")==0); - assert(strcmp(hooklist[Ham_Weapon_ExtractAmmo].name, "weapon_extractammo")==0); - assert(strcmp(hooklist[Ham_TS_BreakableRespawn].name, "ts_breakablerespawn")==0); - assert(strcmp(hooklist[Ham_NS_UpdateOnRemove].name, "ns_updateonremove")==0); - assert(strcmp(hooklist[Ham_TS_ShouldCollide].name, "ts_shouldcollide")==0); - - MF_AddNatives(pdata_natives_safe); - if (ReadConfig() > 0) + while (!g_FreeIIs.empty()) { - if (Offsets.IsValid()) - { - MF_AddNatives(RegisterNatives); - MF_AddNatives(ReturnNatives); - MF_AddNatives(pdata_natives); - } - else - { -#ifdef _WIN32 - MF_Log("Error: pev and base not set for section \"%s windows\", cannot register natives.", MF_GetModname()); -#elif defined(__linux__) - MF_Log("Error: pev and base not set for section \"%s linux\", cannot register natives.", MF_GetModname()); -#elif defined(__APPLE__) - MF_Log("Error: pev and base not set for section \"%s mac\", cannot register natives.", MF_GetModname()); -#endif - } + delete g_FreeIIs.front(); + g_FreeIIs.pop(); } - else - { - MF_Log("Error: Cannot read config file, natives not registered!"); - } -} - -void HamCommand(void); - -void OnPluginsUnloaded(void) -{ - - CVector ::iterator end; - for (int i = 0; i < HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) - { - end=hooks[i].end(); - - for (CVector::iterator j=hooks[i].begin(); - j!=end; - ++j) - { - delete (*j); - } - hooks[i].clear(); - } -} - -void OnPluginsLoaded(void) -{ - NEW_Initialize(INDEXENT(0)); -} -void OnMetaAttach(void) -{ - REG_SVR_COMMAND("ham", HamCommand); -} +} + +void HamCommand(void); + +void OnPluginsUnloaded(void) +{ + + CVector ::iterator end; + for (int i = 0; i < HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) + { + end=hooks[i].end(); + + for (CVector::iterator j=hooks[i].begin(); + j!=end; + ++j) + { + delete (*j); + } + hooks[i].clear(); + } +} + +void OnPluginsLoaded(void) +{ + NEW_Initialize(INDEXENT(0)); +} +void OnMetaAttach(void) +{ + REG_SVR_COMMAND("ham", HamCommand); +} diff --git a/dlls/hamsandwich/call_funcs.cpp b/dlls/hamsandwich/call_funcs.cpp index 73b4b49e..c76330c1 100644 --- a/dlls/hamsandwich/call_funcs.cpp +++ b/dlls/hamsandwich/call_funcs.cpp @@ -1,296 +1,231 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#include "amxxmodule.h" - -#include "offsets.h" -#include "ham_utils.h" -#include "hooklist.h" - -#include "CVector.h" -#include "forward.h" -#include "hook.h" - -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; - -void FailPlugin(AMX *amx, int id, int err, const char *reason); - -extern bool gDoForwards; - -inline void *GetFunction(void *pthis, int id, bool &istramp) +#include "amxxmodule.h" + +#include "offsets.h" +#include "ham_utils.h" +#include "hooklist.h" + +#include "CVector.h" +#include "forward.h" +#include "hook.h" +#include "CString.h" + +extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; + +void FailPlugin(AMX *amx, int id, int err, const char *reason); + +extern bool gDoForwards; + +inline void *GetFunction(void *pthis, int id, bool &istramp) +{ + istramp=false; + void *func=GetVTableEntry(pthis, hooklist[id].vtid, Offsets.GetBase()); + + // Check to see if it's a trampoline + CVector::iterator end=hooks[id].end(); + + for (CVector::iterator i=hooks[id].begin(); + i!=end; + ++i) + { + if (func==(*i)->tramp) + { + istramp=true; + return func; + } + } + + return func; +} +inline void *_GetFunction(void *pthis, int id) +{ + void **vtbl=GetVTable(pthis, Offsets.GetBase()); + + int **ivtbl=(int **)vtbl; + void *func=ivtbl[hooklist[id].vtid]; + + // Iterate through the hooks for the id, see if the function is found + CVector::iterator end=hooks[id].end(); + + for (CVector::iterator i=hooks[id].begin(); + i!=end; + ++i) + { + // If the function points to a trampoline, then return the original + // function. + if (func==(*i)->tramp) + { + printf("Func=0x%08X\n",reinterpret_cast((*i)->func)); + return (*i)->func; + } + } + + // this is an original function + printf("Func=0x%08X\n",reinterpret_cast(func)); + return func; +} + +#define SETUP(NUMARGS) \ + if (((NUMARGS + 2) * sizeof(cell)) > (unsigned)params[0]) \ + { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Bad arg count. Expected %d, got %d.", NUMARGS + 2, params[0] / sizeof(cell)); \ + return 0; \ + } \ + int func=params[1]; \ + int id=params[2]; \ + CHECK_FUNCTION(func); \ + CHECK_ENTITY(id); \ + void *pv=IndexToPrivate(id); \ + bool istramp; \ + void *__func=GetFunction(pv, func, istramp); \ + if (!istramp && !gDoForwards) \ + { \ + gDoForwards=true; \ + } + + +cell Call_Void_Void(AMX *amx, cell *params) +{ + SETUP(0); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv); +#endif + return 1; +} + +cell Call_Int_Void(AMX *amx, cell *params) +{ + SETUP(0); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv); +#endif +} + +cell Call_Void_Entvar(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + entvars_t *ev1=&(INDEXENT_NEW(id3)->v); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ev1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ev1); +#endif + return 1; +} + + +cell Call_Void_Cbase(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, pv1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, pv1); +#endif + return 1; +} + +cell Call_Int_Float_Int(AMX *amx, cell *params) +{ + SETUP(2); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + int i4=*MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, f3, i4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, f3, i4); +#endif +} + +cell Call_Int_Float_Int_Int(AMX *amx, cell *params) { - istramp=false; - void *func=GetVTableEntry(pthis, hooklist[id].vtid, Offsets.GetBase()); - - // Check to see if it's a trampoline - CVector::iterator end=hooks[id].end(); - - for (CVector::iterator i=hooks[id].begin(); - i!=end; - ++i) - { - if (func==(*i)->tramp) - { - istramp=true; - return func; - } - } - - return func; -} -inline void *_GetFunction(void *pthis, int id) -{ - void **vtbl=GetVTable(pthis, Offsets.GetBase()); - - int **ivtbl=(int **)vtbl; - void *func=ivtbl[hooklist[id].vtid]; - - // Iterate through the hooks for the id, see if the function is found - CVector::iterator end=hooks[id].end(); - - for (CVector::iterator i=hooks[id].begin(); - i!=end; - ++i) - { - // If the function points to a trampoline, then return the original - // function. - if (func==(*i)->tramp) - { - printf("Func=0x%08X\n",reinterpret_cast((*i)->func)); - return (*i)->func; - } - } - - // this is an original function - printf("Func=0x%08X\n",reinterpret_cast(func)); - return func; -} - -#define SETUP(NUMARGS) \ - if (((NUMARGS + 2) * sizeof(cell)) > (unsigned)params[0]) \ - { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Bad arg count. Expected %d, got %d.", NUMARGS + 2, params[0] / sizeof(cell)); \ - return 0; \ - } \ - int func=params[1]; \ - int id=params[2]; \ - CHECK_FUNCTION(func); \ - CHECK_ENTITY(id); \ - void *pv=IndexToPrivate(id); \ - bool istramp; \ - void *__func=GetFunction(pv, func, istramp); \ - if (!istramp && !gDoForwards) \ - { \ - gDoForwards=true; \ - } - - -cell Call_Void_Void(AMX *amx, cell *params) -{ - SETUP(0); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv); -#endif - return 1; -} - -cell Call_Int_Void(AMX *amx, cell *params) -{ - SETUP(0); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv); -#endif -} - -cell Call_Void_Entvar(AMX *amx, cell *params) -{ - SETUP(1); - - int id3=*MF_GetAmxAddr(amx, params[3]); - - CHECK_ENTITY(id3); - - entvars_t *ev1=&(INDEXENT_NEW(id3)->v); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, ev1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, ev1); -#endif - return 1; -} - - -cell Call_Void_Cbase(AMX *amx, cell *params) -{ - SETUP(1); - - int id3=*MF_GetAmxAddr(amx, params[3]); - - CHECK_ENTITY(id3); - - void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, pv1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, pv1); -#endif - return 1; -} - -cell Call_Int_Float_Int(AMX *amx, cell *params) -{ - SETUP(2); - - float f3=amx_ftoc2(*MF_GetAmxAddr(amx, params[3])); - int i4=*MF_GetAmxAddr(amx, params[4]); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, f3, i4); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, f3, i4); -#endif -} - - -cell Call_Void_Entvar_Int(AMX *amx, cell *params) -{ - SETUP(2); - - int id3=*MF_GetAmxAddr(amx, params[3]); - int i4=*MF_GetAmxAddr(amx, params[4]); - - CHECK_ENTITY(id3); - - entvars_t *ev3=&(INDEXENT_NEW(id3)->v); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, ev3, i4); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, ev3, i4); -#endif - return 1; -} - - -cell Call_Int_Cbase(AMX *amx, cell *params) -{ - SETUP(1); - - int id3=*MF_GetAmxAddr(amx, params[3]); - - CHECK_ENTITY(id3); - - void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, pv1); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, pv1); -#endif -} - -cell Call_Void_Int_Int(AMX *amx, cell *params) -{ - SETUP(2); - - int i3=*MF_GetAmxAddr(amx, params[3]); - int i4=*MF_GetAmxAddr(amx, params[4]); - -#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); - int i3=*MF_GetAmxAddr(amx, params[3]); - char *sz4=MF_GetAmxString(amx, params[4], 0, NULL); + float f3=amx_ctof2(*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, i3, sz4, i5); + return reinterpret_cast(__func)(pv, 0, f3, i4, i5); #elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, i3, sz4, i5); + return reinterpret_cast(__func)(pv, f3, i4, i5); #endif } - -cell Call_Int_Int(AMX *amx, cell *params) + +cell Call_Void_Entvar_Int(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + int i4=*MF_GetAmxAddr(amx, params[4]); + + CHECK_ENTITY(id3); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ev3, i4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ev3, i4); +#endif + return 1; +} + +cell Call_Void_Entvar_Entvar_Int(AMX *amx, cell *params) { - SETUP(1); - - int i3=*MF_GetAmxAddr(amx, params[3]); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, i3); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, i3); -#endif -} - -cell Call_Int_Entvar(AMX *amx, cell *params) -{ - SETUP(1); - - int id3=*MF_GetAmxAddr(amx, params[3]); - - CHECK_ENTITY(id3); - - entvars_t *ev3=&(INDEXENT_NEW(id3)->v); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, ev3); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, ev3); -#endif -} - -cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params) -{ - SETUP(4); + SETUP(3); int id3=*MF_GetAmxAddr(amx, params[3]); int id4=*MF_GetAmxAddr(amx, params[4]); - float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); - int i6=*MF_GetAmxAddr(amx, params[6]); + int i5=*MF_GetAmxAddr(amx, params[5]); CHECK_ENTITY(id3); CHECK_ENTITY(id4); @@ -299,219 +234,1390 @@ cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params) entvars_t *ev4=&(INDEXENT_NEW(id4)->v); #if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, ev3, ev4, f5, i6); + reinterpret_cast(__func)(pv, 0, ev3, ev4, i5); #elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, ev3, ev4, f5, i6); + reinterpret_cast(__func)(pv, ev3, ev4, i5); #endif -} - -cell Call_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, cell *params) -{ - SETUP(5); - - int id3=*MF_GetAmxAddr(amx, params[3]); - int id4=*MF_GetAmxAddr(amx, params[4]); - float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); - float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); - int i7=*MF_GetAmxAddr(amx, params[7]); - - CHECK_ENTITY(id3); - CHECK_ENTITY(id4); - - entvars_t *ev3=&(INDEXENT_NEW(id3)->v); - entvars_t *ev4=&(INDEXENT_NEW(id4)->v); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, ev3, ev4, f5, f6, i7); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, ev3, ev4, f5, f6, i7); -#endif -} - -cell Call_Void_Int(AMX *amx, cell *params) -{ - SETUP(1); - - int i3=*MF_GetAmxAddr(amx, params[3]); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, i3); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, i3); -#endif - return 1; } -cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params) + +cell Call_Int_Cbase(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, pv1); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, pv1); +#endif +} + +cell Call_Void_Int_Int(AMX *amx, cell *params) +{ + SETUP(2); + + int i3=*MF_GetAmxAddr(amx, params[3]); + int i4=*MF_GetAmxAddr(amx, params[4]); + +#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); + + int i3=*MF_GetAmxAddr(amx, params[3]); + char *sz4=MF_GetAmxString(amx, params[4], 0, NULL); + int i5=*MF_GetAmxAddr(amx, params[5]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3, sz4, i5); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3, sz4, i5); +#endif +} + +cell Call_Int_Int_Str_Int_Int(AMX *amx, cell *params) { SETUP(4); - int id3=*MF_GetAmxAddr(amx, params[3]); - int id4=*MF_GetAmxAddr(amx, params[4]); - int i5=*MF_GetAmxAddr(amx, params[5]); - float f6=amx_ctof(*MF_GetAmxAddr(amx, params[6])); - - CHECK_ENTITY(id3); - CHECK_ENTITY(id4); - - void *p3=IndexToPrivate(id3); - void *p4=IndexToPrivate(id4); + int i3 = *MF_GetAmxAddr(amx, params[3]); + char *sz4 = MF_GetAmxString(amx, params[4], 0, NULL); + int i5 = *MF_GetAmxAddr(amx, params[5]); + int i6 = *MF_GetAmxAddr(amx, params[6]); #if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, p3, p4, i5, f6); + return reinterpret_cast(__func)(pv, 0, i3, sz4, i5, i6); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, p3, p4, i5, f6); + return reinterpret_cast(__func)(pv, i3, sz4, i5, i6); #endif - - return 1; -} - -cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params) -{ - SETUP(5); - - int id3=*MF_GetAmxAddr(amx, params[3]); - float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); - Vector v5; - TraceResult *tr6=reinterpret_cast(*MF_GetAmxAddr(amx, params[6])); - int i7=*MF_GetAmxAddr(amx, params[7]); - - float *fl5=(float *)MF_GetAmxAddr(amx, params[5]); - v5.x=fl5[0]; - v5.y=fl5[1]; - v5.z=fl5[2]; - - if (tr6==NULL) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Null traceresult provided."); - - return 0; - } - - CHECK_ENTITY(id3); - - entvars_t *ev3=&(INDEXENT_NEW(id3)->v); -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, ev3, f4, v5, tr6, i7); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, ev3, f4, v5, tr6, i7); -#endif - - return 1; -} - -cell Call_Void_Float_Vector_Trace_Int(AMX *amx, cell *params) +} + +cell Call_Int_Int(AMX *amx, cell *params) +{ + SETUP(1); + + int i3=*MF_GetAmxAddr(amx, params[3]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3); +#endif +} + +cell Call_Int_Entvar(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3); +#endif +} + +cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params) +{ + SETUP(4); + + int id3=*MF_GetAmxAddr(amx, params[3]); + int id4=*MF_GetAmxAddr(amx, params[4]); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + int i6=*MF_GetAmxAddr(amx, params[6]); + + CHECK_ENTITY(id3); + CHECK_ENTITY(id4); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + entvars_t *ev4=&(INDEXENT_NEW(id4)->v); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3, ev4, f5, i6); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3, ev4, f5, i6); +#endif +} + +cell Call_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, cell *params) +{ + SETUP(5); + + int id3=*MF_GetAmxAddr(amx, params[3]); + int id4=*MF_GetAmxAddr(amx, params[4]); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); + int i7=*MF_GetAmxAddr(amx, params[7]); + + CHECK_ENTITY(id3); + CHECK_ENTITY(id4); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + entvars_t *ev4=&(INDEXENT_NEW(id4)->v); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3, ev4, f5, f6, i7); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3, ev4, f5, f6, i7); +#endif +} + +cell Call_Void_Int(AMX *amx, cell *params) +{ + SETUP(1); + + int i3=*MF_GetAmxAddr(amx, params[3]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, i3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, i3); +#endif + + return 1; +} + +cell Call_Vector_Float_Cbase_Int(AMX *amx, cell *params) { SETUP(4); float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); - Vector v4; - TraceResult *tr5=reinterpret_cast(*MF_GetAmxAddr(amx, params[5])); - int i6=*MF_GetAmxAddr(amx, params[6]); + int id4=*MF_GetAmxAddr(amx, params[4]); + int i5=*MF_GetAmxAddr(amx, params[5]); + + CHECK_ENTITY(id4); - float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); - v4.x=fl4[0]; - v4.y=fl4[1]; - v4.z=fl4[2]; - - if (tr5==NULL) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Null traceresult provided."); - - return 0; - } + void *p4=IndexToPrivate(id4); #if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, f3, v4, tr5, i6); + Vector ret; + reinterpret_cast(__func)(pv, 0, &ret, f3, p4, i5); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, f3, v4, tr5, i6); + Vector ret = reinterpret_cast(__func)(pv, f3, p4, i5); #endif + float *out = (float *)MF_GetAmxAddr(amx, params[6]); + out[0] = ret.x; + out[1] = ret.y; + out[2] = ret.z; + return 1; } -cell Call_Str_Void(AMX *amx, cell *params) +cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params) +{ + SETUP(4); + + int id3=*MF_GetAmxAddr(amx, params[3]); + int id4=*MF_GetAmxAddr(amx, params[4]); + int i5=*MF_GetAmxAddr(amx, params[5]); + float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); + + CHECK_ENTITY(id3); + CHECK_ENTITY(id4); + + void *p3=IndexToPrivate(id3); + void *p4=IndexToPrivate(id4); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, p3, p4, i5, f6); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, p3, p4, i5, f6); +#endif + + return 1; +} + +cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params) +{ + SETUP(5); + + int id3=*MF_GetAmxAddr(amx, params[3]); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + Vector v5; + TraceResult *tr6=reinterpret_cast(*MF_GetAmxAddr(amx, params[6])); + int i7=*MF_GetAmxAddr(amx, params[7]); + + float *fl5=(float *)MF_GetAmxAddr(amx, params[5]); + v5.x=fl5[0]; + v5.y=fl5[1]; + v5.z=fl5[2]; + + if (tr6==NULL) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null traceresult provided."); + + return 0; + } + + CHECK_ENTITY(id3); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ev3, f4, v5, tr6, i7); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ev3, f4, v5, tr6, i7); +#endif + + return 1; +} + +cell Call_Void_Float_Vector_Trace_Int(AMX *amx, cell *params) +{ + SETUP(4); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + Vector v4; + TraceResult *tr5=reinterpret_cast(*MF_GetAmxAddr(amx, params[5])); + int i6=*MF_GetAmxAddr(amx, params[6]); + + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + + if (tr5==NULL) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null traceresult provided."); + + return 0; + } + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, f3, v4, tr5, i6); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, f3, v4, tr5, i6); +#endif + + return 1; +} + +cell Call_Str_Void(AMX *amx, cell *params) +{ + SETUP(2); + +#if defined(_WIN32) + char *v=reinterpret_cast(__func)(pv, 0); +#elif defined(__linux__) || defined(__APPLE__) + char *v=reinterpret_cast(__func)(pv); +#endif + return MF_SetAmxString(amx, params[3], v == NULL ? "" : v, *MF_GetAmxAddr(amx, params[4])); +} + +cell Call_Cbase_Void(AMX *amx, cell *params) +{ + SETUP(0); +#if defined(_WIN32) + void *ret=reinterpret_cast(__func)(pv, 0); +#elif defined(__linux__) || defined(__APPLE__) + void *ret=reinterpret_cast(__func)(pv); +#endif + return PrivateToIndex(ret); +} + +cell Call_Float_Int(AMX *amx, cell *params) { SETUP(2); + int i3=*MF_GetAmxAddr(amx, params[3]); + #if defined(_WIN32) - char *v=reinterpret_cast(__func)(pv, 0); + float ret=reinterpret_cast(__func)(pv, 0, i3); #elif defined(__linux__) || defined(__APPLE__) - char *v=reinterpret_cast(__func)(pv); + float ret=reinterpret_cast(__func)(pv, i3); #endif - return MF_SetAmxString(amx, params[3], v == NULL ? "" : v, *MF_GetAmxAddr(amx, params[4])); + *MF_GetAmxAddr(amx, params[4])=amx_ftoc2(ret); + return 1; } -cell Call_Cbase_Void(AMX *amx, cell *params) -{ - SETUP(0); +cell Call_Vector_Void(AMX *amx, cell *params) +{ + SETUP(1); +#if defined(_WIN32) + Vector ret; + reinterpret_cast(__func)(pv, 0,&ret); +#elif defined(__linux__) || defined(__APPLE__) + Vector ret=reinterpret_cast(__func)(pv); +#endif + float *out=(float *)MF_GetAmxAddr(amx, params[3]); + out[0]=ret.x; + out[1]=ret.y; + out[2]=ret.z; + + return 1; +} + +cell Call_Vector_pVector(AMX *amx, cell *params) +{ + SETUP(2); + + 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) + Vector ret; + reinterpret_cast(__func)(pv, 0, &ret, &v3); +#elif defined(__linux__) || defined(__APPLE__) + Vector ret=reinterpret_cast(__func)(pv, &v3); +#endif + float *out=(float *)MF_GetAmxAddr(amx, params[4]); + out[0]=ret.x; + out[1]=ret.y; + out[2]=ret.z; + + fl3[0]=v3.x; + fl3[1]=v3.y; + fl3[2]=v3.z; + + return 1; +} + +cell Call_Int_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) + int ret=reinterpret_cast(__func)(pv, 0, &v3); +#elif defined(__linux__) || defined(__APPLE__) + int ret=reinterpret_cast(__func)(pv, &v3); +#endif + + fl3[0]=v3.x; + fl3[1]=v3.y; + fl3[2]=v3.z; + + return ret; +} + +cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params) +{ + SETUP(3); + + int id3=*MF_GetAmxAddr(amx, params[3]); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + + CHECK_ENTITY(id3); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ev3, f4, f5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ev3, f4, f5); +#endif + + return 1; +} + +cell Call_Void_pFloat_pFloat(AMX *amx, cell *params) +{ + SETUP(2); + + float f3; + float f4; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, &f3, &f4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, &f3, &f4); +#endif + + *MF_GetAmxAddr(amx, params[3]) = amx_ftoc2(f3); + *MF_GetAmxAddr(amx, params[4]) = amx_ftoc2(f4); + + return 1; +} + +cell Call_Void_Entvar_Float(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + + CHECK_ENTITY(id3); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3, f4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3, f4); +#endif +} + +cell Call_Void_Int_Int_Int(AMX *amx, cell *params) +{ + SETUP(3); + + int i3=*MF_GetAmxAddr(amx, params[3]); + int i4=*MF_GetAmxAddr(amx, params[4]); + int i5=*MF_GetAmxAddr(amx, params[5]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, i3, i4, i5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, i3, i4, i5); +#endif + return 1; +} + +cell Call_Void_ItemInfo(AMX *amx, cell *params) +{ + SETUP(1); + + void *ptr=reinterpret_cast(*MF_GetAmxAddr(amx, params[3])); + + if (ptr==0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle!"); + return 0; + } +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ptr); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ptr); +#endif + return 1; +} + +cell Call_Float_Void(AMX *amx, cell *params) +{ + SETUP(1); + +#if defined(_WIN32) + float ret=reinterpret_cast(__func)(pv, 0); +#elif defined(__linux__) || defined(__APPLE__) + float ret=reinterpret_cast(__func)(pv); +#endif + *MF_GetAmxAddr(amx, params[3])=amx_ftoc2(ret); + + return 1; + +} +cell Call_Void_Float_Int(AMX* amx, cell* params) +{ + SETUP(2); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + int i4 = *MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, f3, i4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, f3, i4); +#endif + + return 1; +} + +cell Call_Float_Float_Cbase(AMX* amx, cell* params) +{ + SETUP(3); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + int id4=*MF_GetAmxAddr(amx, params[4]); + CHECK_ENTITY(id4); + void *p4 = IndexToPrivate(id4); + #if defined(_WIN32) - void *ret=reinterpret_cast(__func)(pv, 0); + float ret = reinterpret_cast(__func)(pv, 0, f3, p4); #elif defined(__linux__) || defined(__APPLE__) - void *ret=reinterpret_cast(__func)(pv); + float ret = reinterpret_cast(__func)(pv, f3, p4); #endif - return PrivateToIndex(ret); + *MF_GetAmxAddr(amx, params[5]) = amx_ftoc2(ret); + + return 1; } -cell Call_Vector_Void(AMX *amx, cell *params) +cell Call_Void_Float(AMX* amx, cell* params) { SETUP(1); -#if defined(_WIN32) - Vector ret=reinterpret_cast(__func)(pv, 0); -#elif defined(__linux__) || defined(__APPLE__) - Vector ret=reinterpret_cast(__func)(pv); -#endif - float *out=(float *)MF_GetAmxAddr(amx, params[3]); - out[0]=ret.x; - out[1]=ret.y; - out[2]=ret.z; + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, f3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, f3); +#endif return 1; } -cell Call_Vector_pVector(AMX *amx, cell *params) +cell Call_Void_Float_Float_Float_Int(AMX* amx, cell* params) +{ + SETUP(4); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + int i6=*MF_GetAmxAddr(amx, params[6]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, f3, f4, f5, i6); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, f3, f4, f5, i6); +#endif + return 1; +} + +cell Call_Vector_Float(AMX *amx, cell *params) { SETUP(2); - Vector v3; - float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); - v3.x=fl3[0]; - v3.y=fl3[1]; - v3.z=fl3[2]; + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); #if defined(_WIN32) - Vector ret=reinterpret_cast(__func)(pv, 0, &v3); + Vector ret; + reinterpret_cast(__func)(pv, 0, &ret, f3); #elif defined(__linux__) || defined(__APPLE__) - Vector ret=reinterpret_cast(__func)(pv, &v3); + Vector ret = reinterpret_cast(__func)(pv, f3); #endif float *out=(float *)MF_GetAmxAddr(amx, params[4]); out[0]=ret.x; out[1]=ret.y; out[2]=ret.z; - fl3[0]=v3.x; - fl3[1]=v3.y; - fl3[2]=v3.z; + return 1; +} + +cell Call_Void_Float_Cbase(AMX *amx, cell *params) +{ + SETUP(2); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + int id4=*MF_GetAmxAddr(amx, params[4]); + + CHECK_ENTITY(id4); + + void *p4=IndexToPrivate(id4); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, f3, p4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, f3, p4); +#endif return 1; } -cell Call_Int_pVector(AMX *amx, cell *params) +cell Call_Int_Float_Float(AMX *amx, cell *params) +{ + SETUP(2); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, f3, f4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, f3, f4); +#endif +} + +cell Call_Int_Float(AMX *amx, cell *params) { SETUP(1); + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, f3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, f3); +#endif +} + +cell Call_Int_Int_Int(AMX *amx, cell *params) +{ + SETUP(2); + + int i3=*MF_GetAmxAddr(amx, params[3]); + 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); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, sz3, f4, f5, f6); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, sz3, f4, f5, f6); +#endif + + return 1; +} + +cell Call_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, cell *params) +{ + SETUP(6); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); + int i7=*MF_GetAmxAddr(amx, params[7]); + int id8=*MF_GetAmxAddr(amx, params[8]); + + CHECK_ENTITY(id8); + + void *p8=IndexToPrivate(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); + + 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]; + + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, v3, v4, f5, f6); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, v3, v4, f5, f6); +#endif +} + +cell Call_Int_Short(AMX *amx, cell *params) +{ + SETUP(1); + + short s3=*MF_GetAmxAddr(amx, params[3]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, s3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, s3); +#endif +} + +cell Call_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, cell *params) +{ + SETUP(5); + + int id3=*MF_GetAmxAddr(amx, params[3]); + int id4=*MF_GetAmxAddr(amx, params[4]); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + int i6=*MF_GetAmxAddr(amx, params[6]); + int i7=*MF_GetAmxAddr(amx, params[7]); + + CHECK_ENTITY(id3); + CHECK_ENTITY(id4); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + entvars_t *ev4=&(INDEXENT_NEW(id4)->v); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ev3, ev4, f5, i6, i7); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ev3, ev4, f5, i6, i7); +#endif + + return 1; +} + +cell Call_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, cell *params) +{ + SETUP(6); + + Vector v3; + + float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); + v3.x=fl3[0]; + v3.y=fl3[1]; + v3.z=fl3[2]; + + int id4=*MF_GetAmxAddr(amx, params[4]); + int id5=*MF_GetAmxAddr(amx, params[5]); + float f6=amx_ctof2(*MF_GetAmxAddr(amx, params[6])); + int i7=*MF_GetAmxAddr(amx, params[7]); + int i8=*MF_GetAmxAddr(amx, params[8]); + + CHECK_ENTITY(id4); + CHECK_ENTITY(id5); + + entvars_t *ev4=&(INDEXENT_NEW(id4)->v); + entvars_t *ev5=&(INDEXENT_NEW(id5)->v); + + printf("%.2f %.2f %.2f, %d, %d, %f, %d %d\n", v3.x, v3.y, v3.z, id4, id5, f6, i7, i8 ); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, v3, ev4, ev5, f6, i7, i8); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, v3, ev4, ev5, f6, i7, i8); +#endif + + printf("%.2f %.2f %.2f, %d, %d, %f, %d %d\n", v3.x, v3.y, v3.z, id4, id5, f6, i7, i8); + + return 1; +} + +cell Call_Float_Int_Float(AMX *amx, cell *params) +{ + SETUP(3); + + int i3=*MF_GetAmxAddr(amx, params[3]); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + +#if defined(_WIN32) + float ret=reinterpret_cast(__func)(pv, 0, i3, f4); +#elif defined(__linux__) || defined(__APPLE__) + float ret=reinterpret_cast(__func)(pv, i3, f4); +#endif + *MF_GetAmxAddr(amx, params[5])=amx_ftoc2(ret); + + return 1; +} + +cell Call_Int_Str(AMX *amx, cell *params) +{ + SETUP(1); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, sz3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, sz3); +#endif +} + +cell Call_Void_Edict(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + edict_t *ed3=INDEXENT_NEW(id3); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ed3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ed3); +#endif + + return 1; +} + +cell Call_Void_Int_Str_Bool(AMX *amx, cell *params) +{ + SETUP(4); + + char* sz4 = new char[48]; + int i3=*MF_GetAmxAddr(amx, params[3]); + bool b5=*MF_GetAmxAddr(amx, params[5]) ? true : false; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, i3, sz4, b5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, i3, sz4, b5); +#endif + + MF_SetAmxString(amx, params[4], sz4 ? sz4 : "", *MF_GetAmxAddr(amx, params[6])); + delete [] sz4; + return 1; +} + +cell Call_Void_Vector_Vector(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) + reinterpret_cast(__func)(pv, 0, v3, v4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, v3, v4); +#endif + + return 1; +} + +cell Call_Void_Str_Bool(AMX *amx, cell *params) +{ + SETUP(2); + + const char *sz3=STRING(ALLOC_STRING(MF_GetAmxString(amx, params[3], 0, NULL))); + bool b4=*MF_GetAmxAddr(amx, params[4]) ? true : false; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, sz3, b4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, sz3, b4); +#endif + + return 1; +} + +cell Call_Int_Str_Str_Int_Str_Int_Int(AMX* amx, cell* params) +{ + SETUP(6); + + const char *sz3=STRING(ALLOC_STRING(MF_GetAmxString(amx, params[3], 0, NULL))); + const char *sz4=STRING(ALLOC_STRING(MF_GetAmxString(amx, params[4], 1, NULL))); + const char *sz6=STRING(ALLOC_STRING(MF_GetAmxString(amx, params[6], 2, NULL))); + + int i5=*MF_GetAmxAddr(amx, params[5]); + int i7=*MF_GetAmxAddr(amx, params[7]); + int i8=*MF_GetAmxAddr(amx, params[8]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, sz3, sz4, i5, sz6, i7, i8); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, sz3, sz4, i5, sz6, i7, i8); +#endif +} + +cell Call_Int_Int_Int_Float_Int(AMX* amx, cell* params) +{ + SETUP(4); + + int i3=*MF_GetAmxAddr(amx, params[3]); + int i4=*MF_GetAmxAddr(amx, params[4]); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + int i6=*MF_GetAmxAddr(amx, params[6]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, i3, i4, f5, i6); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, i3, i4, f5, i6); +#endif +} + +cell Call_Void_Str_Int(AMX *amx, cell *params) +{ + SETUP(2); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + int i4=*MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, sz3, i4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, sz3, i4); +#endif + + return 1; +} + +cell Call_Void_Cbase_Int(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + void *p8=IndexToPrivate(id3); + + int i4=*MF_GetAmxAddr(amx, params[4]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, p8, i4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, p8, i4); +#endif + + return 1; +} + +cell Call_Void_Str(AMX *amx, cell *params) +{ + SETUP(1); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, sz3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, sz3); +#endif + + return 1; +} + +cell Call_Void_Vector(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) + reinterpret_cast(__func)(pv, 0, v3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, v3); +#endif + + return 1; +} + +cell Call_Int_Str_Vector_Str(AMX* amx, cell* params) +{ + SETUP(3); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + char *sz5=MF_GetAmxString(amx, params[5], 1, NULL); + + Vector v4; + + 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, sz3, v4, sz5); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, sz3, v4, sz5); +#endif +} + +cell Call_Int_Str_Str(AMX* amx, cell* params) +{ + SETUP(2); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + char *sz4=MF_GetAmxString(amx, params[4], 1, NULL); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, sz3, sz4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, sz3, sz4); +#endif +} + +cell Call_Void_Float_Float(AMX *amx, cell *params) +{ + SETUP(2); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, f3, f4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, f3, f4); +#endif + + return 1; +} + +cell Call_Void_Str_Str_Int(AMX *amx, cell *params) +{ + SETUP(3); + + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); + char *sz4=MF_GetAmxString(amx, params[4], 1, NULL); + int i5=*MF_GetAmxAddr(amx, params[5]); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, sz3, sz4, i5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, sz3, sz4, i5); +#endif + + return 1; +} + +cell Call_Int_pVector_pVector_Cbase_pFloat(AMX *amx, cell *params) +{ + SETUP(4); + + Vector v3; + Vector v4; + + float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + + v3.x=fl3[0]; + v3.y=fl3[1]; + v3.z=fl3[2]; + + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + + int id5=*MF_GetAmxAddr(amx, params[5]); + CHECK_ENTITY(id5); + void *p5=IndexToPrivate(id5); + + float f6; + +#if defined(_WIN32) + int ret=reinterpret_cast(__func)(pv, 0, &v3, &v4, p5, &f6); +#elif defined(__linux__) || defined(__APPLE__) + int ret=reinterpret_cast(__func)(pv, &v3, &v4, p5, &f6); +#endif + + fl3[0]=v3.x; + fl3[1]=v3.y; + fl3[2]=v3.z; + + fl4[0]=v4.x; + fl4[1]=v4.y; + fl4[2]=v4.z; + + *MF_GetAmxAddr(amx, params[6]) = amx_ftoc2(f6); + + return ret; +} + +cell Call_Void_Cbase_pVector_Float(AMX *amx, cell *params) +{ + SETUP(3); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + void *i3=IndexToPrivate(id3); + + Vector v4; + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, i3, &v4, f5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, i3, &v4, f5); +#endif + + fl4[0]=v4.x; + fl4[1]=v4.y; + fl4[2]=v4.z; + + return 1; +} + +cell Call_Int_pVector_pVector_Float_Cbase_pVector(AMX *amx, cell *params) +{ + SETUP(5); + + Vector v3; + Vector v4; + + float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + + v3.x=fl3[0]; + v3.y=fl3[1]; + v3.z=fl3[2]; + + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + + int id6=*MF_GetAmxAddr(amx, params[6]); + CHECK_ENTITY(id6); + void *p6=IndexToPrivate(id6); + + Vector v7; + float *fl7=(float *)MF_GetAmxAddr(amx, params[7]); + + v7.x=fl7[0]; + v7.y=fl7[1]; + v7.z=fl7[2]; + +#if defined(_WIN32) + int ret=reinterpret_cast(__func)(pv, 0, &v3, &v4, f5, p6, &v7); +#elif defined(__linux__) || defined(__APPLE__) + int ret=reinterpret_cast(__func)(pv, &v3, &v4, f5, p6, &v7); +#endif + + fl3[0]=v3.x; + fl3[1]=v3.y; + fl3[2]=v3.z; + + fl4[0]=v4.x; + fl4[1]=v4.y; + fl4[2]=v4.z; + + fl7[0]=v7.x; + fl7[1]=v7.y; + fl7[2]=v7.z; + + return ret; +} + +cell Call_Int_Cbase_Bool(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); + + bool b4=*MF_GetAmxAddr(amx, params[4]) ? true : false; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, pv1, b4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, pv1, b4); +#endif +} + +cell Call_Int_Vector_Vector(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_Int_Entvar_Float(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + + CHECK_ENTITY(id3); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, ev3, f4); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, ev3, f4); +#endif +} + +cell Call_Float_Float(AMX *amx, cell *params) +{ + SETUP(2); + + float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); + +#if defined(_WIN32) + float ret=reinterpret_cast(__func)(pv, 0, f3); +#elif defined(__linux__) || defined(__APPLE__) + float ret=reinterpret_cast(__func)(pv, f3); +#endif + *MF_GetAmxAddr(amx, params[4])=amx_ftoc2(ret); + + return 1; +} + +cell Call_Void_Entvar_Entvar_Float(AMX *amx, cell *params) +{ + SETUP(3); + + int id3=*MF_GetAmxAddr(amx, params[3]); + int id4=*MF_GetAmxAddr(amx, params[4]); + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + + CHECK_ENTITY(id3); + CHECK_ENTITY(id4); + + entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + entvars_t *ev4=&(INDEXENT_NEW(id4)->v); + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, ev3, ev4, f5); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, ev3, ev4, f5); +#endif + + return 1; +} + +cell Call_Bool_Void(AMX *amx, cell *params) +{ + SETUP(0); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv); +#endif +} + +cell Call_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX *amx, cell *params) +{ + SETUP(7); + + Vector v3; + Vector v4; + + float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + + v3.x=fl3[0]; + v3.y=fl3[1]; + v3.z=fl3[2]; + + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + + float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); + + int id6=*MF_GetAmxAddr(amx, params[6]); + CHECK_ENTITY(id6); + void *p6=IndexToPrivate(id6); + + Vector v7; + float *fl7=(float *)MF_GetAmxAddr(amx, params[7]); + + v7.x=fl7[0]; + v7.y=fl7[1]; + v7.z=fl7[2]; + + Vector v8; + float *fl8=(float *)MF_GetAmxAddr(amx, params[8]); + + v8.x=fl8[0]; + v8.y=fl8[1]; + v8.z=fl8[2]; + + bool b9=*MF_GetAmxAddr(amx, params[9]) > 0; + +#if defined(_WIN32) + int ret=reinterpret_cast(__func)(pv, 0, &v3, &v4, f5, p6, &v7, &v8, b9); +#elif defined(__linux__) || defined(__APPLE__) + int ret=reinterpret_cast(__func)(pv, &v3, &v4, f5, p6, &v7, &v8, b9); +#endif + + fl3[0]=v3.x; + fl3[1]=v3.y; + fl3[2]=v3.z; + + fl4[0]=v4.x; + fl4[1]=v4.y; + fl4[2]=v4.z; + + fl7[0]=v7.x; + fl7[1]=v7.y; + fl7[2]=v7.z; + + fl8[0]=v8.x; + fl8[1]=v8.y; + fl8[2]=v8.z; + + return ret; +} + +cell Call_Int_Vector_Cbase(AMX *amx, cell *params) +{ + SETUP(2); + Vector v3; float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); v3.x=fl3[0]; v3.y=fl3[1]; v3.z=fl3[2]; + int id4=*MF_GetAmxAddr(amx, params[4]); + CHECK_ENTITY(id4); + void *p4=IndexToPrivate(id4); + #if defined(_WIN32) - int ret=reinterpret_cast(__func)(pv, 0, &v3); + int ret=reinterpret_cast(__func)(pv, 0, v3, p4); #elif defined(__linux__) || defined(__APPLE__) - int ret=reinterpret_cast(__func)(pv, &v3); + int ret=reinterpret_cast(__func)(pv, v3, p4); #endif fl3[0]=v3.x; @@ -521,123 +1627,216 @@ cell Call_Int_pVector(AMX *amx, cell *params) return ret; } -cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params) +cell Call_Int_Vector(AMX *amx, cell *params) +{ + SETUP(1); + + Vector v3; + Vector v4; + + float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); + v3.x=fl3[0]; + v3.y=fl3[1]; + v3.z=fl3[2]; + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, v3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, v3); +#endif +} + +cell Call_Int_Cbase_pVector(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); + + Vector v4; + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + +#if defined(_WIN32) + int ret = reinterpret_cast(__func)(pv, 0, pv1, &v4); +#elif defined(__linux__) || defined(__APPLE__) + int ret = reinterpret_cast(__func)(pv, pv1, &v4); +#endif + + fl4[0]=v4.x; + fl4[1]=v4.y; + fl4[2]=v4.z; + + return ret; +} + +cell Call_Void_Bool(AMX *amx, cell *params) +{ + SETUP(1); + + bool b3=*MF_GetAmxAddr(amx, params[3]) ? true : false; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, b3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, b3); +#endif + + return 1; +} + +cell Call_Bool_Cbase(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + void *pv1=(INDEXENT_NEW(id3)->pvPrivateData); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, pv1); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, pv1); +#endif +} + +cell Call_Bool_Int(AMX *amx, cell *params) +{ + SETUP(1); + + int id3=*MF_GetAmxAddr(amx, params[3]); + +#if defined(_WIN32) + return reinterpret_cast(__func)(pv, 0, id3); +#elif defined(__linux__) || defined(__APPLE__) + return reinterpret_cast(__func)(pv, id3); +#endif +} + +cell Call_Void_Cbase_Float(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + void *p8=IndexToPrivate(id3); + float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); + + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, p8, f4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, p8, f4); +#endif + + return 1; +} + +cell Call_Void_Cbase_Bool(AMX *amx, cell *params) +{ + SETUP(2); + + int id3=*MF_GetAmxAddr(amx, params[3]); + CHECK_ENTITY(id3); + + void *p8=IndexToPrivate(id3); + + bool b4=*MF_GetAmxAddr(amx, params[4]) ? true : false; + +#if defined(_WIN32) + reinterpret_cast(__func)(pv, 0, p8, b4); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(__func)(pv, p8, b4); +#endif + + return 1; +} + +cell Call_Vector_Vector_Vector_Vector(AMX *amx, cell *params) +{ + SETUP(4); + + Vector v3; + float *fl3=(float *)MF_GetAmxAddr(amx, params[3]); + v3.x=fl3[0]; + v3.y=fl3[1]; + v3.z=fl3[2]; + + Vector v4; + float *fl4=(float *)MF_GetAmxAddr(amx, params[4]); + v4.x=fl4[0]; + v4.y=fl4[1]; + v4.z=fl4[2]; + + Vector v5; + float *fl5=(float *)MF_GetAmxAddr(amx, params[5]); + v5.x=fl5[0]; + v5.y=fl5[1]; + v5.z=fl5[2]; + +#if defined(_WIN32) + Vector ret; + reinterpret_cast(__func)(pv, 0, &ret, v3, v4, v5); +#elif defined(__linux__) || defined(__APPLE__) + Vector ret=reinterpret_cast(__func)(pv, v3, v4, v5); +#endif + float *out=(float *)MF_GetAmxAddr(amx, params[6]); + out[0]=ret.x; + out[1]=ret.y; + out[2]=ret.z; + + fl3[0]=v3.x; + fl3[1]=v3.y; + fl3[2]=v3.z; + + fl4[0]=v4.x; + fl4[1]=v4.y; + fl4[2]=v4.z; + + fl5[0]=v5.x; + fl5[1]=v5.y; + fl5[2]=v5.z; + + return 1; +} + +cell Call_Str_Str(AMX *amx, cell *params) { SETUP(3); - int id3=*MF_GetAmxAddr(amx, params[3]); - float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); - float f5=amx_ctof2(*MF_GetAmxAddr(amx, params[5])); - - CHECK_ENTITY(id3); - - entvars_t *ev3=&(INDEXENT_NEW(id3)->v); + char *sz3=MF_GetAmxString(amx, params[3], 0, NULL); #if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, ev3, f4, f5); + char *v=reinterpret_cast(__func)(pv, 0, sz3); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, ev3, f4, f5); + char *v=reinterpret_cast(__func)(pv, sz3); #endif - - return 1; + return MF_SetAmxString(amx, params[4], v == NULL ? "" : v, *MF_GetAmxAddr(amx, params[5])); } -cell Call_Int_pFloat_pFloat(AMX *amx, cell *params) -{ - SETUP(2); - - float f3=amx_ctof2(*MF_GetAmxAddr(amx, params[3])); - float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, &f3, &f4); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, &f3, &f4); -#endif - -} - -cell Call_Void_Entvar_Float(AMX *amx, cell *params) -{ - SETUP(2); - - int id3=*MF_GetAmxAddr(amx, params[3]); - float f4=amx_ctof2(*MF_GetAmxAddr(amx, params[4])); - - CHECK_ENTITY(id3); - - entvars_t *ev3=&(INDEXENT_NEW(id3)->v); - -#if defined(_WIN32) - return reinterpret_cast(__func)(pv, 0, ev3, f4); -#elif defined(__linux__) || defined(__APPLE__) - return reinterpret_cast(__func)(pv, ev3, f4); -#endif -} - -cell Call_Void_Int_Int_Int(AMX *amx, cell *params) -{ - SETUP(2); - - int i3=*MF_GetAmxAddr(amx, params[3]); - int i4=*MF_GetAmxAddr(amx, params[4]); - int i5=*MF_GetAmxAddr(amx, params[5]); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, i3, i4, i5); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, i3, i4, i5); -#endif - return 1; -} - -cell Call_Void_ItemInfo(AMX *amx, cell *params) +cell Call_Void_Short(AMX *amx, cell *params) { SETUP(1); - void *ptr=reinterpret_cast(*MF_GetAmxAddr(amx, params[3])); + short i3=*MF_GetAmxAddr(amx, params[3]); - if (ptr==0) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle!"); - return 0; - } #if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, ptr); + reinterpret_cast(__func)(pv, 0, i3); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, ptr); + reinterpret_cast(__func)(pv, i3); #endif + return 1; } -cell Call_Float_Void(AMX *amx, cell *params) -{ - SETUP(1); -#if defined(_WIN32) - float ret=reinterpret_cast(__func)(pv, 0); -#elif defined(__linux__) || defined(__APPLE__) - float ret=reinterpret_cast(__func)(pv); -#endif - *MF_GetAmxAddr(amx, params[3])=amx_ftoc2(ret); - - return 1; - -} -cell Call_Void_Float_Int(AMX* amx, cell* params) -{ - SETUP(2); - -#if defined(_WIN32) - reinterpret_cast(__func)(pv, 0, amx_ctof2(params[3]), static_cast(params[4])); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(__func)(pv, amx_ctof2(params[3]), static_cast(params[4])); -#endif - return 1; -} cell Call_Deprecated(AMX *amx, cell *params) { MF_LogError(amx, AMX_ERR_NATIVE, "Ham function is deprecated."); return 0; -} +} \ No newline at end of file diff --git a/dlls/hamsandwich/call_funcs.h b/dlls/hamsandwich/call_funcs.h index 2c99e9df..4f3cef63 100644 --- a/dlls/hamsandwich/call_funcs.h +++ b/dlls/hamsandwich/call_funcs.h @@ -1,93 +1,206 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#ifndef HOOK_Call_H -#define HOOK_Call_H +#ifndef HOOK_Call_H +#define HOOK_Call_H + + +cell Call_Void_Void(AMX *amx, cell *params); + +cell Call_Int_Void(AMX *amx, cell *params); + +cell Call_Void_Entvar(AMX *amx, cell *params); + +cell Call_Void_Cbase(AMX *amx, cell *params); + +cell Call_Int_Float_Int(AMX *amx, cell *params); + +cell Call_Int_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); + +cell Call_Int_Cbase(AMX *amx, cell *params); + +cell Call_Void_Int_Int(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(AMX *amx, cell *params); + +cell Call_Int_Entvar(AMX *amx, cell *params); + +cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params); + +cell Call_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, cell *params); + +cell Call_Void_Int(AMX *amx, cell *params); + +cell Call_Vector_Float_Cbase_Int(AMX *amx, cell *params); + +cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params); + +cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params); + +cell Call_Void_Float_Vector_Trace_Int(AMX *amx, cell *params); + +cell Call_Str_Void(AMX *amx, cell *params); + +cell Call_Cbase_Void(AMX *amx, cell *params); + +cell Call_Vector_Void(AMX *amx, cell *params); + +cell Call_Vector_pVector(AMX *amx, cell *params); + +cell Call_Int_pVector(AMX *amx, cell *params); + +cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params); + +cell Call_Void_pFloat_pFloat(AMX *amx, cell *params); + +cell Call_Void_Entvar_Float(AMX *amx, cell *params); + +cell Call_Void_Int_Int_Int(AMX *amx, cell *params); + +cell Call_Void_ItemInfo(AMX *amx, cell *params); + +cell Call_Float_Void(AMX *amx, cell *params); + +cell Call_Void_Float_Int(AMX* amx, cell* params); + +cell Call_Float_Float_Cbase(AMX* amx, cell* params); + +cell Call_Void_Float(AMX* amx, cell* params); + +cell Call_Void_Float_Float_Float_Int(AMX* amx, cell* params); + +cell Call_Float_Int(AMX* amx, cell* params); + +cell Call_Vector_Float(AMX* amx, cell* params); + +cell Call_Void_Float_Cbase(AMX *amx, cell *params); + +cell Call_Int_Float_Float(AMX *amx, cell *params); + +cell Call_Int_Float(AMX *amx, cell *params); + +cell Call_Int_Int_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_Int_Vector_Vector_Float_Float(AMX *amx, cell *params); + +cell Call_Int_Short(AMX *amx, cell *params); + +cell Call_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, cell *params); + +cell Call_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, cell *params); + +cell Call_Float_Int_Float(AMX* amx, cell* params); + +cell Call_Int_Str(AMX* amx, cell* params); + +cell Call_Void_Edict(AMX* amx, cell* params); + +cell Call_Void_Int_Str_Bool(AMX* amx, cell* params); + +cell Call_Void_Vector_Vector(AMX* amx, cell* params); + +cell Call_Void_Str_Bool(AMX* amx, cell* params); + +cell Call_Int_Str_Str_Int_Str_Int_Int(AMX* amx, cell* params); + +cell Call_Int_Int_Int_Float_Int(AMX* amx, cell* params); + +cell Call_Void_Str_Int(AMX* amx, cell* params); + +cell Call_Void_Cbase_Int(AMX* amx, cell* params); + +cell Call_Void_Str(AMX* amx, cell* params); + +cell Call_Void_Vector(AMX* amx, cell* params); + +cell Call_Int_Str_Vector_Str(AMX* amx, cell* params); + +cell Call_Int_Str_Str(AMX* amx, cell* params); + +cell Call_Void_Float_Float(AMX* amx, cell* params); + +cell Call_Void_Str_Str_Int(AMX* amx, cell* params); + +cell Call_Int_pVector_pVector_Cbase_pFloat(AMX* amx, cell* params); + +cell Call_Void_Cbase_pVector_Float(AMX* amx, cell* params); + +cell Call_Int_pVector_pVector_Float_Cbase_pVector(AMX* amx, cell* params); + +cell Call_Int_Cbase_Bool(AMX* amx, cell* params); + +cell Call_Int_Vector_Vector(AMX *amx, cell *params); + +cell Call_Int_Entvar_Float(AMX *amx, cell *params); + +cell Call_Float_Float(AMX* amx, cell* params); + +cell Call_Void_Entvar_Entvar_Float(AMX *amx, cell *params); + +cell Call_Bool_Void(AMX *amx, cell *params); + +cell Call_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX* amx, cell* params); + +cell Call_Int_Vector_Cbase(AMX *amx, cell *params); + +cell Call_Int_Vector(AMX *amx, cell *params); + +cell Call_Int_Cbase_pVector(AMX *amx, cell *params); + +cell Call_Void_Bool(AMX *amx, cell *params); + +cell Call_Bool_Cbase(AMX *amx, cell *params); + +cell Call_Bool_Int(AMX *amx, cell *params); + +cell Call_Void_Cbase_Float(AMX* amx, cell* params); + +cell Call_Void_Cbase_Bool(AMX* amx, cell* params); + +cell Call_Vector_Vector_Vector_Vector(AMX *amx, cell *params); + +cell Call_Str_Str(AMX *amx, cell *params); + +cell Call_Void_Short(AMX *amx, cell *params); -cell Call_Void_Void(AMX *amx, cell *params); - -cell Call_Int_Void(AMX *amx, cell *params); - -cell Call_Void_Entvar(AMX *amx, cell *params); - -cell Call_Void_Cbase(AMX *amx, cell *params); - -cell Call_Int_Float_Int(AMX *amx, cell *params); - -cell Call_Void_Entvar_Int(AMX *amx, cell *params); - -cell Call_Int_Cbase(AMX *amx, cell *params); - -cell Call_Void_Int_Int(AMX *amx, cell *params); - -cell Call_Int_Int_Str_Int(AMX *amx, cell *params); - -cell Call_Int_Int(AMX *amx, cell *params); - -cell Call_Int_Entvar(AMX *amx, cell *params); - -cell Call_Int_Entvar_Entvar_Float_Int(AMX *amx, cell *params); - -cell Call_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, cell *params); - -cell Call_Void_Int(AMX *amx, cell *params); - -cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params); - -cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params); - -cell Call_Void_Float_Vector_Trace_Int(AMX *amx, cell *params); - -cell Call_Str_Void(AMX *amx, cell *params); - -cell Call_Cbase_Void(AMX *amx, cell *params); - -cell Call_Vector_Void(AMX *amx, cell *params); - -cell Call_Vector_pVector(AMX *amx, cell *params); - -cell Call_Int_pVector(AMX *amx, cell *params); - -cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params); - -cell Call_Int_pFloat_pFloat(AMX *amx, cell *params); - -cell Call_Void_Entvar_Float(AMX *amx, cell *params); - -cell Call_Void_Int_Int_Int(AMX *amx, cell *params); - -cell Call_Void_ItemInfo(AMX *amx, cell *params); - -cell Call_Float_Void(AMX *amx, cell *params); - -cell Call_Void_Float_Int(AMX* amx, cell* params); - -cell Call_Deprecated(AMX* amx, cell* params); - -#endif +cell Call_Deprecated(AMX* amx, cell* params); + +#endif diff --git a/dlls/hamsandwich/config/hamdata.ini b/dlls/hamsandwich/config/hamdata.ini deleted file mode 100644 index 08cacf72..00000000 --- a/dlls/hamsandwich/config/hamdata.ini +++ /dev/null @@ -1,2005 +0,0 @@ -; Ham Sandwich module config file. -; -; IMPORTANT: It is highly suggested that you do not modify this file unless -; you know _exactly_ what you are doing! -; -; NOTE: Just because a mod contains a function does not means it will work -; as expected. If, for example, HamKilled() does not work as you think -; it should in Counter-Strike DO NOT FILE A BUG REPORT. This just -; exposes the function for you, whether or not it works, or how it -; works is up to plugin authors to figure out. -; -; NOTE: If a mod is missing keys for a certain native, that particular native -; will not be loaded! Example: Say CS is missing the "takedamage" index -; but has the use and pev indexes. The HamUse and HamePdataCbase natives -; will be registered, but the HamTakeDamage native will not register. -; In addition, any attempts to hook a function who's key is missing will -; result in the plugin failing. -; -; NOTE: The base key is only needed for the linux configs. -; -; NOTE: Any keys that begin with a modname (eg: cstrike_restart) will, -; obviously, only work on that mod and all mirrors of it (eg: czero). -; -; NOTE: If you change this file while the module is already loaded, you will -; need to restart the server for the changes to take effect. Changes to -; this file before the module is loaded will take effect when the module -; loads. -; -; NOTE: All of these offsets and settings are for the latest (at the time of -; release) legitimate version of the mod. However, there is a _chance_ -; that they will work on older (and even newer) versions. -; eg: If they work on non-Steam CS 1.6 this is coincidental, if they do -; not work on non-Steam CS 1.6 this will not be officially fixed. -; -; Mirrors: These take the name of one mod, and copy all of its data to another -; name. An example of a use for this would be cstrike and czero: they -; use the same binary so all of its vtable offsets are guaranteed to -; be identical. Mirrors should always come first in the file! -; -; Version: $Id: hamdata.ini 3687 2008-03-04 18:51:35Z sawce $ - - -@mirror cstrike czero -@mirror ns nsp -@mirror valve ag - -; TODO: check these - all are estimates -@section cstrike linux - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 76 - player_duck 77 - player_prethink 78 - player_postthink 79 - player_getgunposition 80 - player_shouldfadeondeath 66 - player_impulsecommands 83 - player_updateclientdata 82 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 64 - item_canholster 66 - item_holster 67 - item_updateiteminfo 68 - item_preframe 69 - item_postframe 70 - item_drop 71 - item_kill 72 - item_attachtoplayer 73 - item_primaryammoindex 74 - item_secondaryammoindex 75 - item_updateclientdata 76 - item_getweaponptr 77 - item_itemslot 79 - - weapon_extractammo 80 - weapon_extractclipammo 81 - weapon_addweapon 82 - weapon_playemptysound 83 - weapon_resetemptysound 84 - weapon_sendweaponanim 85 - weapon_isusable 86 - weapon_primaryattack 87 - weapon_secondaryattack 88 - weapon_reload 89 - weapon_weaponidle 90 - weapon_retireweapon 91 - weapon_shouldweaponidle 92 - weapon_usedecrement 93 - - cstrike_restart 2 - cstrike_roundrespawn 84 - cstrike_item_candrop 63 - cstrike_item_getmaxspeed 78 - -@end -@section cstrike windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 76 - player_duck 77 - player_prethink 78 - player_postthink 79 - player_getgunposition 80 - player_shouldfadeondeath 66 - player_impulsecommands 83 - player_updateclientdata 82 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 64 - item_canholster 66 - item_holster 67 - item_updateiteminfo 68 - item_preframe 69 - item_postframe 70 - item_drop 71 - item_kill 72 - item_attachtoplayer 73 - item_primaryammoindex 74 - item_secondaryammoindex 75 - item_updateclientdata 76 - item_getweaponptr 77 - item_itemslot 79 - - weapon_extractammo 80 - weapon_extractclipammo 81 - weapon_addweapon 82 - weapon_playemptysound 83 - weapon_resetemptysound 84 - weapon_sendweaponanim 85 - weapon_isusable 86 - weapon_primaryattack 87 - weapon_secondaryattack 88 - weapon_reload 89 - weapon_weaponidle 90 - weapon_retireweapon 91 - weapon_shouldweaponidle 92 - weapon_usedecrement 93 - - cstrike_restart 2 - cstrike_roundrespawn 84 - cstrike_item_candrop 63 - cstrike_item_getmaxspeed 78 -@end - -@section cstrike mac - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 76 - player_duck 77 - player_prethink 78 - player_postthink 79 - player_getgunposition 80 - player_shouldfadeondeath 66 - player_impulsecommands 83 - player_updateclientdata 82 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 64 - item_canholster 66 - item_holster 67 - item_updateiteminfo 68 - item_preframe 69 - item_postframe 70 - item_drop 71 - item_kill 72 - item_attachtoplayer 73 - item_primaryammoindex 74 - item_secondaryammoindex 75 - item_updateclientdata 76 - item_getweaponptr 77 - item_itemslot 79 - - weapon_extractammo 80 - weapon_extractclipammo 81 - weapon_addweapon 82 - weapon_playemptysound 83 - weapon_resetemptysound 84 - weapon_sendweaponanim 85 - weapon_isusable 86 - weapon_primaryattack 87 - weapon_secondaryattack 88 - weapon_reload 89 - weapon_weaponidle 90 - weapon_retireweapon 91 - weapon_shouldweaponidle 92 - weapon_usedecrement 93 - - cstrike_restart 2 - cstrike_roundrespawn 84 - cstrike_item_candrop 63 - cstrike_item_getmaxspeed 78 -@end - -@section dod linux - pev 0 - base 0x154 - - spawn 5 - precache 6 - keyvalue 7 - objectcaps 10 - activate 11 - objectcollisionbox 14 - classify 15 - deathnotice 16 - traceattack 19 - takedamage 20 - takehealth 21 - killed 22 - bloodcolor 23 - tracebleed 24 - mymonsterpointer 25 - mysquadmonsterpointer 26 - gettogglestate 27 - addpoints 28 - addpointstoteam 29 - addplayeritem 30 - removeplayeritem 31 - giveammo 32 - getdelay 33 - ismoving 34 - overridereset 35 - damagedecal 36 - settogglestate 37 - startsneaking 38 - stopsneaking 39 - oncontrols 40 - issneaking 41 - isalive 42 - isbspmodel 43 - reflectgauss 44 - hastarget 45 - isinworld 46 - isplayer 47 - isnetclient 48 - teamid 49 - getnexttarget 50 - think 51 - touch 52 - use 53 - blocked 54 - respawn 55 - updateowner 56 - fbecomeprone 57 - center 58 - eyeposition 59 - earposition 60 - bodytarget 61 - illumination 62 - fvisible 63 - fvecvisible 64 - - player_jump 136 - player_duck 137 - player_prethink 134 - player_postthink 135 - player_getgunposition 128 - player_shouldfadeondeath 68 - player_impulsecommands 139 - player_updateclientdata 138 - - item_addtoplayer 66 - item_addduplicate 67 - item_getiteminfo 68 - item_candeploy 69 - item_deploy 70 - item_canholster 75 - item_holster 76 - item_updateiteminfo 77 - item_preframe 78 - item_postframe 79 - item_drop 80 - item_kill 81 - item_attachtoplayer 82 - item_primaryammoindex 83 - item_secondaryammoindex 84 - item_updateclientdata 85 - item_getweaponptr 86 - item_itemslot 87 - - weapon_extractammo 88 - weapon_extractclipammo 89 - weapon_addweapon 90 - weapon_playemptysound 91 - weapon_resetemptysound 92 - weapon_sendweaponanim 93 - weapon_isusable 94 - weapon_primaryattack 104 - weapon_secondaryattack 105 - weapon_reload 106 - weapon_weaponidle 107 - weapon_retireweapon 108 - weapon_shouldweaponidle 109 - weapon_usedecrement 110 - - dod_roundrespawn 2 - dod_roundrespawnent 3 - dod_roundstore 4 - dod_areasetindex 12 - dod_areasendstatus 13 - dod_getstate 17 - dod_getstateent 18 - dod_item_candrop 72 - -@end -@section dod windows - pev 4 - base 0x0 - - spawn 3 - precache 4 - keyvalue 5 - objectcaps 8 - activate 9 - objectcollisionbox 12 - classify 13 - deathnotice 14 - traceattack 17 - takedamage 18 - takehealth 19 - killed 20 - bloodcolor 21 - tracebleed 22 - mymonsterpointer 23 - mysquadmonsterpointer 24 - gettogglestate 25 - addpoints 26 - addpointstoteam 27 - addplayeritem 28 - removeplayeritem 29 - giveammo 30 - getdelay 31 - ismoving 32 - overridereset 33 - damagedecal 34 - settogglestate 35 - startsneaking 36 - stopsneaking 37 - oncontrols 48 - issneaking 39 - isalive 40 - isbspmodel 41 - reflectgauss 42 - hastarget 43 - isinworld 44 - isplayer 45 - isnetclient 46 - teamid 47 - getnexttarget 48 - think 49 - touch 50 - use 51 - blocked 52 - respawn 53 - updateowner 54 - fbecomeprone 55 - center 56 - eyeposition 57 - earposition 58 - bodytarget 59 - illumination 60 - fvisible 61 - fvecvisible 62 - - player_jump 134 - player_duck 135 - player_prethink 132 - player_postthink 133 - player_getgunposition 126 - player_shouldfadeondeath 66 - player_impulsecommands 137 - player_updateclientdata 136 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 66 - item_candeploy 67 - item_deploy 68 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 85 - - weapon_extractammo 86 - weapon_extractclipammo 87 - weapon_addweapon 88 - weapon_playemptysound 89 - weapon_resetemptysound 90 - weapon_sendweaponanim 91 - weapon_isusable 92 - weapon_primaryattack 102 - weapon_secondaryattack 103 - weapon_reload 104 - weapon_weaponidle 105 - weapon_retireweapon 106 - weapon_shouldweaponidle 107 - weapon_usedecrement 108 - - dod_roundrespawn 0 - dod_roundrespawnent 1 - dod_roundstore 2 - dod_areasetindex 10 - dod_areasendstatus 11 - dod_getstate 15 - dod_getstateent 16 - dod_item_candrop 70 -@end - -; TFC Does not have the following "standard" entries in its vtable: -; addpoints, addpointstoteam -@section tfc linux - pev 0 - base 0x470 - - spawn 3 - precache 4 - keyvalue 5 - objectcaps 8 - activate 9 - setobjectcollisionbox 10 - classify 11 - deathnotice 12 - traceattack 13 - takedamage 14 - takehealth 15 - killed 16 - bloodcolor 17 - tracebleed 18 - istriggered 19 - mymonsterpointer 20 - mysquadmonsterpointer 21 - gettogglestate 22 - addplayeritem 23 - removeplayeritem 24 - giveammo 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 135 - player_duck 136 - player_prethink 137 - player_postthink 138 - player_shouldfadeondeath 69 - player_impulsecommands 139 - - item_addtoplayer 67 - item_addduplicate 68 - item_getiteminfo 70 - item_candeploy 71 - item_deploy 72 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 69 - - weapon_extractammo 85 - weapon_extractclipammo 86 - weapon_addweapon 87 - weapon_playemptysound 88 - weapon_resetemptysound 89 - weapon_sendweaponanim 90 - weapon_isusable 91 - weapon_primaryattack 92 - weapon_secondaryattack 93 - weapon_reload 94 - weapon_weaponidle 95 - weapon_retireweapon 96 - weapon_shouldweaponidle 97 - - tfc_engineeruse 58 - tfc_finished 59 - tfc_empexplode 60 - tfc_calcempdmgrad 61 - tfc_takeempblast 62 - tfc_empremove 63 - tfc_takeconcussionblast 64 - tfc_concuss 65 -@end -@section tfc windows - pev 4 - base 0x0 - - spawn 1 - precache 2 - keyvalue 3 - objectcaps 6 - activate 7 - setobjectcollisionbox 8 - classify 9 - deathnotice 10 - traceattack 11 - takedamage 12 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addplayeritem 21 - removeplayeritem 22 - giveammo 23 - getdelay 24 - ismoving 25 - overridereset 26 - damagedecal 27 - settogglestate 28 - startsneaking 29 - stopsneaking 30 - oncontrols 31 - issneaking 32 - isalive 33 - isbspmodel 34 - reflectgauss 35 - hastarget 36 - isinworld 37 - isplayer 38 - isnetclient 39 - getnexttarget 41 - think 42 - touch 43 - use 44 - blocked 45 - respawn 46 - updateowner 47 - fbecomeprone 48 - center 49 - eyeposition 50 - earposition 51 - bodytarget 52 - illumination 53 - fvisible 54 - fvecvisible 55 - - - player_jump 133 - player_duck 134 - player_prethink 135 - player_postthink 136 - player_shouldfadeondeath 67 - player_impulsecommands 137 - - item_addtoplayer 65 - item_addduplicate 66 - item_getiteminfo 68 - item_candeploy 69 - item_deploy 70 - item_canholster 71 - item_holster 72 - item_updateiteminfo 73 - item_preframe 74 - item_postframe 75 - item_drop 76 - item_kill 77 - item_attachtoplayer 78 - item_primaryammoindex 79 - item_secondaryammoindex 80 - item_updateclientdata 81 - item_getweaponptr 82 - item_itemslot 67 - - weapon_extractammo 83 - weapon_extractclipammo 84 - weapon_addweapon 85 - weapon_playemptysound 86 - weapon_resetemptysound 87 - weapon_sendweaponanim 88 - weapon_isusable 89 - weapon_primaryattack 90 - weapon_secondaryattack 91 - weapon_reload 92 - weapon_weaponidle 93 - weapon_retireweapon 94 - weapon_shouldweaponidle 95 - - tfc_engineeruse 56 - tfc_finished 57 - tfc_empexplode 58 - tfc_calcempdmgrad 59 - tfc_takeempblast 60 - tfc_empremove 61 - tfc_takeconcussionblast 62 - tfc_concuss 63 -@end -; ns's linux binary is compiled with gcc 3.3, so the "base" is 0, and pev is 4 -@section ns linux - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 14 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addpoints 22 - addpointstoteam 23 - addplayeritem 24 - removeplayeritem 25 - giveammo 26 - getdelay 27 - ismoving 28 - overridereset 29 - damagedecal 30 - settogglestate 31 - startsneaking 32 - stopsneaking 33 - oncontrols 34 - issneaking 35 - isalive 36 - isbspmodel 37 - reflectgauss 38 - hastarget 39 - isinworld 40 - isplayer 41 - isnetclient 42 - teamid 43 - getnexttarget 46 - think 47 - touch 48 - use 49 - blocked 50 - respawn 52 - updateowner 53 - fbecomeprone 54 - center 55 - eyeposition 56 - earposition 57 - bodytarget 58 - illumination 59 - fvisible 60 - fvecvisible 61 - - player_jump 83 - player_duck 84 - player_prethink 85 - player_postthink 86 - player_getgunposition 87 - player_shouldfadeondeath 72 - player_impulsecommands 101 - player_updateclientdata 99 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 68 - item_candeploy 69 - item_deploy 70 - item_canholster 71 - item_holster 72 - item_updateiteminfo 74 - item_preframe 75 - item_postframe 76 - item_drop 77 - item_kill 78 - item_attachtoplayer 79 - item_primaryammoindex 80 - item_secondaryammoindex 81 - item_updateclientdata 82 - item_getweaponptr 83 - item_itemslot 84 - - weapon_extractammo 85 - weapon_extractclipammo 86 - weapon_addweapon 87 - weapon_playemptysound 88 - weapon_resetemptysound 89 - weapon_sendweaponanim 94 - weapon_isusable 73 - weapon_primaryattack 98 - weapon_secondaryattack 99 - weapon_reload 100 - weapon_weaponidle 101 - weapon_retireweapon 102 - weapon_shouldweaponidle 103 - weapon_usedecrement 104 - - ns_getpointvalue 13 - ns_awardkill 15 - ns_resetentity 45 - ns_updateonremove 51 -@end -@section ns windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 14 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addpoints 22 - addpointstoteam 23 - addplayeritem 24 - removeplayeritem 25 - giveammo 26 - getdelay 27 - ismoving 28 - overridereset 29 - damagedecal 30 - settogglestate 31 - startsneaking 32 - stopsneaking 33 - oncontrols 34 - issneaking 35 - isalive 36 - isbspmodel 37 - reflectgauss 38 - hastarget 39 - isinworld 40 - isplayer 41 - isnetclient 42 - teamid 43 - getnexttarget 46 - think 47 - touch 48 - use 49 - blocked 50 - respawn 52 - updateowner 53 - fbecomeprone 54 - center 55 - eyeposition 56 - earposition 57 - bodytarget 58 - illumination 59 - fvisible 60 - fvecvisible 61 - - player_jump 83 - player_duck 84 - player_prethink 85 - player_postthink 86 - player_getgunposition 87 - player_shouldfadeondeath 72 - player_impulsecommands 101 - player_updateclientdata 99 - - item_addtoplayer 64 - item_addduplicate 65 - item_getiteminfo 68 - item_candeploy 69 - item_deploy 70 - item_canholster 71 - item_holster 72 - item_updateiteminfo 74 - item_preframe 75 - item_postframe 76 - item_drop 77 - item_kill 78 - item_attachtoplayer 79 - item_primaryammoindex 80 - item_secondaryammoindex 81 - item_updateclientdata 82 - item_getweaponptr 83 - item_itemslot 84 - - weapon_extractammo 85 - weapon_extractclipammo 86 - weapon_addweapon 87 - weapon_playemptysound 88 - weapon_resetemptysound 89 - weapon_sendweaponanim 94 - weapon_isusable 73 - weapon_primaryattack 98 - weapon_secondaryattack 99 - weapon_reload 100 - weapon_weaponidle 101 - weapon_retireweapon 102 - weapon_shouldweaponidle 103 - weapon_usedecrement 104 - - ns_getpointvalue 13 - ns_awardkill 15 - ns_resetentity 45 - ns_updateonremove 51 -@end - -@section ts linux - pev 0 - base 0x60 - - spawn 9 - precache 10 - keyvalue 11 - objectcaps 14 - activate 15 - setobjectcollisionbox 18 - classify 19 - deathnotice 20 - traceattack 21 - takedamage 22 - takehealth 23 - killed 24 - bloodcolor 25 - tracebleed 26 - istriggered 27 - mymonsterpointer 28 - mysquadmonsterpointer 29 - gettogglestate 30 - addpoints 31 - addpointstoteam 32 - addplayeritem 33 - removeplayeritem 34 - giveammo 35 - getdelay 36 - ismoving 37 - overridereset 38 - damagedecal 39 - settogglestate 40 - startsneaking 41 - stopsneaking 42 - oncontrols 43 - issneaking 44 - isalive 45 - isbspmodel 46 - reflectgauss 47 - hastarget 48 - isinworld 49 - isplayer 50 - isnetclient 51 - teamid 52 - getnexttarget 53 - think 54 - touch 55 - use 56 - blocked 57 - respawn 59 - updateowner 60 - fbecomeprone 61 - center 62 - eyeposition 63 - earposition 64 - bodytarget 65 - illumination 66 - fvisible 67 - fvecvisible 68 - - player_jump 86 - player_duck 87 - player_prethink 88 - player_postthink 89 - player_getgunposition 90 - player_shouldfadeondeath 77 - player_impulsecommands 92 - player_updateclientdata 91 - - item_addtoplayer 70 - item_addduplicate 71 - item_candeploy 73 - item_deploy 74 - item_canholster 75 - item_holster 76 - item_updateiteminfo 77 - item_preframe 78 - item_postframe 79 - item_drop 80 - item_kill 81 - item_attachtoplayer 82 - item_primaryammoindex 83 - item_secondaryammoindex 84 - item_updateclientdata 85 - item_getweaponptr 86 - item_itemslot 87 - - weapon_extractammo 88 - weapon_extractclipammo 89 - weapon_addweapon 90 - weapon_playemptysound 91 - weapon_resetemptysound 92 - weapon_sendweaponanim 93 - weapon_isusable 94 - weapon_primaryattack 95 - weapon_secondaryattack 96 - weapon_reload 98 - weapon_weaponidle 99 - weapon_retireweapon 100 - weapon_shouldweaponidle 101 - weapon_usedecrement 102 - - ts_breakablerespawn 2 - ts_canusedthroughwalls 3 - ts_giveslowmul 4 - ts_goslow 5 - ts_inslow 6 - ts_isobjective 7 - ts_enableobjective 8 - ts_onfreeentprivatedata 12 - ts_shouldcollide 13 - - ts_weapon_alternateattack 97 -@end -@section ts windows - pev 4 - base 0x0 - - spawn 7 - precache 8 - keyvalue 9 - objectcaps 12 - activate 13 - setobjectcollisionbox 16 - classify 17 - deathnotice 18 - traceattack 19 - takedamage 20 - takehealth 21 - killed 22 - bloodcolor 23 - tracebleed 24 - istriggered 25 - mymonsterpointer 26 - mysquadmonsterpointer 27 - gettogglestate 28 - addpoints 29 - addpointstoteam 30 - addplayeritem 31 - removeplayeritem 32 - giveammo 33 - getdelay 34 - ismoving 35 - overridereset 36 - damagedecal 37 - settogglestate 38 - startsneaking 39 - stopsneaking 40 - oncontrols 41 - issneaking 42 - isalive 43 - isbspmodel 44 - reflectgauss 45 - hastarget 46 - isinworld 47 - isplayer 48 - isnetclient 49 - teamid 50 - 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 - fvisible 65 - fvecvisible 66 - - player_jump 84 - player_duck 85 - player_prethink 86 - player_postthink 87 - player_getgunposition 88 - player_shouldfadeondeath 75 - player_impulsecommands 90 - player_updateclientdata 89 - - item_addtoplayer 68 - item_addduplicate 69 - item_candeploy 71 - item_deploy 72 - item_canholster 73 - item_holster 74 - item_updateiteminfo 75 - item_preframe 76 - item_postframe 77 - item_drop 78 - item_kill 79 - item_attachtoplayer 80 - item_primaryammoindex 81 - item_secondaryammoindex 82 - item_updateclientdata 83 - item_getweaponptr 84 - item_itemslot 85 - - weapon_extractammo 86 - weapon_extractclipammo 87 - weapon_addweapon 88 - weapon_playemptysound 89 - weapon_resetemptysound 90 - weapon_sendweaponanim 91 - weapon_isusable 92 - weapon_primaryattack 93 - weapon_secondaryattack 94 - weapon_reload 96 - weapon_weaponidle 97 - weapon_retireweapon 98 - weapon_shouldweaponidle 99 - weapon_usedecrement 100 - - ts_breakablerespawn 0 - ts_canusedthroughwalls 1 - ts_giveslowmul 2 - ts_goslow 3 - ts_inslow 4 - ts_isobjective 5 - ts_enableobjective 6 - ts_onfreeentprivatedata 10 - ts_shouldcollide 11 - - ts_weapon_alternateattack 95 -@end - - -@section esf windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - getdelay 24 - ismoving 25 - overridereset 26 - damagedecal 27 - settogglestate 28 - startsneaking 29 - stopsneaking 30 - oncontrols 31 - issneaking 32 - isalive 33 - isbspmodel 34 - reflectgauss 35 - hastarget 36 - isinworld 37 - isplayer 38 - isnetclient 39 - teamid 40 - getnexttarget 41 - think 42 - touch 43 - use 44 - blocked 45 - respawn 46 - updateowner 47 - fbecomeprone 48 - center 49 - eyeposition 50 - earposition 51 - bodytarget 52 - illumination 53 - fvisible 54 - fvecvisible 55 - - player_jump 124 - player_prethink 125 - player_postthink 126 - player_getgunposition 118 - player_shouldfadeondeath 59 - player_impulsecommands 128 - player_updateclientdata 127 - - item_addtoplayer 57 - item_addduplicate 58 - item_getiteminfo 59 - item_candeploy 60 - item_deploy 61 - item_canholster 62 - item_holster 63 - item_updateiteminfo 64 - item_preframe 65 - item_postframe 66 - item_drop 67 - item_kill 68 - item_attachtoplayer 69 - item_primaryammoindex 70 - item_secondaryammoindex 71 - item_updateclientdata 72 - item_getweaponptr 73 - item_itemslot 74 - - weapon_playemptysound 75 - weapon_resetemptysound 76 - weapon_sendweaponanim 77 - weapon_primaryattack 78 - weapon_secondaryattack 79 - weapon_weaponidle 80 - weapon_retireweapon 81 - weapon_shouldweaponidle 82 - weapon_usedecrement 83 -@end -@section esf linux - pev 0 - base 0x60 - - spawn 2 - precache 3 - keyvalue 4 - objectcaps 7 - activate 8 - setobjectcollisionbox 9 - classify 10 - deathnotice 11 - traceattack 12 - takedamage 13 - takehealth 14 - killed 15 - bloodcolor 16 - tracebleed 17 - istriggered 18 - mymonsterpointer 19 - mysquadmonsterpointer 20 - gettogglestate 21 - addpoints 22 - addpointstoteam 23 - addplayeritem 24 - removeplayeritem 25 - getdelay 26 - ismoving 27 - overridereset 28 - damagedecal 29 - settogglestate 30 - startsneaking 31 - stopsneaking 32 - oncontrols 33 - issneaking 34 - isalive 35 - isbspmodel 36 - reflectgauss 37 - hastarget 38 - isinworld 39 - isplayer 40 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 120 - player_shouldfadeondeath 61 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 63 - item_canholster 64 - item_holster 65 - item_updateiteminfo 66 - item_preframe 67 - item_postframe 68 - item_drop 69 - item_kill 70 - item_attachtoplayer 71 - item_primaryammoindex 72 - item_secondaryammoindex 73 - item_updateclientdata 74 - item_getweaponptr 75 - item_itemslot 76 - - weapon_playemptysound 77 - weapon_resetemptysound 78 - weapon_sendweaponanim 79 - weapon_primaryattack 80 - weapon_secondaryattack 81 - weapon_weaponidle 82 - weapon_retireweapon 83 - weapon_shouldweaponidle 84 - weapon_usedecrement 85 -@end - -; ESF Open Beta is built with GCC 3.x, and the VTable was slightly changed -@section esf_openbeta linux - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 131 - player_prethink 132 - player_postthink 133 - player_getgunposition 120 - player_shouldfadeondeath 61 - player_impulsecommands 135 - player_updateclientdata 134 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 63 - item_canholster 64 - item_holster 65 - item_updateiteminfo 66 - item_preframe 67 - item_postframe 68 - item_drop 69 - item_kill 70 - item_attachtoplayer 71 - item_primaryammoindex 72 - item_secondaryammoindex 73 - item_updateclientdata 74 - item_getweaponptr 75 - item_itemslot 76 - - weapon_playemptysound 77 - weapon_resetemptysound 78 - weapon_sendweaponanim 79 - weapon_primaryattack 80 - weapon_secondaryattack 81 - weapon_weaponidle 82 - weapon_retireweapon 83 - weapon_shouldweaponidle 84 - weapon_usedecrement 85 - - esf_isenvmodel 40 - esf_takedamage2 12 - -@end -@section esf_openbeta windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 13 - killed 14 - bloodcolor 15 - tracebleed 16 - istriggered 17 - mymonsterpointer 18 - mysquadmonsterpointer 19 - gettogglestate 20 - addpoints 21 - addpointstoteam 22 - addplayeritem 23 - removeplayeritem 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 41 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - updateowner 49 - fbecomeprone 50 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - fvecvisible 57 - - player_jump 131 - player_prethink 132 - player_postthink 133 - player_getgunposition 120 - player_shouldfadeondeath 61 - player_impulsecommands 135 - player_updateclientdata 134 - - item_addtoplayer 59 - item_addduplicate 60 - item_getiteminfo 61 - item_candeploy 62 - item_deploy 63 - item_canholster 64 - item_holster 65 - item_updateiteminfo 66 - item_preframe 67 - item_postframe 68 - item_drop 69 - item_kill 70 - item_attachtoplayer 71 - item_primaryammoindex 72 - item_secondaryammoindex 73 - item_updateclientdata 74 - item_getweaponptr 75 - item_itemslot 76 - - weapon_playemptysound 77 - weapon_resetemptysound 78 - weapon_sendweaponanim 79 - weapon_primaryattack 80 - weapon_secondaryattack 81 - weapon_weaponidle 82 - weapon_retireweapon 83 - weapon_shouldweaponidle 84 - weapon_usedecrement 85 - - esf_isenvmodel 40 - esf_takedamage2 12 - -@end -@section valve linux - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 41 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 125 - player_duck 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 119 - player_shouldfadeondeath 60 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 58 - item_addduplicate 59 - item_getiteminfo 60 - item_candeploy 61 - item_deploy 62 - item_canholster 63 - item_holster 64 - item_updateiteminfo 65 - item_preframe 66 - item_postframe 67 - item_drop 68 - item_kill 69 - item_attachtoplayer 70 - item_primaryammoindex 71 - item_secondaryammoindex 72 - item_updateclientdata 73 - item_getweaponptr 74 - item_itemslot 75 - - weapon_extractammo 76 - weapon_extractclipammo 77 - weapon_addweapon 78 - weapon_playemptysound 79 - weapon_resetemptysound 80 - weapon_sendweaponanim 81 - weapon_isusable 82 - weapon_primaryattack 83 - weapon_secondaryattack 84 - weapon_reload 85 - weapon_weaponidle 86 - weapon_retireweapon 87 - weapon_shouldweaponidle 88 - weapon_usedecrement 89 -@end -@section valve windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 41 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 125 - player_duck 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 119 - player_shouldfadeondeath 60 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 58 - item_addduplicate 59 - item_getiteminfo 60 - item_candeploy 61 - item_deploy 62 - item_canholster 63 - item_holster 64 - item_updateiteminfo 65 - item_preframe 66 - item_postframe 67 - item_drop 68 - item_kill 69 - item_attachtoplayer 70 - item_primaryammoindex 71 - item_secondaryammoindex 72 - item_updateclientdata 73 - item_getweaponptr 74 - item_itemslot 75 - - weapon_extractammo 76 - weapon_extractclipammo 77 - weapon_addweapon 78 - weapon_playemptysound 79 - weapon_resetemptysound 80 - weapon_sendweaponanim 81 - weapon_isusable 82 - weapon_primaryattack 83 - weapon_secondaryattack 84 - weapon_reload 85 - weapon_weaponidle 86 - weapon_retireweapon 87 - weapon_shouldweaponidle 88 - weapon_usedecrement 89 -@end - -@section valve mac - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - activate 6 - setobjectcollisionbox 7 - classify 8 - deathnotice 9 - traceattack 10 - takedamage 11 - takehealth 12 - killed 13 - bloodcolor 14 - tracebleed 15 - istriggered 16 - mymonsterpointer 17 - mysquadmonsterpointer 18 - gettogglestate 19 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - getdelay 25 - ismoving 26 - overridereset 27 - damagedecal 28 - settogglestate 29 - startsneaking 30 - stopsneaking 31 - oncontrols 32 - issneaking 33 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 41 - getnexttarget 42 - think 43 - touch 44 - use 45 - blocked 46 - respawn 47 - updateowner 48 - fbecomeprone 49 - center 50 - eyeposition 51 - earposition 52 - bodytarget 53 - illumination 54 - fvisible 55 - fvecvisible 56 - - player_jump 125 - player_duck 126 - player_prethink 127 - player_postthink 128 - player_getgunposition 119 - player_shouldfadeondeath 60 - player_impulsecommands 130 - player_updateclientdata 129 - - item_addtoplayer 58 - item_addduplicate 59 - item_getiteminfo 60 - item_candeploy 61 - item_deploy 62 - item_canholster 63 - item_holster 64 - item_updateiteminfo 65 - item_preframe 66 - item_postframe 67 - item_drop 68 - item_kill 69 - item_attachtoplayer 70 - item_primaryammoindex 71 - item_secondaryammoindex 72 - item_updateclientdata 73 - item_getweaponptr 74 - item_itemslot 75 - - weapon_extractammo 76 - weapon_extractclipammo 77 - weapon_addweapon 78 - weapon_playemptysound 79 - weapon_resetemptysound 80 - weapon_sendweaponanim 81 - weapon_isusable 82 - weapon_primaryattack 83 - weapon_secondaryattack 84 - weapon_reload 85 - weapon_weaponidle 86 - weapon_retireweapon 87 - weapon_shouldweaponidle 88 - weapon_usedecrement 89 -@end - -; Sven-Coop has no linux binaries. This makes disassembly much harder. -; These offsets were contributed by ts2do -@section SvenCoop windows - pev 4 - base 0x0 - - spawn 0 - precache 1 - keyvalue 2 - objectcaps 5 - takedamage 11 - addpoints 20 - addpointstoteam 21 - addplayeritem 22 - removeplayeritem 23 - giveammo 24 - oncontrols 32 - isalive 34 - isbspmodel 35 - reflectgauss 36 - hastarget 37 - isinworld 38 - isplayer 39 - isnetclient 40 - teamid 42 - getnexttarget 43 - think 44 - touch 45 - use 46 - blocked 47 - respawn 48 - center 51 - eyeposition 52 - earposition 53 - bodytarget 54 - illumination 55 - fvisible 56 - -@end diff --git a/dlls/hamsandwich/config_parser.cpp b/dlls/hamsandwich/config_parser.cpp index b26b88b5..87dcf6c1 100644 --- a/dlls/hamsandwich/config_parser.cpp +++ b/dlls/hamsandwich/config_parser.cpp @@ -1,403 +1,403 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#include "amxxmodule.h" - -#include "ham_const.h" -#include "hooklist.h" -#include "offsets.h" - -extern hook_t hooklist[]; - -enum -{ - LEX_INVALID = 0, - - LEX_UNKNOWN, - - LEX_START_SEC, - LEX_END_SEC, - - LEX_MIRROR, - - LEX_PEV, - LEX_BASE, - - LEX_END -}; - -const char *tokens[] = -{ - "", // LEX_INVALID - - "", // LEX_UNKNOWN - - "@section", // LEX_START_SEC - "@end", // LEX_END_SEC - - "@mirror", // LEX_MIRROR - - "pev", // LEX_PEV - "base", // LEX_BASE - - "", // LEX_END -}; - -static void trim_line(char *input); -static void read_mirror(char *input); -static void skip_to_end_of_section(FILE *fp); -static int lex(char*& buffer); - -int lex(char*& buffer) -{ - trim_line(buffer); - - size_t len; - - for (int i=0; i= oldinput && - ( *start == '\0' || - *start == ' ' || - *start == '\r' || - *start == '\n' || - *start == '\t')) - { - start--; - } - start++; - *start='\0'; - - // Now find any comments and cut off at the start - - while (*start != '\0') - { - if (*start == ';') - { - *start='\0'; - break; - } - - start++; - } -} - -void skip_to_end_of_section(FILE *fp) -{ - char buffer[1024]; - - while (!feof(fp)) - { - buffer[0]='\0'; - - fgets(buffer, sizeof(buffer)-1, fp); - - trim_line(buffer); - - char *b=&buffer[0]; - if (lex(b)==LEX_END_SEC) - { - break; - } - } -} -static const char* get_localinfo( const char* name , const char* def = 0 ) -{ - const char* b = LOCALINFO( (char*)name ); - if (((b==0)||(*b==0)) && def ) - SET_LOCALINFO((char*)name,(char*)(b = def) ); - return b; -} -int read_start_section(char *data) -{ - if (strncmp(data, CurrentModName, strlen(CurrentModName))==0) - { - data+=strlen(CurrentModName)+1; - trim_line(data); - -#ifdef _WIN32 - if (strcmp(data, "windows")==0) -#elif defined(__linux__) - if (strcmp(data, "linux")==0) -#elif defined(__APPLE__) - if (strcmp(data, "mac")==0) -#endif - { - return 1; - } - } - return 0; -} -int read_number(char *input) -{ - char *end; /* Temporary pointer, needed for strtoul(). */ - - // if begins with 0x or 0X it's to be interpretted as hex - if (*input=='0' && - (*(input+1)=='x' || *(input+1)=='X')) - { - return strtoul(input,&end,16); - } - - // otherwise it's to be interpretted as base 10 - return strtoul(input,&end,10); -} -void process_pev(char *data) -{ - trim_line(data); - Offsets.SetPev(read_number(data)); -} -void process_base(char *data) -{ - trim_line(data); - Offsets.SetBase(read_number(data)); -} -void process_key(char *data) -{ - size_t size=0; - - char *a=data; - - while (*a != ' ' && *a != '\t' && *a != '\0') - { - a++; - size++; - } - - if (size==0) - { - return; - } - int set=0; - for (int i=0; i< HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) - { - if (strncmp(data, hooklist[i].name, size)==0) - { - data+=size+1; - - trim_line(data); - int value=read_number(data); - - hooklist[i].isset=1; - hooklist[i].vtid=value; - - - set=1; - break; - - } - } - - if (set==0) - { - printf("stray key in process_key: %s\n", data); - } - -} -int ReadConfig(void) -{ - char FileName[512]; - - MF_BuildPathnameR(FileName,sizeof(FileName)-1,"%s",get_localinfo("amxx_configsdir","addons/amxmodx/configs")); - - strncat(FileName,"/hamdata.ini",sizeof(FileName)-1); - - FILE *fp=fopen(FileName,"r"); - - - snprintf(CurrentModName, sizeof(CurrentModName)-1, "%s", MF_GetModname()); - - if (!fp) - { - MF_Log("Unable to open \"%s\" for reading.", FileName); - - return -1; - } - - char data[2048]; - - int insec=0; - - while (!feof(fp)) - { - data[0]='\0'; - - fgets(data, sizeof(data)-1, fp); - - char *b=&data[0]; - - switch(lex(b)) - { - case LEX_PEV: - { - if (insec) - { - process_pev(b); - } - break; - }; - case LEX_BASE: - { - if (insec) - { - process_base(b); - } - break; - }; - case LEX_MIRROR: - { - read_mirror(b); - break; - }; - case LEX_START_SEC: - { - insec=read_start_section(b); - - if (!insec) - { - skip_to_end_of_section(fp); - } - break; - }; - case LEX_END_SEC: - { - insec=0; - break; - }; - case LEX_UNKNOWN: - { - if (insec) - { - process_key(b); - } - }; - } - - - } - - return 1; -} +#include "amxxmodule.h" + +#include "ham_const.h" +#include "hooklist.h" +#include "offsets.h" + +extern hook_t hooklist[]; + +enum +{ + LEX_INVALID = 0, + + LEX_UNKNOWN, + + LEX_START_SEC, + LEX_END_SEC, + + LEX_MIRROR, + + LEX_PEV, + LEX_BASE, + + LEX_END +}; + +const char *tokens[] = +{ + "", // LEX_INVALID + + "", // LEX_UNKNOWN + + "@section", // LEX_START_SEC + "@end", // LEX_END_SEC + + "@mirror", // LEX_MIRROR + + "pev", // LEX_PEV + "base", // LEX_BASE + + "", // LEX_END +}; + +static void trim_line(char *input); +static void read_mirror(char *input); +static void skip_to_end_of_section(FILE *fp); +static int lex(char*& buffer); + +int lex(char*& buffer) +{ + trim_line(buffer); + + size_t len; + + for (int i=0; i= oldinput && + ( *start == '\0' || + *start == ' ' || + *start == '\r' || + *start == '\n' || + *start == '\t')) + { + start--; + } + start++; + *start='\0'; + + // Now find any comments and cut off at the start + + while (*start != '\0') + { + if (*start == ';') + { + *start='\0'; + break; + } + + start++; + } +} + +void skip_to_end_of_section(FILE *fp) +{ + char buffer[1024]; + + while (!feof(fp)) + { + buffer[0]='\0'; + + fgets(buffer, sizeof(buffer)-1, fp); + + trim_line(buffer); + + char *b=&buffer[0]; + if (lex(b)==LEX_END_SEC) + { + break; + } + } +} +static const char* get_localinfo( const char* name , const char* def = 0 ) +{ + const char* b = LOCALINFO( (char*)name ); + if (((b==0)||(*b==0)) && def ) + SET_LOCALINFO((char*)name,(char*)(b = def) ); + return b; +} +int read_start_section(char *data) +{ + if (strncasecmp(data, CurrentModName, strlen(CurrentModName))==0) + { + data+=strlen(CurrentModName)+1; + trim_line(data); + +#ifdef _WIN32 + if (strcmp(data, "windows")==0) +#elif defined(__linux__) + if (strcmp(data, "linux")==0) +#elif defined(__APPLE__) + if (strcmp(data, "mac")==0) +#endif + { + return 1; + } + } + return 0; +} +int read_number(char *input) +{ + char *end; /* Temporary pointer, needed for strtoul(). */ + + // if begins with 0x or 0X it's to be interpretted as hex + if (*input=='0' && + (*(input+1)=='x' || *(input+1)=='X')) + { + return strtoul(input,&end,16); + } + + // otherwise it's to be interpretted as base 10 + return strtoul(input,&end,10); +} +void process_pev(char *data) +{ + trim_line(data); + Offsets.SetPev(read_number(data)); +} +void process_base(char *data) +{ + trim_line(data); + Offsets.SetBase(read_number(data)); +} +void process_key(char *data) +{ + size_t size=0; + + char *a=data; + + while (*a != ' ' && *a != '\t' && *a != '\0') + { + a++; + size++; + } + + if (size==0) + { + return; + } + int set=0; + for (int i=0; i< HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) + { + if (strncmp(data, hooklist[i].name, size)==0) + { + data+=size+1; + + trim_line(data); + int value=read_number(data); + + hooklist[i].isset=1; + hooklist[i].vtid=value; + + + set=1; + break; + + } + } + + if (set==0) + { + printf("stray key in process_key: %s\n", data); + } + +} +int ReadConfig(void) +{ + char FileName[512]; + + MF_BuildPathnameR(FileName,sizeof(FileName)-1,"%s",get_localinfo("amxx_configsdir","addons/amxmodx/configs")); + + strncat(FileName,"/hamdata.ini",sizeof(FileName)-1); + + FILE *fp=fopen(FileName,"r"); + + + snprintf(CurrentModName, sizeof(CurrentModName)-1, "%s", MF_GetModname()); + + if (!fp) + { + MF_Log("Unable to open \"%s\" for reading.", FileName); + + return -1; + } + + char data[2048]; + + int insec=0; + + while (!feof(fp)) + { + data[0]='\0'; + + fgets(data, sizeof(data)-1, fp); + + char *b=&data[0]; + + switch(lex(b)) + { + case LEX_PEV: + { + if (insec) + { + process_pev(b); + } + break; + }; + case LEX_BASE: + { + if (insec) + { + process_base(b); + } + break; + }; + case LEX_MIRROR: + { + read_mirror(b); + break; + }; + case LEX_START_SEC: + { + insec=read_start_section(b); + + if (!insec) + { + skip_to_end_of_section(fp); + } + break; + }; + case LEX_END_SEC: + { + insec=0; + break; + }; + case LEX_UNKNOWN: + { + if (insec) + { + process_key(b); + } + }; + } + + + } + + return 1; +} diff --git a/dlls/hamsandwich/forward.h b/dlls/hamsandwich/forward.h index d57a41dd..2e621316 100644 --- a/dlls/hamsandwich/forward.h +++ b/dlls/hamsandwich/forward.h @@ -1,68 +1,68 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#include "amxxmodule.h" - -#ifndef FORWARD_H -#define FORWARD_H - -enum fwdstate -{ - FSTATE_INVALID = 0, - FSTATE_OK, - FSTATE_PAUSE, - FSTATE_STOP, - FSTATE_DESTROY -}; - -class Forward -{ -public: - int id; // id of the forward - fwdstate state; - Forward(int id_) : id(id_), state(FSTATE_OK) - { - /* do nothing */ - }; - Forward() : id(-1), state(FSTATE_INVALID) - { - /* do nothing */ - } - ~Forward() - { - MF_UnregisterSPForward(id); - } - inline void Set(int i) - { - state=FSTATE_OK; - id=i; - }; - -}; - -#endif +#include "amxxmodule.h" + +#ifndef FORWARD_H +#define FORWARD_H + +enum fwdstate +{ + FSTATE_INVALID = 0, + FSTATE_OK, + FSTATE_PAUSE, + FSTATE_STOP, + FSTATE_DESTROY +}; + +class Forward +{ +public: + int id; // id of the forward + fwdstate state; + Forward(int id_) : id(id_), state(FSTATE_OK) + { + /* do nothing */ + }; + Forward() : id(-1), state(FSTATE_INVALID) + { + /* do nothing */ + } + ~Forward() + { + MF_UnregisterSPForward(id); + } + inline void Set(int i) + { + state=FSTATE_OK; + id=i; + }; + +}; + +#endif diff --git a/dlls/hamsandwich/ham_const.h b/dlls/hamsandwich/ham_const.h index 6f938e20..65ef5404 100644 --- a/dlls/hamsandwich/ham_const.h +++ b/dlls/hamsandwich/ham_const.h @@ -1,199 +1,516 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ - -#ifndef HAM_CONST_H -#define HAM_CONST_H - - -enum -{ - HAM_UNSET = 0, - HAM_IGNORED, - HAM_HANDLED, - HAM_OVERRIDE, - HAM_SUPERCEDE -}; - -enum -{ - Ham_Spawn = 0, - Ham_Precache, - Ham_Keyvalue, - Ham_ObjectCaps, - Ham_Activate, - Ham_SetObjectCollisionBox, - Ham_Classify, - Ham_DeathNotice, - Ham_TraceAttack, - Ham_TakeDamage, - Ham_TakeHealth, - Ham_Killed, - Ham_BloodColor, - Ham_TraceBleed, - Ham_IsTriggered, - Ham_MyMonsterPointer, - Ham_MySquadMonsterPointer, - Ham_GetToggleState, - Ham_AddPoints, - Ham_AddPointsToTeam, - Ham_AddPlayerItem, - Ham_RemovePlayerItem, - Ham_GiveAmmo, - Ham_GetDelay, - Ham_IsMoving, - Ham_OverrideReset, - Ham_DamageDecal, - Ham_SetToggleState, - Ham_StartSneaking, - Ham_StopSneaking, - Ham_OnControls, - Ham_IsSneaking, - Ham_IsAlive, - Ham_IsBSPModel, - Ham_ReflectGauss, - Ham_HasTarget, - Ham_IsInWorld, - Ham_IsPlayer, - Ham_IsNetClient, - Ham_TeamId, - Ham_GetNextTarget, - Ham_Think, - Ham_Touch, - Ham_Use, - Ham_Blocked, - Ham_Respawn, - Ham_UpdateOwner, - Ham_FBecomeProne, - Ham_Center, - Ham_EyePosition, - Ham_EarPosition, - Ham_BodyTarget, - Ham_Illumination, - Ham_FVisible, - Ham_FVecVisible, - - Ham_Player_Jump, - Ham_Player_Duck, - Ham_Player_PreThink, - Ham_Player_PostThink, - Ham_Player_GetGunPosition, - Ham_Player_ShouldFadeOnDeath, - Ham_Player_ImpulseCommands, - Ham_Player_UpdateClientData, - - Ham_Item_AddToPlayer, - Ham_Item_AddDuplicate, - Ham_Item_CanDeploy, - Ham_Item_Deploy, - Ham_Item_CanHolster, - Ham_Item_Holster, - Ham_Item_UpdateItemInfo, - Ham_Item_PreFrame, - Ham_Item_PostFrame, - Ham_Item_Drop, - Ham_Item_Kill, - Ham_Item_AttachToPlayer, - Ham_Item_PrimaryAmmoIndex, - Ham_Item_SecondaryAmmoIndex, - Ham_Item_UpdateClientData, - Ham_Item_GetWeaponPtr, - Ham_Item_ItemSlot, - - Ham_Weapon_ExtractAmmo, - Ham_Weapon_ExtractClipAmmo, - Ham_Weapon_AddWeapon, - Ham_Weapon_PlayEmptySound, - Ham_Weapon_ResetEmptySound, - Ham_Weapon_SendWeaponAnim, - Ham_Weapon_IsUsable, - Ham_Weapon_PrimaryAttack, - Ham_Weapon_SecondaryAttack, - Ham_Weapon_Reload, - Ham_Weapon_WeaponIdle, - Ham_Weapon_RetireWeapon, - Ham_Weapon_ShouldWeaponIdle, - Ham_Weapon_UseDecrement, - - Ham_TS_BreakableRespawn, - Ham_TS_CanUsedThroughWalls, - Ham_TS_RespawnWait, - - Ham_CS_Restart, - Ham_CS_RoundRespawn, - Ham_CS_Item_CanDrop, - Ham_CS_Item_GetMaxSpeed, - - Ham_DOD_RoundRespawn, - Ham_DOD_RoundRespawnEnt, - Ham_DOD_RoundStore, - Ham_DOD_AreaSetIndex, - Ham_DOD_AreaSendStatus, - Ham_DOD_GetState, - Ham_DOD_GetStateEnt, - Ham_DOD_Item_CanDrop, - - Ham_TFC_EngineerUse, - Ham_TFC_Finished, - Ham_TFC_EmpExplode, - Ham_TFC_CalcEmpDmgRad, - Ham_TFC_TakeEmpBlast, - Ham_TFC_EmpRemove, - Ham_TFC_TakeConcussionBlast, - Ham_TFC_Concuss, - - Ham_ESF_IsEnvModel, // Only valid in ESF Open Beta - Ham_ESF_TakeDamage2, // Only valid in ESF Open Beta - - Ham_NS_GetPointValue, - Ham_NS_AwardKill, - Ham_NS_ResetEntity, - Ham_NS_UpdateOnRemove, - - Ham_TS_GiveSlowMul, - Ham_TS_GoSlow, - Ham_TS_InSlow, - Ham_TS_IsObjective, - Ham_TS_EnableObjective, - Ham_TS_OnFreeEntPrivateData, - Ham_TS_ShouldCollide, - - HAM_LAST_ENTRY_DONT_USE_ME_LOL -}; - -enum -{ - HAM_OK = 0, +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +#ifndef HAM_CONST_H +#define HAM_CONST_H + + +enum +{ + HAM_UNSET = 0, + HAM_IGNORED, + HAM_HANDLED, + HAM_OVERRIDE, + HAM_SUPERCEDE +}; + +enum +{ + Ham_Spawn = 0, + Ham_Precache, + Ham_Keyvalue, + Ham_ObjectCaps, + Ham_Activate, + Ham_SetObjectCollisionBox, + Ham_Classify, + Ham_DeathNotice, + Ham_TraceAttack, + Ham_TakeDamage, + Ham_TakeHealth, + Ham_Killed, + Ham_BloodColor, + Ham_TraceBleed, + Ham_IsTriggered, + Ham_MyMonsterPointer, + Ham_MySquadMonsterPointer, + Ham_GetToggleState, + Ham_AddPoints, + Ham_AddPointsToTeam, + Ham_AddPlayerItem, + Ham_RemovePlayerItem, + Ham_GiveAmmo, + Ham_GetDelay, + Ham_IsMoving, + Ham_OverrideReset, + Ham_DamageDecal, + Ham_SetToggleState, + Ham_StartSneaking, + Ham_StopSneaking, + Ham_OnControls, + Ham_IsSneaking, + Ham_IsAlive, + Ham_IsBSPModel, + Ham_ReflectGauss, + Ham_HasTarget, + Ham_IsInWorld, + Ham_IsPlayer, + Ham_IsNetClient, + Ham_TeamId, + Ham_GetNextTarget, + Ham_Think, + Ham_Touch, + Ham_Use, + Ham_Blocked, + Ham_Respawn, + Ham_UpdateOwner, + Ham_FBecomeProne, + Ham_Center, + Ham_EyePosition, + Ham_EarPosition, + Ham_BodyTarget, + Ham_Illumination, + Ham_FVisible, + Ham_FVecVisible, + + Ham_Player_Jump, + Ham_Player_Duck, + Ham_Player_PreThink, + Ham_Player_PostThink, + Ham_Player_GetGunPosition, + Ham_Player_ShouldFadeOnDeath, + Ham_Player_ImpulseCommands, + Ham_Player_UpdateClientData, - HAM_INVALID_FUNC, // The function is not valid - HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini - - HAM_ERR_END -}; + Ham_Item_AddToPlayer, + Ham_Item_AddDuplicate, + Ham_Item_CanDeploy, + Ham_Item_Deploy, + Ham_Item_CanHolster, + Ham_Item_Holster, + Ham_Item_UpdateItemInfo, + Ham_Item_PreFrame, + Ham_Item_PostFrame, + Ham_Item_Drop, + Ham_Item_Kill, + Ham_Item_AttachToPlayer, + Ham_Item_PrimaryAmmoIndex, + Ham_Item_SecondaryAmmoIndex, + Ham_Item_UpdateClientData, + Ham_Item_GetWeaponPtr, + Ham_Item_ItemSlot, + + Ham_Weapon_ExtractAmmo, + Ham_Weapon_ExtractClipAmmo, + Ham_Weapon_AddWeapon, + Ham_Weapon_PlayEmptySound, + Ham_Weapon_ResetEmptySound, + Ham_Weapon_SendWeaponAnim, + Ham_Weapon_IsUsable, + Ham_Weapon_PrimaryAttack, + Ham_Weapon_SecondaryAttack, + Ham_Weapon_Reload, + Ham_Weapon_WeaponIdle, + Ham_Weapon_RetireWeapon, + Ham_Weapon_ShouldWeaponIdle, + Ham_Weapon_UseDecrement, + + Ham_TS_BreakableRespawn, + Ham_TS_CanUsedThroughWalls, + Ham_TS_RespawnWait, + + Ham_CS_Restart, + Ham_CS_RoundRespawn, + Ham_CS_Item_CanDrop, + Ham_CS_Item_GetMaxSpeed, + + Ham_DOD_RoundRespawn, + Ham_DOD_RoundRespawnEnt, + Ham_DOD_RoundStore, + Ham_DOD_AreaSetIndex, + Ham_DOD_AreaSendStatus, + Ham_DOD_GetState, + Ham_DOD_GetStateEnt, + Ham_DOD_Item_CanDrop, + + Ham_TFC_EngineerUse, + Ham_TFC_Finished, + Ham_TFC_EmpExplode, + Ham_TFC_CalcEmpDmgRad, + Ham_TFC_TakeEmpBlast, + Ham_TFC_EmpRemove, + Ham_TFC_TakeConcussionBlast, + Ham_TFC_Concuss, + + Ham_ESF_IsEnvModel, // Only valid in ESF Open Beta + Ham_ESF_TakeDamage2, // Only valid in ESF Open Beta + + Ham_NS_GetPointValue, + Ham_NS_AwardKill, + Ham_NS_ResetEntity, + Ham_NS_UpdateOnRemove, + + Ham_TS_GiveSlowMul, + Ham_TS_GoSlow, + Ham_TS_InSlow, + Ham_TS_IsObjective, + Ham_TS_EnableObjective, + Ham_TS_OnFreeEntPrivateData, + Ham_TS_ShouldCollide, + + // + // New addition - 2011 + // -#endif + Ham_ChangeYaw, + Ham_HasHumanGibs, + Ham_HasAlienGibs, + Ham_FadeMonster, + Ham_GibMonster, + Ham_BecomeDead, + Ham_IRelationship, + Ham_PainSound, + Ham_ReportAIState, + Ham_MonsterInitDead, + Ham_Look, + Ham_BestVisibleEnemy, + Ham_FInViewCone, + Ham_FVecInViewCone, + Ham_GetDeathActivity, + + // Not valid in CS, NS and TS. + Ham_RunAI, + Ham_MonsterThink, + Ham_MonsterInit, + Ham_CheckLocalMove, + Ham_Move, + Ham_MoveExecute, + Ham_ShouldAdvanceRoute, + Ham_GetStoppedActivity, + Ham_Stop, + Ham_CheckRangeAttack1, + Ham_CheckRangeAttack2, + Ham_CheckMeleeAttack1, + Ham_CheckMeleeAttack2, + Ham_ScheduleChange, + Ham_CanPlaySequence, + Ham_CanPlaySentence, + Ham_PlaySentence, + Ham_PlayScriptedSentence, + Ham_SentenceStop, + Ham_GetIdealState, + Ham_SetActivity, + Ham_CheckEnemy, + Ham_FTriangulate, + Ham_SetYawSpeed, + Ham_BuildNearestRoute, + Ham_FindCover, + Ham_CoverRadius, + Ham_FCanCheckAttacks, + Ham_CheckAmmo, + Ham_IgnoreConditions, + Ham_FValidateHintType, + Ham_FCanActiveIdle, + Ham_ISoundMask, + Ham_HearingSensitivity, + Ham_BarnacleVictimBitten, + Ham_BarnacleVictimReleased, + Ham_PrescheduleThink, + Ham_DeathSound, + Ham_AlertSound, + Ham_IdleSound, + Ham_StopFollowing, + + Ham_CS_Weapon_SendWeaponAnim, + Ham_CS_Player_ResetMaxSpeed, + Ham_CS_Player_IsBot, + Ham_CS_Player_GetAutoaimVector, + Ham_CS_Player_Blind, + Ham_CS_Player_OnTouchingWeapon, + + Ham_DOD_SetScriptReset, + Ham_DOD_Item_SpawnDeploy, + Ham_DOD_Item_SetDmgTime, + Ham_DOD_Item_DropGren, + Ham_DOD_Weapon_IsUseable, + Ham_DOD_Weapon_Aim, + Ham_DOD_Weapon_flAim, + Ham_DOD_Weapon_RemoveStamina, + Ham_DOD_Weapon_ChangeFOV, + Ham_DOD_Weapon_ZoomOut, + Ham_DOD_Weapon_ZoomIn, + Ham_DOD_Weapon_GetFOV, + Ham_DOD_Weapon_IsWaterSniping, + Ham_DOD_Weapon_UpdateZoomSpeed, + Ham_DOD_Weapon_Special, + + Ham_TFC_DB_GetItemName, + Ham_TFC_RadiusDamage, + Ham_TFC_RadiusDamage2, + + Ham_ESF_IsFighter, + Ham_ESF_IsBuddy, + Ham_ESF_EmitSound, + Ham_ESF_EmitNullSound, + Ham_ESF_IncreaseStrength, + Ham_ESF_IncreasePL, + Ham_ESF_SetPowerLevel, + Ham_ESF_SetMaxPowerLevel, + Ham_ESF_StopAniTrigger, + Ham_ESF_StopFly, + Ham_ESF_HideWeapon, + Ham_ESF_ClientRemoveWeapon, + Ham_ESF_SendClientsCustomModel, + Ham_ESF_CanTurbo, + Ham_ESF_CanPrimaryFire, + Ham_ESF_CanSecondaryFire, + Ham_ESF_CanStopFly, + Ham_ESF_CanBlock, + Ham_ESF_CanRaiseKi, + Ham_ESF_CanRaiseStamina, + Ham_ESF_CanTeleport, + Ham_ESF_CanStartFly, + Ham_ESF_CanStartPowerup, + Ham_ESF_CanJump, + Ham_ESF_CanWallJump, + Ham_ESF_IsSuperJump, + Ham_ESF_IsMoveBack, + Ham_ESF_CheckWallJump, + Ham_ESF_EnableWallJump, + Ham_ESF_DisableWallJump, + Ham_ESF_ResetWallJumpVars, + Ham_ESF_GetWallJumpAnim, + Ham_ESF_GetWallJumpAnim2, + Ham_ESF_SetWallJumpAnimation, + Ham_ESF_SetFlyMoveType, + Ham_ESF_IsFlyMoveType, + Ham_ESF_IsWalkMoveType, + Ham_ESF_SetWalkMoveType, + Ham_ESF_DrawChargeBar, + Ham_ESF_StartBlock, + Ham_ESF_StopBlock, + Ham_ESF_StartFly, + Ham_ESF_GetMaxSpeed, + Ham_ESF_SetAnimation, + Ham_ESF_PlayAnimation, + Ham_ESF_GetMoveForward, + Ham_ESF_GetMoveRight, + Ham_ESF_GetMoveUp, + Ham_ESF_AddBlindFX, + Ham_ESF_RemoveBlindFX, + Ham_ESF_DisablePSBar, + Ham_ESF_AddBeamBoxCrosshair, + Ham_ESF_RemoveBeamBoxCrosshair, + Ham_ESF_DrawPSWinBonus, + Ham_ESF_DrawPSBar, + Ham_ESF_LockCrosshair, + Ham_ESF_UnLockCrosshair, + Ham_ESF_RotateCrosshair, + Ham_ESF_UnRotateCrosshair, + Ham_ESF_WaterMove, + Ham_ESF_CheckTimeBasedDamage, + Ham_ESF_DoesSecondaryAttack, + Ham_ESF_DoesPrimaryAttack, + Ham_ESF_RemoveSpecialModes, + Ham_ESF_StopTurbo, + Ham_ESF_TakeBean, + Ham_ESF_GetPowerLevel, + Ham_ESF_RemoveAllOtherWeapons, + Ham_ESF_StopSwoop, + Ham_ESF_SetDeathAnimation, + Ham_ESF_SetModel, + Ham_ESF_AddAttacks, + Ham_ESF_EmitClassSound, + Ham_ESF_CheckLightning, + Ham_ESF_FreezeControls, + Ham_ESF_UnFreezeControls, + Ham_ESF_UpdateKi, + Ham_ESF_UpdateHealth, + Ham_ESF_GetTeleportDir, + Ham_ESF_Weapon_HolsterWhenMeleed, + + Ham_NS_SetBoneController, + Ham_NS_SaveDataForReset, + Ham_NS_GetHull, + Ham_NS_GetMaxWalkSpeed, + Ham_NS_SetTeamID, + Ham_NS_GetEffectivePlayerClass, + Ham_NS_GetAuthenticationMask, + Ham_NS_EffectivePlayerClassChanged, + Ham_NS_NeedsTeamUpdate, + Ham_NS_SendTeamUpdate, + Ham_NS_SendWeaponUpdate, + Ham_NS_InitPlayerFromSpawn, + Ham_NS_PackDeadPlayerItems, + Ham_NS_GetAnimationForActivity, + Ham_NS_StartObserver, + Ham_NS_StopObserver, + Ham_NS_GetAdrenalineFactor, + Ham_NS_GetNamedItem, + Ham_NS_Suicide, + Ham_NS_GetCanUseWeapon, + Ham_NS_Weapon_GetWeapPrimeTime, + Ham_NS_Weapon_PrimeWeapon, + Ham_NS_Weapon_GetIsWeaponPrimed, + Ham_NS_Weapon_GetIsWeaponPriming, + Ham_NS_Weapon_DefaultDeploy, + Ham_NS_Weapon_DefaultReload, + Ham_NS_Weapon_GetDeployTime, + + Ham_SC_GetClassification, + Ham_SC_IsMonster, + Ham_SC_IsPhysX, + Ham_SC_IsPointEntity, + Ham_SC_IsMachine, + Ham_SC_CriticalRemove, + Ham_SC_UpdateOnRemove, + Ham_SC_FVisible, + Ham_SC_FVisibleFromPos, + Ham_SC_IsFacings, + Ham_SC_GetPointsForDamage, + Ham_SC_GetDamagePoints, + Ham_SC_OnCreate, + Ham_SC_OnDestroy, + Ham_SC_IsValidEntity, + Ham_SC_ShouldFadeOnDeath, + Ham_SC_SetupFriendly, + Ham_SC_ReviveThink, + Ham_SC_Revive, + Ham_SC_StartMonster, + Ham_SC_CheckRangeAttack1_Move, + Ham_SC_CheckRangeAttack2_Move, + Ham_SC_CheckMeleeAttack1_Move, + Ham_SC_CheckMeleeAttack2_Move, + Ham_SC_CheckTankUsage, + Ham_SC_SetGaitActivity, + Ham_SC_FTriangulate, + Ham_SC_FTriangulateExtension, + Ham_SC_FindCoverGrenade, + Ham_SC_FindCoverDistance, + Ham_SC_FindAttackPoint, + Ham_SC_FValidateCover, + Ham_SC_NoFriendlyFire1, + Ham_SC_NoFriendlyFire2, + Ham_SC_NoFriendlyFire3, + Ham_SC_NoFriendlyFireToPos, + Ham_SC_FVisibleGunPos, + Ham_SC_FInBulletCone, + Ham_SC_CallGibMonster, + Ham_SC_CheckTimeBasedDamage, + Ham_SC_IsMoving, + Ham_SC_IsPlayerFollowing, + Ham_SC_StartPlayerFollowing, + Ham_SC_StopPlayerFollowing, + Ham_SC_UseSound, + Ham_SC_UnUseSound, + Ham_SC_RideMonster, + Ham_SC_CheckApplyGenericAttacks, + Ham_SC_CheckScared, + Ham_SC_CheckCreatureDanger, + Ham_SC_CheckFallDamage, + Ham_SC_CheckRevival, + Ham_SC_MedicCallSound, + + Ham_SC_Player_MenuInputPerformed, + Ham_SC_Player_IsMenuInputDone, + Ham_SC_Player_SpecialSpawn, + Ham_SC_Player_IsValidInfoEntity, + Ham_SC_Player_LevelEnd, + Ham_SC_Player_VoteStarted, + Ham_SC_Player_CanStartNextVote, + Ham_SC_Player_Vote, + Ham_SC_Player_HasVoted, + Ham_SC_Player_ResetVote, + Ham_SC_Player_LastVoteInput, + Ham_SC_Player_InitVote, + Ham_SC_Player_TimeToStartNextVote, + Ham_SC_Player_ResetView, + Ham_SC_Player_GetLogFrequency, + Ham_SC_Player_LogPlayerStats, + Ham_SC_Player_DisableCollisionWithPlayer, + Ham_SC_Player_EnableCollisionWithPlayer, + Ham_SC_Player_CanTouchPlayer, + + Ham_SC_Item_Materialize, + + Ham_SC_Weapon_BulletAccuracy, + Ham_SC_Weapon_TertiaryAttack, + Ham_SC_Weapon_BurstSupplement, + Ham_SC_Weapon_GetP_Model, + Ham_SC_Weapon_GetW_Model, + Ham_SC_Weapon_GetV_Model, + Ham_SC_Weapon_PrecacheCustomModels, + Ham_SC_Weapon_IsMultiplayer, + Ham_SC_Weapon_FRunfuncs, + Ham_SC_Weapon_SetFOV, + Ham_SC_Weapon_FCanRun, + Ham_SC_Weapon_CustomDecrement, + Ham_SC_Weapon_SetV_Model, + Ham_SC_Weapon_SetP_Model, + Ham_SC_Weapon_ChangeWeaponSkin, + + // + // New addition - 2013 + // + + Ham_TFC_Killed, + Ham_TFC_IsTriggered, + Ham_TFC_Weapon_SendWeaponAnim, + Ham_TFC_Weapon_GetNextAttackDelay, + + Ham_SC_TakeHealth, + Ham_SC_TakeArmor, + Ham_SC_GiveAmmo, + Ham_SC_CheckAttacker, + Ham_SC_Player_IsConnected, + + Ham_DOD_Weapon_SendWeaponAnim, + + Ham_CS_Item_IsWeapon, + + Ham_OPF_MySquadTalkMonsterPointer, + Ham_OPF_WeaponTimeBase, + + Ham_TS_Weapon_AlternateAttack, + + Ham_Item_GetItemInfo, + + HAM_LAST_ENTRY_DONT_USE_ME_LOL +}; + +enum +{ + HAM_OK = 0, + + HAM_INVALID_FUNC, // The function is not valid + HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini + + HAM_ERR_END +}; + +#endif diff --git a/dlls/hamsandwich/ham_utils.h b/dlls/hamsandwich/ham_utils.h index 90be9579..ca50bb6c 100644 --- a/dlls/hamsandwich/ham_utils.h +++ b/dlls/hamsandwich/ham_utils.h @@ -1,161 +1,176 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ - -#ifndef HAM_UTILS_H -#define HAM_UTILS_H - -#include "amxxmodule.h" -#include "offsets.h" -#include "NEW_Util.h" - -#define CHECK_FUNCTION(x) \ - if (x < 0 || x >= HAM_LAST_ENTRY_DONT_USE_ME_LOL) { \ - char msg[1024]; \ - snprintf(msg, sizeof(msg)-1, "Function out of bounds. Got: %d Max: %d",x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \ - FailPlugin(amx, x, HAM_INVALID_FUNC, msg); \ - return 0; \ - } else if (hooklist[x].isset == 0) { \ - char msg[1024]; \ - snprintf(msg, sizeof(msg)-1, "Function %s is not configured in hamdata.ini.",hooklist[x].name); \ - FailPlugin(amx, x, HAM_FUNC_NOT_CONFIGURED, msg); \ - return 0; \ - } - - -#define CHECK_ENTITY(x) \ - if (x < 0 || x > gpGlobals->maxEntities) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ - return 0; \ - } else { \ - if (INDEXENT_NEW(x)->free) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity (%d)", x); \ - return 0; \ - } else if (INDEXENT_NEW(x)->pvPrivateData == NULL) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Entity has null private data (%d)", x); \ - return 0; \ - } \ - } - -inline edict_t *PrivateToEdict(const void *pdata) +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +#ifndef HAM_UTILS_H +#define HAM_UTILS_H + +#include "amxxmodule.h" +#include "offsets.h" +#include "NEW_Util.h" + +#define CHECK_FUNCTION(x) \ + if (x < 0 || x >= HAM_LAST_ENTRY_DONT_USE_ME_LOL) { \ + char msg[1024]; \ + snprintf(msg, sizeof(msg)-1, "Function out of bounds. Got: %d Max: %d",x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \ + FailPlugin(amx, x, HAM_INVALID_FUNC, msg); \ + return 0; \ + } else if (hooklist[x].isset == 0) { \ + char msg[1024]; \ + snprintf(msg, sizeof(msg)-1, "Function %s is not configured in hamdata.ini.",hooklist[x].name); \ + FailPlugin(amx, x, HAM_FUNC_NOT_CONFIGURED, msg); \ + return 0; \ + } + + +#define CHECK_ENTITY(x) \ + if (x < 0 || x > gpGlobals->maxEntities) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ + return 0; \ + } else { \ + if (INDEXENT_NEW(x)->free) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity (%d)", x); \ + return 0; \ + } else if (INDEXENT_NEW(x)->pvPrivateData == NULL) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Entity has null private data (%d)", x); \ + return 0; \ + } \ + } + +inline edict_t *PrivateToEdict(const void *pdata) +{ + + if (!pdata) + { + return NULL; + } + + char *ptr=(char*)pdata + Offsets.GetPev(); + entvars_t *pev=(entvars_t *)ptr; + + if (!pev) + { + return NULL; + } + return pev->pContainingEntity; +}; + +inline int PrivateToIndex(const void *pdata) +{ + + if (pdata==NULL) + { + return -1; + } + char *ptr=(char*)pdata; + + ptr+=Offsets.GetPev(); + + entvars_t *pev=*(entvars_t **)ptr; + + + if (pev==NULL) + { + return -1; + } + + if (pev->pContainingEntity==NULL) + { + return -1; + } + + return ENTINDEX_NEW(pev->pContainingEntity); +}; +inline void *IndexToPrivate(int index) +{ + return INDEXENT_NEW(index)->pvPrivateData; +}; +inline entvars_t *IndexToEntvar(int index) +{ + return &(INDEXENT_NEW(index)->v); +}; + +inline int EntvarToIndex(entvars_t *pev) +{ + if (pev==NULL) + { + return -1; + } + + if (pev->pContainingEntity==NULL) + { + return -1; + } + + return ENTINDEX_NEW(pev->pContainingEntity); +}; + +inline int EdictToIndex(edict_t *v) { - - if (!pdata) - { - return NULL; - } - - char *ptr=(char*)pdata + Offsets.GetPev(); - entvars_t *pev=(entvars_t *)ptr; - - if (!pev) - { - return NULL; - } - return pev->pContainingEntity; -}; - -inline int PrivateToIndex(const void *pdata) -{ - - if (pdata==NULL) - { - return -1; - } - char *ptr=(char*)pdata; - - ptr+=Offsets.GetPev(); - - entvars_t *pev=*(entvars_t **)ptr; - - - if (pev==NULL) - { - return -1; - } - - if (pev->pContainingEntity==NULL) + if (v==NULL) { return -1; } - return ENTINDEX_NEW(pev->pContainingEntity); -}; -inline void *IndexToPrivate(int index) -{ - return INDEXENT_NEW(index)->pvPrivateData; -}; -inline entvars_t *IndexToEntvar(int index) -{ - return &(INDEXENT_NEW(index)->v); -}; - -inline int EntvarToIndex(entvars_t *pev) -{ - if (pev==NULL) - { - return -1; - } - - if (pev->pContainingEntity==NULL) - { - return -1; - } - - return ENTINDEX_NEW(pev->pContainingEntity); -}; - -inline edict_t *EntvarToEdict(entvars_t *pev) -{ - if (pev==NULL) - { - return NULL; - } - - return pev->pContainingEntity; -}; -inline void **EdictToVTable(edict_t *ent) -{ - char *btbl=(char *)ent->pvPrivateData; - btbl+=Offsets.GetBase(); - return *((void ***)btbl); -}; - -inline void **GetVTable(void *pthis, int size) -{ - return *((void***)(((char*)pthis)+size)); -} -inline void *GetVTableEntry(void *pthis, int ventry, int size) -{ - void **vtbl=GetVTable(pthis, size); - - return vtbl[ventry]; + return ENTINDEX_NEW(v); } -void print_srvconsole(char *fmt, ...); -#endif +inline edict_t *IndexToEdict(int index) +{ + return INDEXENT_NEW(index); +}; + +inline edict_t *EntvarToEdict(entvars_t *pev) +{ + if (pev==NULL) + { + return NULL; + } + + return pev->pContainingEntity; +}; +inline void **EdictToVTable(edict_t *ent) +{ + char *btbl=(char *)ent->pvPrivateData; + btbl+=Offsets.GetBase(); + return *((void ***)btbl); +}; + +inline void **GetVTable(void *pthis, int size) +{ + return *((void***)(((char*)pthis)+size)); +} +inline void *GetVTableEntry(void *pthis, int ventry, int size) +{ + void **vtbl=GetVTable(pthis, size); + + return vtbl[ventry]; +} + +void print_srvconsole(const char *fmt, ...); +#endif diff --git a/dlls/hamsandwich/hook.h b/dlls/hamsandwich/hook.h index 385e2c8e..330a3f2f 100644 --- a/dlls/hamsandwich/hook.h +++ b/dlls/hamsandwich/hook.h @@ -1,124 +1,124 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#ifndef HOOK_H -#define HOOK_H - -#include "forward.h" -#include "Trampolines.h" - -// This is just a simple container for data so I only have to add 1 extra -// parameter to calls that get trampolined - +#ifndef HOOK_H +#define HOOK_H + +#include "forward.h" +#include "Trampolines.h" + #define ALIGN(ar) ((intptr_t)ar & ~(sysconf(_SC_PAGESIZE)-1)) -class Hook -{ -public: - CVector pre; // pre forwards - CVector post; // post forwards - void *func; // original function - void **vtable; // vtable of the original location - int entry; // vtable entry of the function - void *target; // target function being called (the hook) - int exec; // 1 when this hook is in execution - int del; // 1 if this hook should be destroyed after exec - void *tramp; // trampoline for this hook - char *ent; // ent name that's being hooked - - Hook(void **vtable_, int entry_, void *target_, bool voidcall, int paramcount, char *name) : - func(NULL), vtable(vtable_), entry(entry_), target(target_), exec(0), del(0), tramp(NULL) - { - // original function is vtable[entry] - // to not make the compiler whine, cast vtable to int ** - int **ivtable=(int **)vtable; - func=(void *)ivtable[entry]; - - // now install a trampoline - // (int thiscall, int voidcall, int paramcount, void *extraptr) - tramp=CreateGenericTrampoline(true, voidcall, paramcount, (void*)this, target); - - // Insert into vtable -#if defined(_WIN32) - DWORD OldFlags; - VirtualProtect(&ivtable[entry],sizeof(int*),PAGE_READWRITE,&OldFlags); +// This is just a simple container for data so I only have to add 1 extra +// parameter to calls that get trampolined + +class Hook +{ +public: + CVector pre; // pre forwards + CVector post; // post forwards + void *func; // original function + void **vtable; // vtable of the original location + int entry; // vtable entry of the function + void *target; // target function being called (the hook) + int exec; // 1 when this hook is in execution + int del; // 1 if this hook should be destroyed after exec + void *tramp; // trampoline for this hook + char *ent; // ent name that's being hooked + + Hook(void **vtable_, int entry_, void *target_, bool voidcall, bool retbuf, int paramcount, char *name) : + func(NULL), vtable(vtable_), entry(entry_), target(target_), exec(0), del(0), tramp(NULL) + { + // original function is vtable[entry] + // to not make the compiler whine, cast vtable to int ** + int **ivtable=(int **)vtable; + func=(void *)ivtable[entry]; + + // now install a trampoline + // (int thiscall, int voidcall, int paramcount, void *extraptr) + tramp = CreateGenericTrampoline(true, voidcall, retbuf, paramcount, (void*)this, target); + + // Insert into vtable +#if defined(_WIN32) + DWORD OldFlags; + VirtualProtect(&ivtable[entry],sizeof(int*),PAGE_READWRITE,&OldFlags); +#elif defined(__linux__) || defined(__APPLE__) + void *addr = (void *)ALIGN(&ivtable[entry]); + mprotect(addr,sysconf(_SC_PAGESIZE),PROT_READ|PROT_WRITE); +#endif + ivtable[entry]=(int*)tramp; + + size_t len=strlen(name); + ent=new char[len+1]; + + snprintf(ent,len+1,"%s",name); + }; + + ~Hook() + { + // Insert the original function back into the vtable + int **ivtable=(int **)vtable; + +#if defined(_WIN32) + DWORD OldFlags; + VirtualProtect(&ivtable[entry],sizeof(int*),PAGE_READWRITE,&OldFlags); #elif defined(__linux__) || defined(__APPLE__) - void *addr = (void *)ALIGN(&ivtable[entry]); - mprotect(addr,sysconf(_SC_PAGESIZE),PROT_READ|PROT_WRITE); -#endif - ivtable[entry]=(int*)tramp; - - size_t len=strlen(name); - ent=new char[len+1]; - - snprintf(ent,len+1,"%s",name); - }; - - ~Hook() - { - // Insert the original function back into the vtable - int **ivtable=(int **)vtable; - -#if defined(_WIN32) - DWORD OldFlags; - VirtualProtect(&ivtable[entry],sizeof(int*),PAGE_READWRITE,&OldFlags); -#elif defined(__linux_) || defined(__APPLE__) - void *addr = (void *)ALIGN(&ivtable[entry]); - mprotect(addr,sysconf(_SC_PAGESIZE),PROT_READ|PROT_WRITE); -#endif - - ivtable[entry]=(int *)func; -#if defined(_WIN32) - VirtualFree(tramp, 0, MEM_RELEASE); -#elif defined(__linux__) || defined(__APPLE__) - free(tramp); -#endif - - delete[] ent; - - CVector::iterator end=pre.end(); - - for (CVector::iterator i=pre.begin(); - i!=end; - ++i) - { - delete (*i); - } - end=post.end(); - for (CVector::iterator i=post.begin(); - i!=end; - ++i) - { - delete (*i); - } - pre.clear(); - post.clear(); - } -}; - -#endif + void *addr = (void *)ALIGN(&ivtable[entry]); + mprotect(addr,sysconf(_SC_PAGESIZE),PROT_READ|PROT_WRITE); +#endif + + ivtable[entry]=(int *)func; +#if defined(_WIN32) + VirtualFree(tramp, 0, MEM_RELEASE); +#elif defined(__linux__) || defined(__APPLE__) + free(tramp); +#endif + + delete[] ent; + + CVector::iterator end=pre.end(); + + for (CVector::iterator i=pre.begin(); + i!=end; + ++i) + { + delete (*i); + } + end=post.end(); + for (CVector::iterator i=post.begin(); + i!=end; + ++i) + { + delete (*i); + } + pre.clear(); + post.clear(); + } +}; + +#endif diff --git a/dlls/hamsandwich/hook_callbacks.cpp b/dlls/hamsandwich/hook_callbacks.cpp index 4eb9b246..28034e56 100644 --- a/dlls/hamsandwich/hook_callbacks.cpp +++ b/dlls/hamsandwich/hook_callbacks.cpp @@ -1,329 +1,2538 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ -#include -#include -#include -#include +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ +#include +#include +#include +#include + +#include +#include "amxxmodule.h" + +#include "CVector.h" +#include "CString.h" +#include "sh_stack.h" + +#include "hook.h" +#include "forward.h" + +#include "ham_const.h" +#include "ham_utils.h" + +#include "DataHandler.h" + +extern bool gDoForwards; + +// Return value pushes +#define PUSH_VOID() ReturnStack.push(new Data(RET_VOID, NULL)); OrigReturnStack.push(new Data(RET_VOID, NULL)); +#define PUSH_BOOL() ReturnStack.push(new Data(RET_BOOL, (void *)&ret)); OrigReturnStack.push(new Data(RET_BOOL, (void *)&origret)); +#define PUSH_INT() ReturnStack.push(new Data(RET_INTEGER, (void *)&ret)); OrigReturnStack.push(new Data(RET_INTEGER, (void *)&origret)); +#define PUSH_FLOAT() ReturnStack.push(new Data(RET_FLOAT, (void *)&ret)); OrigReturnStack.push(new Data(RET_FLOAT, (void *)&origret)); +#define PUSH_VECTOR() ReturnStack.push(new Data(RET_VECTOR, (void *)&ret)); OrigReturnStack.push(new Data(RET_VECTOR, (void *)&origret)); +#define PUSH_CBASE() ReturnStack.push(new Data(RET_CBASE, (void *)&ret)); OrigReturnStack.push(new Data(RET_CBASE, (void *)&origret)); +#define PUSH_STRING() ReturnStack.push(new Data(RET_STRING, (void *)&ret)); OrigReturnStack.push(new Data(RET_STRING, (void *)&origret)); + +// Pop off return values +#define POP() delete ReturnStack.front(); ReturnStack.pop(); delete OrigReturnStack.front(); OrigReturnStack.pop(); + +// Parameter value pushes +#define MAKE_VECTOR() \ + int iThis=PrivateToIndex(pthis); \ + CVector *__vec=new CVector; \ + ParamStack.push(__vec); \ + P_CBASE(pthis, iThis) + +#define P_BOOL(___PARAM) __vec->push_back(new Data(RET_BOOL, (void *) & (___PARAM))); +#define P_INT(___PARAM) __vec->push_back(new Data(RET_INTEGER, (void *) & (___PARAM))); +#define P_SHORT(___PARAM) __vec->push_back(new Data(RET_SHORT, (void *) & (___PARAM))); +#define P_FLOAT(___PARAM) __vec->push_back(new Data(RET_FLOAT, (void *) & (___PARAM))); +#define P_VECTOR(___PARAM) __vec->push_back(new Data(RET_VECTOR, (void *) & (___PARAM))); +#define P_STR(___PARAM) __vec->push_back(new Data(RET_STRING, (void *) & (___PARAM))); +#define P_CBASE(__PARAM, __INDEX) __vec->push_back(new Data(RET_CBASE, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); +#define P_ENTVAR(__PARAM, __INDEX) __vec->push_back(new Data(RET_ENTVAR, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); +#define P_EDICT(__PARAM, __INDEX) __vec->push_back(new Data(RET_EDICT, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); +#define P_TRACE(__PARAM) __vec->push_back(new Data(RET_TRACE, (void *) (__PARAM))); +#define P_PTRVECTOR(__PARAM) __vec->push_back(new Data(RET_VECTOR, (void *) (__PARAM))); +#define P_PTRFLOAT(__PARAM) __vec->push_back(new Data(RET_FLOAT, (void *) (__PARAM))); +#define P_ITEMINFO(__PARAM) __vec->push_back(new Data(RET_ITEMINFO, (void *) & (__PARAM))); + +#define KILL_VECTOR() \ + CVector::iterator end=__vec->end(); \ + for (CVector::iterator i=__vec->begin(); i!=end; ++i) \ + { \ + delete (*i); \ + } \ + delete __vec; \ + ParamStack.pop(); + +#define PRE_START() \ + bool DoForwards=gDoForwards; \ + gDoForwards=true; \ + int result=HAM_UNSET; \ + ReturnStatus.push(&result); \ + int thisresult=HAM_UNSET; \ + if (DoForwards) \ + { \ + CVector::iterator end=hook->pre.end(); \ + for (CVector::iterator i=hook->pre.begin(); i!=end; i++) \ + { \ + if ((*i)->state == FSTATE_OK) \ + { \ + thisresult=MF_ExecuteForward((*i)->id,iThis + +#define PRE_END() \ + ); \ + } \ + if (thisresult > result) \ + { \ + result=thisresult; \ + } \ + } \ + } \ + if (result < HAM_SUPERCEDE) \ + { + +#define POST_START() \ + } \ + if (DoForwards) \ + { \ + CVector::iterator end=hook->post.end(); \ + for (CVector::iterator i=hook->post.begin(); i!=end; i++) \ + { \ + if ((*i)->state == FSTATE_OK) \ + { \ + MF_ExecuteForward((*i)->id,iThis + +#define POST_END() \ + ); \ + } \ + } \ + } \ + ReturnStatus.pop(); + + +#define CHECK_RETURN() \ + if (thisresult < HAM_OVERRIDE) \ + { \ + return origret; \ + } + +#define CHECK_RETURN_STR() \ + if (thisresult < HAM_OVERRIDE) \ + { \ + return origret.c_str(); \ + } +#define CHECK_RETURN_VEC() \ + if (thisresult < HAM_OVERRIDE) \ + { \ + memcpy(out, &origret, sizeof(Vector)); \ + return; \ + } + + + + +void Hook_Void_Void(Hook *hook, void *pthis) +{ + PUSH_VOID() + + MAKE_VECTOR() + + PRE_START() + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis,0); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() +} -#include -#include "amxxmodule.h" +int Hook_Int_Void(Hook *hook, void *pthis) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + PRE_START() + PRE_END() - -#include "CVector.h" -#include "CString.h" -#include "sh_stack.h" - -#include "hook.h" -#include "forward.h" - -#include "ham_const.h" -#include "ham_utils.h" - -#include "DataHandler.h" - - - -extern bool gDoForwards; - -// Return value pushes -#define PUSH_VOID() ReturnStack.push(new Data(RET_VOID, NULL)); OrigReturnStack.push(new Data(RET_VOID, NULL)); -#define PUSH_INT() ReturnStack.push(new Data(RET_INTEGER, (void *)&ret)); OrigReturnStack.push(new Data(RET_INTEGER, (void *)&origret)); -#define PUSH_FLOAT() ReturnStack.push(new Data(RET_FLOAT, (void *)&ret)); OrigReturnStack.push(new Data(RET_FLOAT, (void *)&origret)); -#define PUSH_VECTOR() ReturnStack.push(new Data(RET_VECTOR, (void *)&ret)); OrigReturnStack.push(new Data(RET_VECTOR, (void *)&origret)); -#define PUSH_CBASE() ReturnStack.push(new Data(RET_CBASE, (void *)&ret)); OrigReturnStack.push(new Data(RET_CBASE, (void *)&origret)); -#define PUSH_STRING() ReturnStack.push(new Data(RET_STRING, (void *)&ret)); OrigReturnStack.push(new Data(RET_STRING, (void *)&origret)); - -// Pop off return values -#define POP() delete ReturnStack.front(); ReturnStack.pop(); delete OrigReturnStack.front(); OrigReturnStack.pop(); - -// Parameter value pushes -#define MAKE_VECTOR() \ - int iThis=PrivateToIndex(pthis); \ - CVector *__vec=new CVector; \ - ParamStack.push(__vec); \ - P_CBASE(pthis, iThis) - -#define P_INT(___PARAM) __vec->push_back(new Data(RET_INTEGER, (void *) & (___PARAM))); -#define P_FLOAT(___PARAM) __vec->push_back(new Data(RET_FLOAT, (void *) & (___PARAM))); -#define P_VECTOR(___PARAM) __vec->push_back(new Data(RET_VECTOR, (void *) & (___PARAM))); -#define P_STR(___PARAM) __vec->push_back(new Data(RET_STRING, (void *) & (___PARAM))); -#define P_CBASE(__PARAM, __INDEX) __vec->push_back(new Data(RET_CBASE, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); -#define P_ENTVAR(__PARAM, __INDEX) __vec->push_back(new Data(RET_ENTVAR, (void *) & (__PARAM), reinterpret_cast(& (__INDEX)))); -#define P_TRACE(__PARAM) __vec->push_back(new Data(RET_TRACE, (void *) (__PARAM))); -#define P_PTRVECTOR(__PARAM) __vec->push_back(new Data(RET_VECTOR, (void *) (__PARAM))); -#define P_PTRFLOAT(__PARAM) __vec->push_back(new Data(RET_FLOAT, (void *) (__PARAM))); -#define P_ITEMINFO(__PARAM) __vec->push_back(new Data(RET_ITEMINFO, (void *) & (__PARAM))); - -#define KILL_VECTOR() \ - CVector::iterator end=__vec->end(); \ - for (CVector::iterator i=__vec->begin(); i!=end; ++i) \ - { \ - delete (*i); \ - } \ - delete __vec; \ - ParamStack.pop(); - -#define PRE_START() \ - bool DoForwards=gDoForwards; \ - gDoForwards=true; \ - int result=HAM_UNSET; \ - ReturnStatus.push(&result); \ - int thisresult=HAM_UNSET; \ - if (DoForwards) \ - { \ - CVector::iterator end=hook->pre.end(); \ - for (CVector::iterator i=hook->pre.begin(); i!=end; i++) \ - { \ - if ((*i)->state == FSTATE_OK) \ - { \ - thisresult=MF_ExecuteForward((*i)->id,iThis - -#define PRE_END() \ - ); \ - } \ - if (thisresult > result) \ - { \ - result=thisresult; \ - } \ - } \ - } \ - if (result < HAM_SUPERCEDE) \ - { - -#define POST_START() \ - } \ - if (DoForwards) \ - { \ - CVector::iterator end=hook->post.end(); \ - for (CVector::iterator i=hook->post.begin(); i!=end; i++) \ - { \ - if ((*i)->state == FSTATE_OK) \ - { \ - MF_ExecuteForward((*i)->id,iThis - -#define POST_END() \ - ); \ - } \ - } \ - } \ - ReturnStatus.pop(); - - -#define CHECK_RETURN() \ - if (thisresult < HAM_OVERRIDE) \ - { \ - return origret; \ - } - -#define CHECK_RETURN_STR() \ - if (thisresult < HAM_OVERRIDE) \ - { \ - return origret.c_str(); \ - } -#define CHECK_RETURN_VEC() \ - if (thisresult < HAM_OVERRIDE) \ - { \ - memcpy(out, &origret, sizeof(Vector)); \ - return; \ - } - - - - -void Hook_Void_Void(Hook *hook, void *pthis) -{ - PUSH_VOID() - - MAKE_VECTOR() - - PRE_START() - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis,0); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis); -#endif - - POST_START() - POST_END() - - KILL_VECTOR() - POP() -} -int Hook_Int_Void(Hook *hook, void *pthis) -{ - int ret=0; - int origret=0; - - PUSH_INT() - - MAKE_VECTOR() - - - PRE_START() - PRE_END() - - -#if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis,0); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis); -#endif - - POST_START() - POST_END() - - KILL_VECTOR() - POP() - - CHECK_RETURN() - return ret; +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis,0); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +void Hook_Void_Entvar(Hook *hook, void *pthis, entvars_t *entvar) +{ + PUSH_VOID() + + int iOther=EntvarToIndex(entvar); + + MAKE_VECTOR() + + P_ENTVAR(entvar, iOther) + + PRE_START() + , iOther + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, entvar); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, entvar); +#endif + + POST_START() + , iOther + POST_END() + + KILL_VECTOR() + POP() + +} + +void Hook_Void_Cbase(Hook *hook, void *pthis, void *other) +{ + PUSH_VOID() + int iOther=PrivateToIndex(other); + + MAKE_VECTOR() + + P_CBASE(other, iOther) + + PRE_START() + , iOther + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, other); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, other); +#endif + + POST_START() + , iOther + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_Float_Int(Hook *hook, void *pthis, float f1, int i1) +{ + int ret=0; + int origret=0; + PUSH_INT() + + MAKE_VECTOR() + + P_FLOAT(f1) + P_INT(i1) + + PRE_START() + , f1, i1 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, f1, i1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, f1, i1); +#endif + + POST_START() + , f1, i1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; } -void Hook_Void_Entvar(Hook *hook, void *pthis, entvars_t *entvar) -{ - PUSH_VOID() - - int iOther=EntvarToIndex(entvar); - - MAKE_VECTOR() - - P_ENTVAR(entvar, iOther) - - PRE_START() - , iOther - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, entvar); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, entvar); -#endif - - POST_START() - , iOther - POST_END() - - KILL_VECTOR() - POP() - -} - -void Hook_Void_Cbase(Hook *hook, void *pthis, void *other) -{ - PUSH_VOID() - int iOther=PrivateToIndex(other); - - MAKE_VECTOR() - - P_CBASE(other, iOther) - - PRE_START() - , iOther - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, other); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, other); -#endif - - POST_START() - , iOther - POST_END() - - KILL_VECTOR() - POP() -} - -int Hook_Int_Float_Int(Hook *hook, void *pthis, float f1, int i1) +int Hook_Int_Float_Int_Int(Hook *hook, void *pthis, float f1, int i1, int i2) { int ret=0; int origret=0; PUSH_INT() MAKE_VECTOR() - + P_FLOAT(f1) P_INT(i1) + P_INT(i2) PRE_START() - , f1, i1 + , f1, i1, i2 PRE_END() #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, f1, i1); + origret=reinterpret_cast(hook->func)(pthis, 0, f1, i1, i2); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, f1, i1); + origret=reinterpret_cast(hook->func)(pthis, f1, i1, i2); #endif POST_START() - , f1, i1 + , 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() + int iOther=EntvarToIndex(ev1); + + MAKE_VECTOR() + + P_ENTVAR(ev1, iOther) + P_INT(i1) + + PRE_START() + , iOther, i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, ev1, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, ev1, i1); +#endif + + POST_START() + , iOther, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Entvar_Entvar_Int(Hook *hook, void *pthis, entvars_t *ev1, entvars_t *ev2, int i1) +{ + PUSH_VOID() + int iInflictor=EntvarToIndex(ev1); + int iAttacker=EntvarToIndex(ev2); + + MAKE_VECTOR() + + P_ENTVAR(ev1, iInflictor) + P_ENTVAR(ev2, iAttacker) + P_INT(i1) + + PRE_START() + , iInflictor, iAttacker, i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, ev1, ev2, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, ev1, ev2, i1); +#endif + + POST_START() + , iInflictor, iAttacker, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + int iOther=PrivateToIndex(cb1); + + MAKE_VECTOR() + + P_CBASE(cb1, iOther) + + PRE_START() + , iOther + PRE_END() +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, cb1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, cb1); +#endif + + POST_START() + , iOther + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2) +{ + PUSH_VOID() + + MAKE_VECTOR() + + P_INT(i1) + P_INT(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; + int origret=0; + PUSH_INT() + + String a=sz1; + + MAKE_VECTOR() + + P_INT(i1) + P_STR(a) + P_INT(i2) + + PRE_START() + ,i1, a.c_str(), i2 + PRE_END() +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, i1, a.c_str(), i2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, i1, a.c_str(), i2); +#endif + + POST_START() + ,i1, a.c_str(), i2 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +int Hook_Int_Int_Str_Int_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i2, int i3) +{ + int ret = 0; + int origret = 0; + PUSH_INT() + + String a = sz1; + + MAKE_VECTOR() + + P_INT(i1) + P_STR(a) + P_INT(i2) + P_INT(i3) + + PRE_START() + , i1, a.c_str(), i2, i3 + PRE_END() +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, i1, a.c_str(), i2, i3); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, i1, a.c_str(), i2, i3); +#endif + + POST_START() + , i1, a.c_str(), i2, i3 POST_END() KILL_VECTOR() POP() CHECK_RETURN() return ret; - -} -void Hook_Void_Entvar_Int(Hook *hook, void *pthis, entvars_t *ev1, int i1) +} + +int Hook_Int_Int(Hook *hook, void *pthis, int i1) +{ + int ret=0; + int origret=0; + PUSH_INT() + + + MAKE_VECTOR() + + P_INT(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; + int origret=0; + + PUSH_INT() + int iOther=EntvarToIndex(ev1); + + MAKE_VECTOR() + P_ENTVAR(ev1, iOther) + + PRE_START() + ,iOther + 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() + , iOther + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis, entvars_t *inflictor, entvars_t *attacker, float damage, int damagebits) +{ + int ret=0; + int origret=0; + PUSH_INT() + int iInflictor=EntvarToIndex(inflictor); + int iAttacker=EntvarToIndex(attacker); + + MAKE_VECTOR() + P_ENTVAR(inflictor, iInflictor) + P_ENTVAR(attacker, iAttacker) + P_FLOAT(damage) + P_INT(damagebits) + + PRE_START() + ,iInflictor, iAttacker, damage, damagebits + PRE_END() + + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, inflictor, attacker, damage, damagebits); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, inflictor, attacker, damage, damagebits); +#endif + + POST_START() + ,iInflictor, iAttacker, damage, damagebits + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} +int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis, entvars_t *inflictor, entvars_t *attacker, float damage, float unknown, int damagebits) +{ + int ret=0; + int origret=0; + PUSH_INT() + int iInflictor=EntvarToIndex(inflictor); + int iAttacker=EntvarToIndex(attacker); + + MAKE_VECTOR() + P_ENTVAR(inflictor, iInflictor) + P_ENTVAR(attacker, iAttacker) + P_FLOAT(damage) + P_FLOAT(unknown) + P_INT(damagebits) + + PRE_START() + ,iInflictor, iAttacker, damage, unknown, damagebits + PRE_END() + + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, inflictor, attacker, damage, unknown, damagebits); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, inflictor, attacker, damage, unknown, damagebits); +#endif + + POST_START() + ,iInflictor, iAttacker, damage, unknown, damagebits + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +void Hook_Void_Int(Hook *hook, void *pthis, int i1) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_INT(i1) + + PRE_START() + , i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, i1); +#endif + + POST_START() + ,i1 + POST_END() + + KILL_VECTOR() + POP() +} + +float Hook_Float_Int(Hook *hook, void *pthis, int i1) { - PUSH_VOID() - int iOther=EntvarToIndex(ev1); + float ret=0.0; + float origret=0.0; + PUSH_FLOAT() MAKE_VECTOR() - - P_ENTVAR(ev1, iOther) P_INT(i1) PRE_START() - , iOther, i1 + , i1 PRE_END() - #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, ev1, i1); + origret=reinterpret_cast(hook->func)(pthis, 0, i1); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, ev1, i1); + origret=reinterpret_cast(hook->func)(pthis, i1); #endif POST_START() - , iOther, i1 + ,i1 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +#ifdef _WIN32 +void Hook_Vector_Float_Cbase_Int(Hook *hook, void *pthis, Vector *out, float f1, void *cb, int i1) +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Float_Cbase_Int(Hook *hook, Vector *out, void *pthis, float f1, void *cb, int i1) +#endif +{ + Vector ret; + Vector origret; + + PUSH_VECTOR() + + MAKE_VECTOR() + + memset(&ret, 0x0, sizeof(Vector)); + memset(&origret, 0x0, sizeof(Vector)); + + int iEnt = PrivateToIndex(cb); + + P_FLOAT(f1) + P_CBASE(cb, iEnt) + P_INT(i1) + + PRE_START() + ,f1, iEnt, i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, &origret, f1, cb, i1); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, f1, cb, i1); +#endif + + POST_START() + ,f1, iEnt, i1 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN_VEC() + memcpy(out, &ret, sizeof(Vector)); +} + +void Hook_Void_Cbase_Cbase_Int_Float(Hook *hook, void *pthis, void *cb1, void *cb2, int i1, float f1) +{ + PUSH_VOID() + int iCaller=PrivateToIndex(cb1); + int iActivator=PrivateToIndex(cb2); + + MAKE_VECTOR() + P_CBASE(cb1, iCaller) + P_CBASE(cb2, iActivator) + P_INT(i1) + P_FLOAT(f1) + + PRE_START() + ,iCaller, iActivator, i1, f1 + PRE_END() + + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, cb1, cb2, i1, f1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, cb1, cb2, i1, f1); +#endif + + POST_START() + ,iCaller, iActivator, i1, f1 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis, entvars_t *ev1, float f1, Vector v1, TraceResult *tr1, int i1) +{ + PUSH_VOID() + int iev1=EntvarToIndex(ev1); + + MAKE_VECTOR() + P_ENTVAR(ev1, iev1) + P_FLOAT(f1) + P_VECTOR(v1) + P_TRACE(tr1) + P_INT(i1) + + PRE_START() + ,iev1, f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, ev1, f1, v1, tr1, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, ev1, f1, v1, tr1, i1); +#endif + + POST_START() + , iev1, f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1, Vector v1, TraceResult *tr1, int i1) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_FLOAT(f1) + P_VECTOR(v1) + P_TRACE(tr1) + P_INT(i1) + + PRE_START() + , f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1, v1, tr1, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1, v1, tr1, i1); +#endif + + POST_START() + , f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +const char *Hook_Str_Void(Hook *hook, void *pthis) +{ + String ret; + String origret; + + MAKE_VECTOR() + + PUSH_STRING() + PRE_START() + PRE_END() + +#if defined(_WIN32) + origret.assign(reinterpret_cast(hook->func)(pthis, 0)); +#elif defined(__linux__) || defined(__APPLE__) + origret.assign(reinterpret_cast(hook->func)(pthis)); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN_STR(); + + return ret.c_str(); +} + +void *Hook_Cbase_Void(Hook *hook, void *pthis) +{ + void *ret=NULL; + void *origret=NULL; + PUSH_CBASE() + + MAKE_VECTOR() + + PRE_START() + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; + +} + +#ifdef _WIN32 +void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out) +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis) +#endif +{ + Vector ret; + Vector origret; + + PUSH_VECTOR() + + MAKE_VECTOR() + + memset(&ret, 0x0, sizeof(Vector)); + memset(&origret, 0x0, sizeof(Vector)); + + PRE_START() + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, &origret); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN_VEC() + memcpy(out, &ret, sizeof(Vector)); + +} + +#ifdef _WIN32 +void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1) +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1) +#endif +{ + Vector ret; + Vector origret; + + PUSH_VECTOR() + + MAKE_VECTOR() + P_PTRVECTOR(v1) + + memset(&ret, 0x0, sizeof(Vector)); + memset(&origret, 0x0, sizeof(Vector)); + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, &origret, 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_VEC() + memcpy(out, &ret, sizeof(Vector)); +} + +int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1) +{ + int ret=0; + int origret=0; + PUSH_INT() + + 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() + cell cev1=EntvarToIndex(ev1); + + MAKE_VECTOR() + P_ENTVAR(ev1, cev1) + P_FLOAT(f1) + P_FLOAT(f2) + + PRE_START() + , cev1, f1, f2 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, ev1, f1, f2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, ev1, f1, f2); +#endif + + POST_START() + , cev1, f1, f2 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_pFloat_pFloat(Hook *hook, void *pthis, float *f1, float *f2) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_PTRFLOAT(f1) + P_PTRFLOAT(f2) + + PRE_START() + , f1 != NULL ? *f1 : 0, f2 != NULL ? *f2 : 0 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1, f2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1, f2); +#endif + + POST_START() + , f1 != NULL ? *f1 : 0, f2 != NULL ? *f2 : 0 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1) +{ + PUSH_VOID() + cell cev1=EntvarToIndex(ev1); + + MAKE_VECTOR() + P_ENTVAR(ev1, cev1) + P_FLOAT(f1) + + PRE_START() + , cev1, f1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, ev1, f1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, ev1, f1); +#endif + + POST_START() + , cev1, f1 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3) +{ + PUSH_VOID() + + MAKE_VECTOR() + + P_INT(i1) + P_INT(i2) + P_INT(i3) + + PRE_START() + ,i1, i2, i3 + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, i1, i2, i3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, i1, i2, i3); +#endif + + POST_START() + ,i1, i2, i3 + POST_END() + + KILL_VECTOR() + POP() +} +void Hook_Void_ItemInfo(Hook *hook, void *pthis, void *iteminfo) +{ + PUSH_VOID() + + MAKE_VECTOR() + + P_ITEMINFO(iteminfo) + + PRE_START() + ,iteminfo + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, iteminfo); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, iteminfo); +#endif + + POST_START() + ,iteminfo + POST_END() + + KILL_VECTOR() + POP() +} + +float Hook_Float_Void(Hook *hook, void *pthis) +{ + float ret=0.0; + float origret=0.0; + PUSH_FLOAT() + + MAKE_VECTOR() + + PRE_START() + PRE_END() +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} +void Hook_Void_Float_Int(Hook* hook, void* pthis, float f1, int i1) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_FLOAT(f1) + P_INT(i1) + + PRE_START() + , f1, i1 + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1, i1); +#endif + + POST_START() + , f1, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +float Hook_Float_Float_Cbase(Hook* hook, void* pthis, float f1, void *cb1) +{ + float ret = 0.0; + float origret = 0.0; + + PUSH_FLOAT() + + MAKE_VECTOR() + + int i1 = PrivateToIndex(cb1); + + P_FLOAT(f1) + P_CBASE(cb1, i1) + + PRE_START() + , f1, i1 + PRE_END() +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, f1, cb1); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, f1, cb1); +#endif + + POST_START() + , f1, i1 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +void Hook_Void_Float(Hook* hook, void* pthis, float f1) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_FLOAT(f1) + + PRE_START() + , f1 + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1); +#endif + + POST_START() + , f1 POST_END() KILL_VECTOR() POP() } -int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1) +void Hook_Void_Float_Float_Float_Int(Hook* hook, void* pthis, float f1, float f2, float f3, int i1) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_FLOAT(f1) + P_FLOAT(f2) + P_FLOAT(f3) + P_INT(i1) + + PRE_START() + , f1, f2, f3, i1 + PRE_END() +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1, f2, f3, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1, f2, f3, i1); +#endif + + POST_START() + , f1, f2, f3, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +#ifdef _WIN32 +void Hook_Vector_Float(Hook *hook, void *pthis, Vector *out, float f1) +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Float(Hook *hook, Vector *out, void *pthis, float f1) +#endif +{ + Vector ret; + Vector origret; + + PUSH_VECTOR() + + MAKE_VECTOR() + P_FLOAT(f1) + + memset(&ret, 0x0, sizeof(Vector)); + memset(&origret, 0x0, sizeof(Vector)); + + PRE_START() + , f1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, &origret, f1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, f1); +#endif + + POST_START() + , f1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN_VEC() + memcpy(out, &ret, sizeof(Vector)); + +} + +void Hook_Void_Float_Cbase(Hook *hook, void *pthis, float f1, void *cb) +{ + PUSH_VOID() + int iEnt =PrivateToIndex(cb); + + MAKE_VECTOR() + P_FLOAT(f1) + P_CBASE(cb, iEnt) + + PRE_START() + ,f1, iEnt + PRE_END() + + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1, cb); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1, cb); +#endif + + POST_START() + ,f1, iEnt + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_Float_Float(Hook *hook, void *pthis, float f1, float f2) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_FLOAT(f1) + P_FLOAT(f2) + + PRE_START() + , f1, f2 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, f1, f2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, f1, f2); +#endif + + POST_START() + , f1, f2 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + +int Hook_Int_Float(Hook *hook, void *pthis, float f1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_FLOAT(f1) + + PRE_START() + , f1 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, f1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, f1); +#endif + + POST_START() + , f1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + +int Hook_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_INT(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) +{ + PUSH_VOID() + String a=sz1; + + MAKE_VECTOR() + + P_STR(a) + P_FLOAT(f1) + P_FLOAT(f2) + P_FLOAT(f3) + + PRE_START() + ,a.c_str(), f1, f2, f3 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.c_str(), f1, f2, f3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.c_str(), f1, f2, f3); +#endif + + POST_START() + ,a.c_str(), f1, f2, f3 + POST_END() + + KILL_VECTOR() + POP() +} + +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) +{ + PUSH_VOID() + + String a=sz1; + int iEnt=PrivateToIndex(cb); + + MAKE_VECTOR() + + P_STR(a) + P_FLOAT(f1) + P_FLOAT(f2) + P_FLOAT(f3) + P_INT(i1) + P_CBASE(cb, iEnt) + + PRE_START() + ,a.c_str(), f1, f2, f3, i1, iEnt + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.c_str(), f1, f2, f3, i1, cb); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.c_str(), f1, f2, f3, i1, cb); +#endif + + POST_START() + ,a.c_str(), 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; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_VECTOR(v1) + P_VECTOR(v2) + P_FLOAT(f1) + P_FLOAT(f2) + + PRE_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + ,MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false) + ,f1, f2 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, v2, f1, f2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2, f1, f2); +#endif + + POST_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + ,MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false) + ,f1, f2 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + +int Hook_Int_Short(Hook *hook, void *pthis, short s1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_SHORT(s1) + + PRE_START() + ,s1 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, s1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, s1); +#endif + + POST_START() + ,s1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + + return ret; +} + +void Hook_Void_Entvar_Entvar_Float_Int_Int(Hook *hook, void *pthis, entvars_t *inflictor, entvars_t *attacker, float damage, int classignore, int damagebits) +{ + PUSH_VOID() + + int iInflictor=EntvarToIndex(inflictor); + int iAttacker=EntvarToIndex(attacker); + + MAKE_VECTOR() + + P_ENTVAR(inflictor, iInflictor) + P_ENTVAR(attacker, iAttacker) + P_FLOAT(damage) + P_INT(classignore) + P_INT(damagebits) + + PRE_START() + ,iInflictor, iAttacker, damage, classignore, damagebits + PRE_END() + + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, inflictor, attacker, damage, classignore, damagebits); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, inflictor, attacker, damage, classignore, damagebits); +#endif + + POST_START() + ,iInflictor, iAttacker, damage, classignore, damagebits + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Vector_Entvar_Entvar_Float_Int_Int(Hook *hook, void *pthis, Vector source, entvars_t *inflictor, entvars_t *attacker, float damage, int classignore, int damagebits) +{ + PUSH_VOID() + + int iInflictor=EntvarToIndex(inflictor); + int iAttacker=EntvarToIndex(attacker); + + MAKE_VECTOR() + + P_VECTOR(source) + P_ENTVAR(inflictor, iInflictor) + P_ENTVAR(attacker, iAttacker) + P_FLOAT(damage) + P_INT(classignore) + P_INT(damagebits) + + printf("HOok - %.2f %.2f %.2f, %d, %d, %f, %d %d\n", source.x, source.y, source.z, iInflictor, iAttacker, damage, classignore, damagebits); + + PRE_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&source), 3, false) + ,iInflictor, iAttacker, damage, classignore, damagebits + PRE_END() + + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, source, inflictor, attacker, damage, classignore, damagebits); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, source, inflictor, attacker, damage, classignore, damagebits); +#endif + + POST_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&source), 3, false) + ,iInflictor, iAttacker, damage, classignore, damagebits + POST_END() + + KILL_VECTOR() + POP() +} + +float Hook_Float_Int_Float(Hook *hook, void *pthis, int i1, float f2) +{ + float ret=0.0; + float origret=0.0; + + PUSH_FLOAT() + + MAKE_VECTOR() + + P_INT(i1) + P_FLOAT(f2) + + PRE_START() + , i1, f2 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, i1, f2); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, i1, f2); +#endif + + POST_START() + ,i1, f2 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +int Hook_Int_Str(Hook *hook, void *pthis, const char *sz1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + String a=sz1; + + MAKE_VECTOR() + P_STR(a) + + PRE_START() + , a.c_str() + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, a.c_str()); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, a.c_str()); +#endif + + POST_START() + , a.c_str() + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +void Hook_Void_Edict(Hook *hook, void *pthis, edict_t *ed1) +{ + PUSH_VOID() + + int id1=EdictToIndex(ed1); + + MAKE_VECTOR() + P_EDICT(ed1, id1) + + PRE_START() + , id1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, ed1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, ed1); +#endif + + POST_START() + , id1 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Int_Str_Bool(Hook *hook, void *pthis, int i1, const char *sz2, bool b3) +{ + PUSH_VOID() + //String a=sz2; + + MAKE_VECTOR() + + P_INT(i1) + P_STR(sz2) + P_BOOL(b3) + + PRE_START() + , i1, sz2, b3 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, i1, sz2, b3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, i1, sz2, b3); +#endif + + POST_START() + , i1, sz2, b3 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2) +{ + PUSH_VOID() + + MAKE_VECTOR() + + P_VECTOR(v1) + P_VECTOR(v2) + + PRE_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + ,MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false) + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, v1, v2); +#elif defined(__linux__) || defined(__APPLE__) + 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() +} + +void Hook_Void_Str_Bool(Hook *hook, void *pthis, const char *sz1, bool b2) +{ + PUSH_VOID() + String a=sz1; + + MAKE_VECTOR() + + P_STR(a) + P_BOOL(b2) + + PRE_START() + , a.c_str(), b2 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.c_str(), b2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.c_str(), b2); +#endif + + POST_START() + , a.c_str(), b2 + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_Str_Str_Int_Str_Int_Int(Hook *hook, void *pthis, const char *sz1, const char *sz2, int i1, const char *sz3, int i2, int i3) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_STR(sz1) + P_STR(sz2) + P_INT(i1) + P_STR(sz3) + P_INT(i2) + P_INT(i3) + + PRE_START() + , sz1, sz2, i1, sz3, i2, i3 + PRE_END() + +#if defined(_WIN32) + origret = reinterpret_cast(hook->func)(pthis, 0, sz1, sz2, i1, sz3, i2, i3); +#elif defined(__linux__) || defined(__APPLE__) + origret = reinterpret_cast(hook->func)(pthis, sz1, sz2, i1, sz3, i2, i3); +#endif + + POST_START() + , sz1, sz2, i1, sz3, i2, i3 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +int Hook_Int_Int_Int_Float_Int(Hook *hook, void *pthis, int i1, int i2, float f1, int i3) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_INT(i1) + P_INT(i2) + P_FLOAT(f1) + P_INT(i3) + + PRE_START() + , i1, i2, f1, i3 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, i1, i2, f1, i3); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, i1, i2, f1, i3); +#endif + + POST_START() + , i1, i2, f1, i3 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +void Hook_Void_Str_Int(Hook *hook, void *pthis, const char *sz1, int i2) +{ + PUSH_VOID() + String a=sz1; + + MAKE_VECTOR() + + P_STR(a) + P_INT(i2) + + PRE_START() + , a.c_str(), i2 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.c_str(), i2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.c_str(), i2); +#endif + + POST_START() + , a.c_str(), i2 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1) +{ + PUSH_VOID() + int iEnt =PrivateToIndex(p1); + + MAKE_VECTOR() + + P_CBASE(p1, iEnt) + P_INT(i1) + + PRE_START() + , iEnt, i1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, p1, i1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, p1, i1); +#endif + + POST_START() + , iEnt, i1 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Str(Hook *hook, void *pthis, const char *sz1) +{ + PUSH_VOID() + String a=sz1; + + MAKE_VECTOR() + + P_STR(a) + + PRE_START() + , a.c_str() + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.c_str()); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.c_str()); +#endif + + POST_START() + , a.c_str() + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Vector(Hook *hook, void *pthis, Vector v1) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_VECTOR(v1) + + PRE_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, v1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, v1); +#endif + + POST_START() + ,MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_Str_Vector_Str(Hook *hook, void *pthis, const char *sz1, Vector v2, const char *sz2) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + String a=sz1; + String b=sz2; + + MAKE_VECTOR() + + P_STR(a) + P_VECTOR(v2) + P_STR(b) + + PRE_START() + , a.c_str(), MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false), b.c_str() + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, a.c_str(), v2, b.c_str()); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, a.c_str(), v2, b.c_str()); +#endif + + POST_START() + , a.c_str(), MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false), b.c_str() + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +int Hook_Int_Str_Str(Hook *hook, void *pthis, const char *sz1, const char *sz2) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + String a=sz1; + String b=sz2; + + MAKE_VECTOR() + + P_STR(a) + P_STR(b) + + PRE_START() + , a.c_str(), b.c_str() + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, a.c_str(), b.c_str()); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, a.c_str(), b.c_str()); +#endif + + POST_START() + , a.c_str(), b.c_str() + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +void Hook_Void_Float_Float(Hook *hook, void *pthis, float f1, float f2) +{ + PUSH_VOID() + + MAKE_VECTOR() + P_FLOAT(f1) + P_FLOAT(f2) + + PRE_START() + ,f1, f2 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, f1, f2); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, f1, f2); +#endif + + POST_START() + ,f1, f2 + POST_END() + + KILL_VECTOR() + POP() +} + +void Hook_Void_Str_Str_Int(Hook *hook, void *pthis, const char *sz1, const char *sz2, int i3) +{ + PUSH_VOID() + + String a=sz1; + String b=sz2; + + MAKE_VECTOR() + + P_STR(a) + P_STR(b) + P_INT(i3) + + PRE_START() + , a.c_str(), b.c_str(), i3 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, a.c_str(), b.c_str(), i3); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, a.c_str(), b.c_str(), i3); +#endif + + POST_START() + , a.c_str(), b.c_str(), i3 + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_pVector_pVector_Cbase_pFloat(Hook *hook, void *pthis, Vector *v1, Vector *v2, void* cb, float* fl) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + int i3=PrivateToIndex(cb); + + MAKE_VECTOR() + P_PTRVECTOR(v1) + P_PTRVECTOR(v2) + P_CBASE(cb, i3) + P_PTRFLOAT(fl) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + , i3 + , fl != NULL ? *fl : 0 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, v2, cb, fl); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2, cb, fl); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + , i3 + , fl != NULL ? *fl : 0 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +void Hook_Void_Cbase_pVector_Float(Hook *hook, void *pthis, void *p1, Vector *v1, float fl) +{ + PUSH_VOID() + int iEnt =PrivateToIndex(p1); + + MAKE_VECTOR() + + P_CBASE(p1, iEnt) + P_PTRVECTOR(v1) + P_FLOAT(fl) + + PRE_START() + , iEnt, MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false), fl + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, p1, v1, fl); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, p1, v1, fl); +#endif + + POST_START() + , iEnt, MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false), fl + POST_END() + + KILL_VECTOR() + POP() +} + +int Hook_Int_pVector_pVector_Float_Cbase_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2, float fl, void* cb, Vector *v3) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + int i4=PrivateToIndex(cb); + + MAKE_VECTOR() + P_PTRVECTOR(v1) + P_PTRVECTOR(v2) + P_FLOAT(fl) + P_CBASE(cb, i4) + P_PTRVECTOR(v3) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + , fl + , i4 + , MF_PrepareCellArrayA(reinterpret_cast(v3), 3, false) + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, v2, fl, cb, v3); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2, fl, cb, v3); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + , fl + , i4 + , MF_PrepareCellArrayA(reinterpret_cast(v3), 3, false) + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +int Hook_Int_Cbase_Bool(Hook *hook, void *pthis, void *cb1, bool b1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + int i1=PrivateToIndex(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; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_VECTOR(v1) + P_VECTOR(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; + int origret=0; + + PUSH_INT() + int i1=EntvarToIndex(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; + float origret=0.0; + + PUSH_FLOAT() + + MAKE_VECTOR() + P_FLOAT(f1) + + PRE_START() + , f1 + PRE_END() +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, f1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, f1); +#endif + + POST_START() + ,f1 + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +void Hook_Void_Entvar_Entvar_Float(Hook *hook, void *pthis, entvars_t *attacker, entvars_t *inflictor, float damage) +{ + PUSH_VOID() + + int iAttacker=EntvarToIndex(attacker); + int iInflictor=EntvarToIndex(inflictor); + + MAKE_VECTOR() + + P_ENTVAR(attacker, iAttacker) + P_ENTVAR(inflictor, iInflictor) + P_FLOAT(damage) + + PRE_START() + , iAttacker, iInflictor, damage + PRE_END() + + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, attacker, inflictor, damage); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, attacker, inflictor, damage); +#endif + + POST_START() + , iAttacker, iInflictor, damage + POST_END() + + KILL_VECTOR() + POP() +} + +bool Hook_Bool_Void(Hook *hook, void *pthis) +{ + bool ret=0; + bool origret=0; + + PUSH_BOOL() + + MAKE_VECTOR() + + PRE_START() + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis,0); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis); +#endif + + POST_START() + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +int Hook_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(Hook *hook, void *pthis, Vector *v1, Vector *v2, float fl, void* cb, Vector *v3, Vector *v4, bool b1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + int i4=PrivateToIndex(cb); + + MAKE_VECTOR() + + P_PTRVECTOR(v1) + P_PTRVECTOR(v2) + P_FLOAT(fl) + P_CBASE(cb, i4) + P_PTRVECTOR(v3) + P_PTRVECTOR(v4) + P_BOOL(b1) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + , fl + , i4 + , MF_PrepareCellArrayA(reinterpret_cast(v3), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v4), 3, false) + , b1 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, v2, fl, cb, v3, v4, b1); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2, fl, cb, v3, v4, b1); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v2), 3, false) + , fl + , i4 + , MF_PrepareCellArrayA(reinterpret_cast(v3), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(v4), 3, false) + , b1 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +int Hook_Int_Vector_Cbase(Hook *hook, void *pthis, Vector v1, void* cb) +{ + int ret=0; + int origret=0; + PUSH_INT() + + int i4=PrivateToIndex(cb); + + MAKE_VECTOR() + + P_VECTOR(v1) + P_CBASE(cb, i4) + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + , i4 + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, v1, cb); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, cb); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + , i4 + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN() + return ret; +} + +int Hook_Int_Vector(Hook *hook, void *pthis, Vector v1) +{ + int ret=0; + int origret=0; + + PUSH_INT() + + MAKE_VECTOR() + + P_VECTOR(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; +} + +int Hook_Int_Cbase_pVector(Hook *hook, void *pthis, void *cb1, Vector *v1) { int ret=0; int origret=0; @@ -333,20 +2542,23 @@ int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1) int iOther=PrivateToIndex(cb1); MAKE_VECTOR() - + P_CBASE(cb1, iOther) + P_PTRVECTOR(v1) PRE_START() , iOther + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) PRE_END() #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, cb1); + origret=reinterpret_cast(hook->func)(pthis, 0, cb1, v1); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, cb1); + origret=reinterpret_cast(hook->func)(pthis, cb1, v1); #endif POST_START() , iOther + , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) POST_END() KILL_VECTOR() @@ -355,214 +2567,248 @@ int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1) return ret; } -void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2) +void Hook_Void_Bool(Hook *hook, void *pthis, bool b1) { PUSH_VOID() MAKE_VECTOR() - - P_INT(i1) - P_INT(i2) + P_BOOL(b1) PRE_START() - ,i1, i2 + , b1 PRE_END() + #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, i1, i2); + reinterpret_cast(hook->func)(pthis, 0, b1); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, i1, i2); + reinterpret_cast(hook->func)(pthis, b1); #endif POST_START() - ,i1, i2 + ,b1 POST_END() KILL_VECTOR() POP() } -int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i2) +bool Hook_Bool_Cbase(Hook *hook, void *pthis, void *cb) { - int ret=0; - int origret=0; - PUSH_INT() + bool ret=0; + bool origret=0; - String a=sz1; + PUSH_BOOL() + + int iOther=PrivateToIndex(cb); MAKE_VECTOR() - + + P_CBASE(cb, iOther) + + PRE_START() + , iOther + PRE_END() + +#if defined(_WIN32) + origret=reinterpret_cast(hook->func)(pthis, 0, cb); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, cb); +#endif + + POST_START() + , iOther + POST_END() + + KILL_VECTOR() + POP() + + CHECK_RETURN() + return ret; +} + +bool Hook_Bool_Int(Hook *hook, void *pthis, int i1) +{ + bool ret=0; + bool origret=0; + + PUSH_BOOL() + + MAKE_VECTOR() + P_INT(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; +} + + +void Hook_Void_Cbase_Float(Hook *hook, void *pthis, void *p1, float f1) +{ + PUSH_VOID() + int iEnt =PrivateToIndex(p1); + + MAKE_VECTOR() + + P_CBASE(p1, iEnt) + P_FLOAT(f1) + + PRE_START() + , iEnt, f1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, p1, f1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, p1, f1); +#endif + + POST_START() + , iEnt, f1 + POST_END() + + KILL_VECTOR() + POP() +} + + +void Hook_Void_Cbase_Bool(Hook *hook, void *pthis, void *p1, bool b1) +{ + PUSH_VOID() + int iEnt =PrivateToIndex(p1); + + MAKE_VECTOR() + + P_CBASE(p1, iEnt) + P_BOOL(b1) + + PRE_START() + , iEnt, b1 + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, p1, b1); +#elif defined(__linux__) || defined(__APPLE__) + reinterpret_cast(hook->func)(pthis, p1, b1); +#endif + + POST_START() + , iEnt, b1 + POST_END() + + KILL_VECTOR() + POP() +} + +#ifdef _WIN32 +void Hook_Vector_Vector_Vector_Vector(Hook *hook, void *pthis, Vector *out, Vector v1, Vector v2, Vector v3) +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Vector_Vector_Vector(Hook *hook, Vector *out, void *pthis, Vector v1, Vector v2, Vector v3) +#endif +{ + Vector ret; + Vector origret; + + PUSH_VECTOR() + + MAKE_VECTOR() + + P_VECTOR(v1) + P_VECTOR(v2) + P_VECTOR(v3) + + memset(&ret, 0x0, sizeof(Vector)); + memset(&origret, 0x0, sizeof(Vector)); + + PRE_START() + , MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(&v3), 3, false) + PRE_END() + +#if defined(_WIN32) + reinterpret_cast(hook->func)(pthis, 0, &origret, v1, v2, v3); +#elif defined(__linux__) || defined(__APPLE__) + origret=reinterpret_cast(hook->func)(pthis, v1, v2, v3); +#endif + + POST_START() + , MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(&v2), 3, false) + , MF_PrepareCellArrayA(reinterpret_cast(&v3), 3, false) + POST_END() + + KILL_VECTOR() + POP() + CHECK_RETURN_VEC() + + memcpy(out, &ret, sizeof(Vector)); +} + +const char *Hook_Str_Str(Hook *hook, void *pthis, const char* str) +{ + String ret; + String origret; + String a = str; + + MAKE_VECTOR() + + PUSH_STRING() + P_STR(a) - P_INT(i2) PRE_START() - ,i1, a.c_str(), i2 + , a.c_str() PRE_END() + #if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, i1, a.c_str(), i2); + origret.assign(reinterpret_cast(hook->func)(pthis, 0, a.c_str() )); #elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, i1, a.c_str(), i2); + origret.assign(reinterpret_cast(hook->func)(pthis, a.c_str())); #endif POST_START() - ,i1, a.c_str(), i2 + , a.c_str() POST_END() KILL_VECTOR() POP() - CHECK_RETURN() - return ret; + CHECK_RETURN_STR(); + + return ret.c_str(); } -int Hook_Int_Int(Hook *hook, void *pthis, int i1) -{ - int ret=0; - int origret=0; - PUSH_INT() - - - MAKE_VECTOR() - - P_INT(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; - int origret=0; - - PUSH_INT() - int iOther=EntvarToIndex(ev1); - - MAKE_VECTOR() - P_ENTVAR(ev1, iOther) - - PRE_START() - ,iOther - 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() - , iOther - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN() - return ret; -} - - - -int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis, entvars_t *inflictor, entvars_t *attacker, float damage, int damagebits) -{ - int ret=0; - int origret=0; - PUSH_INT() - int iInflictor=EntvarToIndex(inflictor); - int iAttacker=EntvarToIndex(attacker); - - MAKE_VECTOR() - P_ENTVAR(inflictor, iInflictor) - P_ENTVAR(attacker, iAttacker) - P_FLOAT(damage) - P_INT(damagebits) - - PRE_START() - ,iInflictor, iAttacker, damage, damagebits - PRE_END() - - -#if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, inflictor, attacker, damage, damagebits); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, inflictor, attacker, damage, damagebits); -#endif - - POST_START() - ,iInflictor, iAttacker, damage, damagebits - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN() - return ret; -} -int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis, entvars_t *inflictor, entvars_t *attacker, float damage, float unknown, int damagebits) -{ - int ret=0; - int origret=0; - PUSH_INT() - int iInflictor=EntvarToIndex(inflictor); - int iAttacker=EntvarToIndex(attacker); - - MAKE_VECTOR() - P_ENTVAR(inflictor, iInflictor) - P_ENTVAR(attacker, iAttacker) - P_FLOAT(damage) - P_FLOAT(unknown) - P_INT(damagebits) - - PRE_START() - ,iInflictor, iAttacker, damage, unknown, damagebits - PRE_END() - - -#if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, inflictor, attacker, damage, unknown, damagebits); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, inflictor, attacker, damage, unknown, damagebits); -#endif - - POST_START() - ,iInflictor, iAttacker, damage, unknown, damagebits - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN() - return ret; -} - -void Hook_Void_Int(Hook *hook, void *pthis, int i1) +void Hook_Void_Short(Hook *hook, void *pthis, short i1) { PUSH_VOID() MAKE_VECTOR() - P_INT(i1) + P_SHORT(i1) PRE_START() , i1 PRE_END() #if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, i1); + reinterpret_cast(hook->func)(pthis, 0, i1); #elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, i1); + reinterpret_cast(hook->func)(pthis, i1); #endif POST_START() @@ -573,436 +2819,8 @@ void Hook_Void_Int(Hook *hook, void *pthis, int i1) POP() } -void Hook_Void_Cbase_Cbase_Int_Float(Hook *hook, void *pthis, void *cb1, void *cb2, int i1, float f1) -{ - PUSH_VOID() - int iCaller=PrivateToIndex(cb1); - int iActivator=PrivateToIndex(cb2); - - MAKE_VECTOR() - P_CBASE(cb1, iCaller) - P_CBASE(cb2, iActivator) - P_INT(i1) - P_FLOAT(f1) - PRE_START() - ,iCaller, iActivator, i1, f1 - PRE_END() - - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, cb1, cb2, i1, f1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, cb1, cb2, i1, f1); -#endif - - POST_START() - ,iCaller, iActivator, i1, f1 - POST_END() - - KILL_VECTOR() - POP() -} - -void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis, entvars_t *ev1, float f1, Vector v1, TraceResult *tr1, int i1) -{ - PUSH_VOID() - int iev1=EntvarToIndex(ev1); - - MAKE_VECTOR() - P_ENTVAR(ev1, iev1) - P_FLOAT(f1) - P_VECTOR(v1) - P_TRACE(tr1) - P_INT(i1) - - PRE_START() - ,iev1, f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, ev1, f1, v1, tr1, i1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, ev1, f1, v1, tr1, i1); -#endif - - POST_START() - , iev1, f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 - POST_END() - - KILL_VECTOR() - POP() -} - -void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1, Vector v1, TraceResult *tr1, int i1) -{ - PUSH_VOID() - - MAKE_VECTOR() - P_FLOAT(f1) - P_VECTOR(v1) - P_TRACE(tr1) - P_INT(i1) - - PRE_START() - , f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, f1, v1, tr1, i1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, f1, v1, tr1, i1); -#endif - - POST_START() - , f1, MF_PrepareCellArrayA(reinterpret_cast(&v1), 3, false), tr1, i1 - POST_END() - - KILL_VECTOR() - POP() -} -const char *Hook_Str_Void(Hook *hook, void *pthis) -{ - String ret; - String origret; - - MAKE_VECTOR() - - PUSH_STRING() - PRE_START() - PRE_END() - -#if defined(_WIN32) - origret.assign(reinterpret_cast(hook->func)(pthis, 0)); -#elif defined(__linux__) || defined(__APPLE__) - origret.assign(reinterpret_cast(hook->func)(pthis)); -#endif - - POST_START() - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN_STR(); - return ret.c_str(); - -} - -void *Hook_Cbase_Void(Hook *hook, void *pthis) -{ - void *ret=NULL; - void *origret=NULL; - PUSH_CBASE() - - MAKE_VECTOR() - - PRE_START() - PRE_END() - -#if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis); -#endif - - POST_START() - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN() - return ret; - -} - -#ifdef _WIN32 -void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out) -#elif defined(__linux__) || defined(__APPLE__) -void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis) -#endif -{ - Vector ret; - Vector origret; - - PUSH_VECTOR() - - MAKE_VECTOR() - - memset(&ret, 0x0, sizeof(Vector)); - memset(&origret, 0x0, sizeof(Vector)); - - PRE_START() - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, &origret); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis); -#endif - - POST_START() - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN_VEC() - memcpy(out, &ret, sizeof(Vector)); - -} -#ifdef _WIN32 -void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1) -#elif defined(__linux__) || defined(__APPLE__) -void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1) -#endif -{ - Vector ret; - Vector origret; - - PUSH_VECTOR() - - MAKE_VECTOR() - P_PTRVECTOR(v1) - - memset(&ret, 0x0, sizeof(Vector)); - memset(&origret, 0x0, sizeof(Vector)); - - PRE_START() - , MF_PrepareCellArrayA(reinterpret_cast(v1), 3, false) - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, &origret, 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_VEC() - memcpy(out, &ret, sizeof(Vector)); - -} - -int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1) -{ - int ret=0; - int origret=0; - PUSH_INT() - - 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() - cell cev1=EntvarToIndex(ev1); - - MAKE_VECTOR() - P_ENTVAR(ev1, cev1) - P_FLOAT(f1) - P_FLOAT(f2) - - PRE_START() - , cev1, f1, f2 - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, ev1, f1, f2); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, ev1, f1, f2); -#endif - - POST_START() - , cev1, f1, f2 - POST_END() - - KILL_VECTOR() - POP() -} - -int Hook_Int_pFloat_pFloat(Hook *hook, void *pthis, float *f1, float *f2) -{ - int ret=0; - int origret=0; - PUSH_INT() - - - MAKE_VECTOR() - P_PTRFLOAT(f1) - P_PTRFLOAT(f2) - - PRE_START() - , f1 != NULL ? *f1 : 0, f2 != NULL ? *f2 : 0 - PRE_END() - -#if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0, f1, f2); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis, f1, f2); -#endif - - POST_START() - , f1 != NULL ? *f1 : 0, f2 != NULL ? *f2 : 0 - POST_END() - - KILL_VECTOR() - POP() - CHECK_RETURN() - return ret; -} - -void Hook_Void_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1) -{ - PUSH_VOID() - cell cev1=EntvarToIndex(ev1); - - MAKE_VECTOR() - P_ENTVAR(ev1, cev1) - P_FLOAT(f1) - - PRE_START() - , cev1, f1 - PRE_END() - -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, ev1, f1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, ev1, f1); -#endif - - POST_START() - , cev1, f1 - POST_END() - - KILL_VECTOR() - POP() -} - -void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3) -{ - PUSH_VOID() - - MAKE_VECTOR() - - P_INT(i1) - P_INT(i2) - P_INT(i3) - - PRE_START() - ,i1, i2, i3 - PRE_END() -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, i1, i2, i3); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, i1, i2, i3); -#endif - - POST_START() - ,i1, i2, i3 - POST_END() - - KILL_VECTOR() - POP() -} -void Hook_Void_ItemInfo(Hook *hook, void *pthis, void *iteminfo) -{ - PUSH_VOID() - - MAKE_VECTOR() - - P_ITEMINFO(iteminfo) - - PRE_START() - ,iteminfo - PRE_END() -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, iteminfo); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, iteminfo); -#endif - - POST_START() - ,iteminfo - POST_END() - - KILL_VECTOR() - POP() -} - -float Hook_Float_Void(Hook *hook, void *pthis) -{ - float ret=0.0; - float origret=0.0; - PUSH_FLOAT() - - MAKE_VECTOR() - - PRE_START() - PRE_END() -#if defined(_WIN32) - origret=reinterpret_cast(hook->func)(pthis, 0); -#elif defined(__linux__) || defined(__APPLE__) - origret=reinterpret_cast(hook->func)(pthis); -#endif - - POST_START() - POST_END() - - KILL_VECTOR() - POP() - - CHECK_RETURN() - return ret; -} -void Hook_Void_Float_Int(Hook* hook, void* pthis, float f1, int i1) -{ - PUSH_VOID() - - MAKE_VECTOR() - P_FLOAT(f1) - P_INT(i1) - - PRE_START() - , f1, i1 - PRE_END() -#if defined(_WIN32) - reinterpret_cast(hook->func)(pthis, 0, f1, i1); -#elif defined(__linux__) || defined(__APPLE__) - reinterpret_cast(hook->func)(pthis, f1, i1); -#endif - - POST_START() - , f1, i1 - POST_END() - - KILL_VECTOR() - POP() -} void Hook_Deprecated(Hook* hook) { -} + +} diff --git a/dlls/hamsandwich/hook_callbacks.h b/dlls/hamsandwich/hook_callbacks.h index 452edfaa..a3275b48 100644 --- a/dlls/hamsandwich/hook_callbacks.h +++ b/dlls/hamsandwich/hook_callbacks.h @@ -1,187 +1,513 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ +#ifndef HOOK_CALLBACKS_H +#define HOOK_CALLBACKS_H + +// RT_ is true if the function returns void, false otherwise +// (it also would be true for large return functions such as Vector) +// RB_ is true if the function returns an object and requires a pointer to a buffer as its first parameter in order to store its value +// PC_ is how many dwords get passed to the function (minus the "this" pointer) +// (it is one larger for large return functions such as Vector) + +const bool RT_Void_Void = true; +const bool RB_Void_Void = false; +const int PC_Void_Void = 0; +void Hook_Void_Void(Hook *hook, void *pthis); + +const bool RT_Int_Void = false; +const bool RB_Int_Void = false; +const int PC_Int_Void = 0; +int Hook_Int_Void(Hook *hook, void *pthis); + +const bool RT_Void_Entvar = true; +const bool RB_Void_Entvar = false; +const int PC_Void_Entvar = 1; +void Hook_Void_Entvar(Hook *hook, void *pthis, entvars_t *entvar); + +const bool RT_Void_Cbase = true; +const bool RB_Void_Cbase = false; +const int PC_Void_Cbase = 1; +void Hook_Void_Cbase(Hook *hook, void *pthis, void *other); + +const bool RT_Int_Float_Int = false; +const bool RB_Int_Float_Int = false; +const int PC_Int_Float_Int = 2; +int Hook_Int_Float_Int(Hook *hook, void *pthis, float f1, int i1); + +const bool RT_Int_Float_Int_Int = false; +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); -#ifndef HOOK_CALLBACKS_H -#define HOOK_CALLBACKS_H +const bool RT_Void_Entvar_Int = true; +const bool RB_Void_Entvar_Int = false; +const int PC_Void_Entvar_Int = 2; +void Hook_Void_Entvar_Int(Hook *hook, void *ptis, entvars_t *ev1, int i1); + +const bool RT_Void_Entvar_Entvar_Int = true; +const bool RB_Void_Entvar_Entvar_Int = false; +const int PC_Void_Entvar_Entvar_Int = 3; +void Hook_Void_Entvar_Entvar_Int(Hook *hook, void *ptis, entvars_t *ev1, entvars_t *ev2, int i1); -// RT_ is true if the function returns void, false otherwise -// (it also would be true for large return functions such as Vector) -// PC_ is how many dwords get passed to the function (minus the "this" pointer) -// (it is one larger for large return functions such as Vector) - -const bool RT_Void_Void = true; -const int PC_Void_Void = 0; -void Hook_Void_Void(Hook *hook, void *pthis); - -const bool RT_Int_Void = false; -const int PC_Int_Void = 0; -int Hook_Int_Void(Hook *hook, void *pthis); - -const bool RT_Void_Entvar = true; -const int PC_Void_Entvar = 1; -void Hook_Void_Entvar(Hook *hook, void *pthis, entvars_t *entvar); - -const bool RT_Void_Cbase = true; -const int PC_Void_Cbase = 1; -void Hook_Void_Cbase(Hook *hook, void *pthis, void *other); - -const bool RT_Int_Float_Int = false; -const int PC_Int_Float_Int = 2; -int Hook_Int_Float_Int(Hook *hook, void *pthis, float f1, int i1); - -const bool RT_Void_Entvar_Int = true; -const int PC_Void_Entvar_Int = 2; -void Hook_Void_Entvar_Int(Hook *hook, void *ptis, entvars_t *ev1, int i1); - -const bool RT_Int_Cbase = false; -const int PC_Int_Cbase = 1; -int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1); - -const bool RT_Void_Int_Int = true; -const int PC_Void_Int_Int = 2; -void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2); - -const bool RT_Int_Int_Str_Int = false; -const int PC_Int_Int_Str_Int = 3; -int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, - int i2); - -const bool RT_Int_Int = false; -const int PC_Int_Int = 1; -int Hook_Int_Int(Hook *hook, void *pthis, int i1); - -const bool RT_Int_Entvar = false; -const int PC_Int_Entvar = 1; -int Hook_Int_Entvar(Hook *hook, void *pthis, entvars_t *ev1); - -const bool RT_Int_Entvar_Entvar_Float_Int = false; -const int PC_Int_Entvar_Entvar_Float_Int = 4; -int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis, - entvars_t *inflictor, - entvars_t *attacker, float damage, - int damagebits); - -const bool RT_Int_Entvar_Entvar_Float_Float_Int = false; -const int PC_Int_Entvar_Entvar_Float_Float_Int = 5; -int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis, - entvars_t *inflictor, - entvars_t *attacker, float damage, - float unknown, int damagebits); - -const bool RT_Void_Int = true; -const int PC_Void_Int = 1; -void Hook_Void_Int(Hook *hook, void *pthis, int i1); - -const bool RT_Void_Cbase_Cbase_Int_Float = true; -const int PC_Void_Cbase_Cbase_Int_Float = 4; -void Hook_Void_Cbase_Cbase_Int_Float(Hook *hook, void *pthis, void *cb1, - void *cb2, int i1, float f1); - -const bool RT_Void_Entvar_Float_Vector_Trace_Int = true; -const int PC_Void_Entvar_Float_Vector_Trace_Int = 7; -void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis, - entvars_t *ev1, float f1, - Vector v1, TraceResult *tr1, - int i1); - -const bool RT_Void_Float_Vector_Trace_Int = true; -const int PC_Void_Float_Vector_Trace_Int = 6; -void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1, - Vector v1, TraceResult *tr1, - int i1); - -const bool RT_Str_Void = false; -const int PC_Str_Void = 0; -const char *Hook_Str_Void(Hook *hook, void *pthis); - -const bool RT_Cbase_Void = false; -const int PC_Cbase_Void = 0; -void *Hook_Cbase_Void(Hook *hook, void *pthis); - -// HACK: I'm too lazy to fix up trampoline generator to deal with -// special return values. this is so much easier. -const bool RT_Vector_Void = true; -const int PC_Vector_Void = 1; -#ifdef _WIN32 -void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out); -#elif defined(__linux__) || defined(__APPLE__) -void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis); +const bool RT_Int_Cbase = false; +const bool RB_Int_Cbase = false; +const int PC_Int_Cbase = 1; +int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1); + +const bool RT_Void_Int_Int = true; +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_Int_Int_Str_Int = false; +const bool RB_Int_Int_Str_Int = false; +const int PC_Int_Int_Str_Int = 3; +int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, + int i2); + +const bool RT_Int_Int_Str_Int_Int = false; +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 = 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_Int_Entvar = false; +const bool RB_Int_Entvar = false; +const int PC_Int_Entvar = 1; +int Hook_Int_Entvar(Hook *hook, void *pthis, entvars_t *ev1); + +const bool RT_Int_Entvar_Entvar_Float_Int = false; +const bool RB_Int_Entvar_Entvar_Float_Int = false; +const int PC_Int_Entvar_Entvar_Float_Int = 4; +int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis, + entvars_t *inflictor, + entvars_t *attacker, float damage, + int damagebits); + +const bool RT_Int_Entvar_Entvar_Float_Float_Int = false; +const bool RB_Int_Entvar_Entvar_Float_Float_Int = false; +const int PC_Int_Entvar_Entvar_Float_Float_Int = 5; +int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis, + entvars_t *inflictor, + entvars_t *attacker, float damage, + float unknown, int damagebits); + +const bool RT_Void_Int = true; +const bool RB_Void_Int = false; +const int PC_Void_Int = 1; +void Hook_Void_Int(Hook *hook, void *pthis, int i1); + +const bool RT_Void_Cbase_Cbase_Int_Float = true; +const bool RB_Void_Cbase_Cbase_Int_Float = false; +const int PC_Void_Cbase_Cbase_Int_Float = 4; +void Hook_Void_Cbase_Cbase_Int_Float(Hook *hook, void *pthis, void *cb1, + void *cb2, int i1, float f1); + +const bool RT_Vector_Float_Cbase_Int = true; +const bool RB_Vector_Float_Cbase_Int = true; +const int PC_Vector_Float_Cbase_Int = 4; +#if defined(_WIN32) +void Hook_Vector_Float_Cbase_Int(Hook *hook, void *pthis, Vector *out, float f1, void *cb, int i1); +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Float_Cbase_Int(Hook *hook, Vector *out, void *pthis, float f1, void *cb, int i1); #endif -const bool RT_Vector_pVector = true; -const int PC_Vector_pVector = 2; -#ifdef _WIN32 -void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1); +const bool RT_Void_Entvar_Float_Vector_Trace_Int = true; +const bool RB_Void_Entvar_Float_Vector_Trace_Int = false; +const int PC_Void_Entvar_Float_Vector_Trace_Int = 7; +void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis, + entvars_t *ev1, float f1, + Vector v1, TraceResult *tr1, + int i1); + +const bool RT_Void_Float_Vector_Trace_Int = true; +const bool RB_Void_Float_Vector_Trace_Int = false; +const int PC_Void_Float_Vector_Trace_Int = 6; +void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1, + Vector v1, TraceResult *tr1, + int i1); + +const bool RT_Str_Void = false; +const bool RB_Str_Void = false; +const int PC_Str_Void = 0; +const char *Hook_Str_Void(Hook *hook, void *pthis); + +const bool RT_Cbase_Void = false; +const bool RB_Cbase_Void = false; +const int PC_Cbase_Void = 0; +void *Hook_Cbase_Void(Hook *hook, void *pthis); + +// HACK: I'm too lazy to fix up trampoline generator to deal with +// special return values. this is so much easier. +const bool RT_Vector_Void = true; +const bool RB_Vector_Void = true; +const int PC_Vector_Void = 1; +#if defined(_WIN32) +void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out); +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis); +#endif + +const bool RT_Vector_pVector = true; +const bool RB_Vector_pVector = true; +const int PC_Vector_pVector = 2; +#if defined(_WIN32) +void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1); +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1); +#endif + +const bool RT_Int_pVector = false; +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_Void_Entvar_Float_Float = true; +const bool RB_Void_Entvar_Float_Float = false; +const int PC_Void_Entvar_Float_Float = 3; +void Hook_Void_Entvar_Float_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1, float f2); + +const bool RT_Void_pFloat_pFloat = true; +const bool RB_Void_pFloat_pFloat = false; +const int PC_Void_pFloat_pFloat = 2; +void Hook_Void_pFloat_pFloat(Hook *hook, void *pthis, float *f1, float *f2); + +const bool RT_Void_Entvar_Float = true; +const bool RB_Void_Entvar_Float = false; +const int PC_Void_Entvar_Float = 2; +void Hook_Void_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1); + + +const bool RT_Void_Int_Int_Int = true; +const bool RB_Void_Int_Int_Int = false; +const int PC_Void_Int_Int_Int = 3; +void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3); + +const bool RT_Void_ItemInfo = true; +const bool RB_Void_ItemInfo = false; +const int PC_Void_ItemInfo = 1; +void Hook_Void_ItemInfo(Hook *hook, void *pthis, void *iteminfo); + + +const bool RT_Float_Void = false; +const bool RB_Float_Void = false; +const int PC_Float_Void = 0; +float Hook_Float_Void(Hook *hook, void *pthis); + +const bool RT_Float_Int = false; +const bool RB_Float_Int = false; +const int PC_Float_Int = 1; +float Hook_Float_Int(Hook *hook, void *pthis, int i1); + +const bool RT_Void_Float_Int = true; +const bool RB_Void_Float_Int = false; +const int PC_Void_Float_Int = 2; +void Hook_Void_Float_Int(Hook *hook, void *pthis, float f1, int i1); + +const bool RT_Float_Float_Cbase = true; +const bool RB_Float_Float_Cbase = false; +const int PC_Float_Float_Cbase = 2; +float Hook_Float_Float_Cbase(Hook *hook, void *pthis, float f1, void *cb1); + +const bool RT_Void_Float = true; +const bool RB_Void_Float = false; +const int PC_Void_Float = 1; +void Hook_Void_Float(Hook *hook, void *pthis, float f1); + +const bool RT_Void_Float_Float_Float_Int = true; +const bool RB_Void_Float_Float_Float_Int = false; +const int PC_Void_Float_Float_Float_Int = 4; +void Hook_Void_Float_Float_Float_Int(Hook *hook, void *pthis, float f1, float f2, float f3, int i1); + +const bool RT_Vector_Float = true; +const bool RB_Vector_Float = true; +const int PC_Vector_Float = 2; +#if defined(_WIN32) +void Hook_Vector_Float(Hook *hook, void *pthis, Vector *out, float f1); #elif defined(__linux__) || defined(__APPLE__) -void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1); +void Hook_Vector_Float(Hook *hook, Vector *out, void *pthis, float f1); #endif -const bool RT_Int_pVector = false; -const int PC_Int_pVector = 1; -int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1); +const bool RT_Void_Float_Cbase = true; +const bool RB_Void_Float_Cbase = false; +const int PC_Void_Float_Cbase = 2; +void Hook_Void_Float_Cbase(Hook *hook, void *pthis, float f1, void *cb); -const bool RT_Void_Entvar_Float_Float = true; -const int PC_Void_Entvar_Float_Float = 3; -void Hook_Void_Entvar_Float_Float(Hook *hook, void *pthis, entvars_t *ev1, - float f1, float f2); +const bool RT_Int_Float_Float = false; +const bool RB_Int_Float_Float = false; +const int PC_Int_Float_Float = 2; +int Hook_Int_Float_Float(Hook *hook, void *pthis, float f1, float f2); -const bool RT_Int_pFloat_pFloat = false; -const int PC_Int_pFloat_pFloat = 2; -int Hook_Int_pFloat_pFloat(Hook *hook, void *pthis, float *f1, - float *f2); +const bool RT_Int_Float = false; +const bool RB_Int_Float = false; +const int PC_Int_Float = 1; +int Hook_Int_Float(Hook *hook, void *pthis, float f1); -const bool RT_Void_Entvar_Float = true; -const int PC_Void_Entvar_Float = 2; -void Hook_Void_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1); +const bool RT_Int_Int_Int = false; +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_Void_Str_Float_Float_Float = true; +const bool RB_Void_Str_Float_Float_Float = false; +const int PC_Void_Str_Float_Float_Float = 4; +void Hook_Void_Str_Float_Float_Float(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3); + +const bool RT_Void_Str_Float_Float_Float_Int_Cbase = true; +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_Int_Vector_Vector_Float_Float= false; +const bool RB_Int_Vector_Vector_Float_Float = false; +const int PC_Int_Vector_Vector_Float_Float = 8; +int Hook_Int_Vector_Vector_Float_Float(Hook *hook, void *pthis, Vector v1, Vector v2, float f1, float f2); + +const bool RT_Int_Short = false; +const bool RB_Int_Short = false; +const int PC_Int_Short = 1; +int Hook_Int_Short(Hook *hook, void *pthis, short s1); + +const bool RT_Void_Entvar_Entvar_Float_Int_Int = true; +const bool RB_Void_Entvar_Entvar_Float_Int_Int = false; +const int PC_Void_Entvar_Entvar_Float_Int_Int = 5; +void Hook_Void_Entvar_Entvar_Float_Int_Int(Hook *hook, void *pthis, + entvars_t *inflictor, + entvars_t *attacker, float damage, + int classignore, int damagebits); + +const bool RT_Void_Vector_Entvar_Entvar_Float_Int_Int = true; +const bool RB_Void_Vector_Entvar_Entvar_Float_Int_Int = false; +const int PC_Void_Vector_Entvar_Entvar_Float_Int_Int = 8; +void Hook_Void_Vector_Entvar_Entvar_Float_Int_Int(Hook *hook, void *pthis, + Vector source, + entvars_t *inflictor, + entvars_t *attacker, float damage, + int classignore, int damagebits); -const bool RT_Void_Int_Int_Int = true; -const int PC_Void_Int_Int_Int = 3; -void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3); +const bool RT_Float_Int_Float = false; +const bool RB_Float_Int_Float = false; +const int PC_Float_Int_Float = 2; +float Hook_Float_Int_Float(Hook *hook, void *pthis, int i1, float f2); -const bool RT_Void_ItemInfo = true; -const int PC_Void_ItemInfo = 1; -void Hook_Void_ItemInfo(Hook *hook, void *pthis, void *iteminfo); +const bool RT_Int_Str = false; +const bool RB_Int_Str = false; +const int PC_Int_Str = 1; +int Hook_Int_Str(Hook *hook, void *pthis, const char *sz1); +const bool RT_Void_Edict = true; +const bool RB_Void_Edict = false; +const int PC_Void_Edict = 1; +void Hook_Void_Edict(Hook *hook, void *pthis, edict_t *ed1 ); + +const bool RT_Void_Int_Str_Bool = true; +const bool RB_Void_Int_Str_Bool = false; +const int PC_Void_Int_Str_Bool = 3; +void Hook_Void_Int_Str_Bool(Hook *hook, void *pthis, int i1, const char *sz2, bool b3); + +const bool RT_Void_Vector_Vector= true; +const bool RB_Void_Vector_Vector = false; +const int PC_Void_Vector_Vector = 6; +void Hook_Void_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2); + +const bool RT_Void_Str_Bool = true; +const bool RB_Void_Str_Bool = false; +const int PC_Void_Str_Bool = 2; +void Hook_Void_Str_Bool(Hook *hook, void *pthis, const char *sz1, bool b2); -const bool RT_Float_Void = false; -const int PC_Float_Void = 0; -float Hook_Float_Void(Hook *hook, void *pthis); +const bool RT_Int_Str_Str_Int_Str_Int_Int = false; +const bool RB_Int_Str_Str_Int_Str_Int_Int = false; +const int PC_Int_Str_Str_Int_Str_Int_Int = 6; +int Hook_Int_Str_Str_Int_Str_Int_Int(Hook *hook, void *pthis, const char *sz1, const char *sz2, int i1, const char *sz3, int i2, int i3); + +const bool RT_Int_Int_Int_Float_Int = false; +const bool RB_Int_Int_Int_Float_Int = false; +const int PC_Int_Int_Int_Float_Int = 4; +int Hook_Int_Int_Int_Float_Int(Hook *hook, void *pthis, int i1, int i2, float f1, int i3); + +const bool RT_Void_Str_Int = true; +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_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_Str = true; +const bool RB_Void_Str = false; +const int PC_Void_Str = 1; +void Hook_Void_Str(Hook *hook, void *pthis, const char *sz1); + +const bool RT_Void_Vector = true; +const bool RB_Void_Vector = false; +const int PC_Void_Vector = 3; +void Hook_Void_Vector(Hook *hook, void *pthis, Vector v1); + +const bool RT_Int_Str_Vector_Str = false; +const bool RB_Int_Str_Vector_Str = false; +const int PC_Int_Str_Vector_Str = 5; +int Hook_Int_Str_Vector_Str(Hook *hook, void *pthis, const char *sz1, Vector v2, const char *sz2); + +const bool RT_Int_Str_Str = false; +const bool RB_Int_Str_Str = false; +const int PC_Int_Str_Str = 2; +int Hook_Int_Str_Str(Hook *hook, void *pthis, const char *sz1, const char *sz2); + +const bool RT_Void_Float_Float = true; +const bool RB_Void_Float_Float = false; +const int PC_Void_Float_Float = 2; +void Hook_Void_Float_Float(Hook *hook, void *pthis, float f1, float f2); + +const bool RT_Void_Str_Str_Int = true; +const bool RB_Void_Str_Str_Int = false; +const int PC_Void_Str_Str_Int = 3; +void Hook_Void_Str_Str_Int(Hook *hook, void *pthis, const char *sz1, const char *sz2, int i3); + +const bool RT_Int_pVector_pVector_Cbase_pFloat = false; +const bool RB_Int_pVector_pVector_Cbase_pFloat = false; +const int PC_Int_pVector_pVector_Cbase_pFloat = 4; +int Hook_Int_pVector_pVector_Cbase_pFloat(Hook *hook, void *pthis, Vector *v1, Vector *v2, void* cb, float* fl); + +const bool RT_Void_Cbase_pVector_Float = true; +const bool RB_Void_Cbase_pVector_Float = false; +const int PC_Void_Cbase_pVector_Float = 3; +void Hook_Void_Cbase_pVector_Float(Hook *hook, void *pthis, void *p1, Vector *v1, float fl); + +const bool RT_Int_pVector_pVector_Float_Cbase_pVector = false; +const bool RB_Int_pVector_pVector_Float_Cbase_pVector = false; +const int PC_Int_pVector_pVector_Float_Cbase_pVector = 5; +int Hook_Int_pVector_pVector_Float_Cbase_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2, float fl, void* cb, Vector *v3); + +const bool RT_Int_Cbase_Bool = false; +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_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_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_Float_Float = false; +const bool RB_Float_Float = false; +const int PC_Float_Float = 1; +float Hook_Float_Float(Hook *hook, void *pthis, float f1); + +const bool RT_Void_Entvar_Entvar_Float = true; +const bool RB_Void_Entvar_Entvar_Float = false; +const int PC_Void_Entvar_Entvar_Float = 3; +void Hook_Void_Entvar_Entvar_Float(Hook *hook, void *pthis, entvars_t *attacker, entvars_t *inflictor, float damage); + +const bool RT_Bool_Void = false; +const bool RB_Bool_Void = false; +const int PC_Bool_Void = 0; +bool Hook_Bool_Void(Hook *hook, void *pthis); + +const bool RT_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool = false; +const bool RB_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool = false; +const int PC_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool = 7; +int Hook_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(Hook *hook, void *pthis, Vector *v1, Vector *v2, float fl, void* cb, Vector *v3, Vector *v4, bool b1); + +const bool RT_Int_Vector_Cbase = false; +const bool RB_Int_Vector_Cbase = false; +const int PC_Int_Vector_Cbase = 4; +int Hook_Int_Vector_Cbase(Hook *hook, void *pthis, Vector v1, void *cb); + +const bool RT_Int_Vector= false; +const bool RB_Int_Vector = false; +const int PC_Int_Vector = 3; +int Hook_Int_Vector(Hook *hook, void *pthis, Vector v1); + +const bool RT_Int_Cbase_pVector = false; +const bool RB_Int_Cbase_pVector = false; +const int PC_Int_Cbase_pVector = 2; +int Hook_Int_Cbase_pVector(Hook *hook, void *pthis, void *cb1, Vector *v1); + +const bool RT_Void_Bool = true; +const bool RB_Void_Bool = false; +const int PC_Void_Bool = 1; +void Hook_Void_Bool(Hook *hook, void *pthis, bool b1); + +const bool RT_Bool_Cbase = false; +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_Int = false; +const bool RB_Bool_Int = false; +const int PC_Bool_Int = 1; +bool Hook_Bool_Int(Hook *hook, void *pthis, int i1); + +const bool RT_Void_Cbase_Float = true; +const bool RB_Void_Cbase_Float = false; +const int PC_Void_Cbase_Float = 2; +void Hook_Void_Cbase_Float(Hook *hook, void *pthis, void *p1, float f1); + +const bool RT_Void_Cbase_Bool = true; +const bool RB_Void_Cbase_Bool = false; +const int PC_Void_Cbase_Bool = 2; +void Hook_Void_Cbase_Bool(Hook *hook, void *pthis, void *p1, bool b1); + +const bool RT_Vector_Vector_Vector_Vector = true; +const bool RB_Vector_Vector_Vector_Vector = true; +const int PC_Vector_Vector_Vector_Vector = 10; +#if defined(_WIN32) +void Hook_Vector_Vector_Vector_Vector(Hook *hook, void *pthis, Vector *out, Vector v1, Vector v2, Vector v3); +#elif defined(__linux__) || defined(__APPLE__) +void Hook_Vector_Vector_Vector_Vector(Hook *hook, Vector *out, void *pthis, Vector v1, Vector v2, Vector v3); +#endif + +const bool RT_Str_Str = false; +const bool RB_Str_Str = false; +const int PC_Str_Str = 1; +const char *Hook_Str_Str(Hook *hook, void *pthis, const char* str); + +const bool RT_Void_Short = true; +const bool RB_Void_Short = false; +const int PC_Void_Short = 1; +void Hook_Void_Short(Hook *hook, void *pthis, short i1); -const bool RT_Void_Float_Int = true; -const int PC_Void_Float_Int = 2; -void Hook_Void_Float_Int(Hook *hook, void *pthis, float f1, int i1); const bool RT_Deprecated = true; +const bool RB_Deprecated = false; const int PC_Deprecated = 0; void Hook_Deprecated(Hook* hook); - - - -#endif +#endif diff --git a/dlls/hamsandwich/hook_create.cpp b/dlls/hamsandwich/hook_create.cpp index 5afbb630..495761e3 100644 --- a/dlls/hamsandwich/hook_create.cpp +++ b/dlls/hamsandwich/hook_create.cpp @@ -1,177 +1,461 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#include "amxxmodule.h" - -int Create_Void_Void(AMX *amx, const char *func) +#include "amxxmodule.h" + +int Create_Void_Void(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); +} + +int Create_Int_Void(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); +} + +int Create_Void_Entvar(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_Cbase(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Int_Float_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); +} + +int Create_Int_Float_Int_Int(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); } -int Create_Int_Void(AMX *amx, const char *func) +int Create_Void_Entvar_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_Entvar_Entvar_Int(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Int_Cbase(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + +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_Int_Int_Str_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_DONE); +} + +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(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); +} + +int Create_Int_Entvar_Entvar_Float_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); +} + +int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_FLOAT, FP_CELL, FP_DONE); +} + +int Create_Void_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); +} + +int Create_Vector_Float_Cbase_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(AMX *amx, const char *func) +int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_Float_Vector_Trace_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Str_Void(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); +} + +int Create_Cbase_Void(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); +} + +int Create_Vector_Void(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); +} + +int Create_Vector_pVector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE); +} + +int Create_Int_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); +} + +int Create_Void_pFloat_pFloat(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE); +} + +int Create_Void_Entvar_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); +} + +int Create_Void_Int_Int_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_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); +} + +int Create_Float_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); } +int Create_Void_Float_Int(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); +} -int Create_Void_Cbase(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); -} - -int Create_Int_Float_Int(AMX *amx, const char *func) +int Create_Float_Float_Cbase(AMX* amx, const char* func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); } - -int Create_Void_Entvar_Int(AMX *amx, const char *func) +int Create_Void_Float(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE); +} + +int Create_Void_Float_Float_Float_Int(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_DONE); +} + +int Create_Vector_Float(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE); +} + +int Create_Void_Float_Cbase(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); +} + +int Create_Int_Float_Float(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE); +} + +int Create_Int_Float(AMX* amx, const char* func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE); +} + +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_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); +} -int Create_Int_Cbase(AMX *amx, const char *func) +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_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); +} + +int Create_Int_Short(AMX* amx, const char* func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); } -int Create_Void_Int_Int(AMX *amx, const char *func) +int Create_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); } -int Create_Int_Int_Str_Int(AMX *amx, const char *func) +int Create_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Float_Int_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); +} + +int Create_Int_Str(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_DONE); +} + +int Create_Void_Edict(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Void_Int_Str_Bool(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_DONE); } -int Create_Int_Int(AMX *amx, const char *func) +int Create_Void_Vector_Vector(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE); } -int Create_Int_Entvar(AMX *amx, const char *func) +int Create_Void_Str_Bool(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_CELL, FP_DONE); } -int Create_Int_Entvar_Entvar_Float_Int(AMX *amx, const char *func) +int Create_Int_Str_Str_Int_Str_Int_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_STRING, FP_CELL, FP_STRING, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Int_Int_Int_Float_Int(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); } -int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func) +int Create_Void_Str_Int(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_CELL, FP_DONE); } -int Create_Void_Int(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); -} - -int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); -} - -int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE); -} - -int Create_Void_Float_Vector_Trace_Int(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE); -} - -int Create_Str_Void(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); -} - -int Create_Cbase_Void(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); -} - -int Create_Vector_Void(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); -} - -int Create_Vector_pVector(AMX *amx, const char *func) -{ - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE); -} - -int Create_Int_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); -} - -int Create_Int_pFloat_pFloat(AMX *amx, const char *func) +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_Entvar_Float(AMX *amx, const char *func) +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); +} + +int Create_Int_Str_Vector_Str(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_ARRAY, FP_STRING, FP_DONE); +} + +int Create_Int_Str_Str(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_STRING, FP_DONE); +} + +int Create_Void_Float_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE); +} + +int Create_Void_Str_Str_Int(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_STRING, FP_CELL, FP_DONE); +} + +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_Void_Cbase_pVector_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_ARRAY, FP_FLOAT, FP_DONE); +} + +int Create_Int_pVector_pVector_Float_Cbase_pVector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_CELL, FP_ARRAY, FP_DONE); +} + +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_Int_Vector_Vector(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_Void_Int_Int_Int(AMX *amx, const char *func) + +int Create_Float_Float(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE); } -int Create_Void_ItemInfo(AMX *amx, const char *func) + +int Create_Void_Entvar_Entvar_Float(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); } -int Create_Float_Void(AMX *amx, const char *func) + +int Create_Bool_Void(AMX *amx, const char *func) { return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); } -int Create_Void_Float_Int(AMX* amx, const char* func) + +int Create_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX *amx, const char *func) { - return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_CELL, FP_ARRAY, FP_ARRAY, FP_CELL, FP_DONE); } -int Create_Deprecated(AMX* amx, const char* func) + +int Create_Int_Vector_Cbase(AMX *amx, const char *func) { - return -1; + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_CELL, FP_DONE); } + +int Create_Int_Vector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE); +} + +int Create_Int_Cbase_pVector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_ARRAY, FP_DONE); +} + +int Create_Void_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Bool_Cbase(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); +} + +int Create_Void_Cbase_Float(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); +} + +int Create_Void_Cbase_Bool(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); +} + +int Create_Vector_Vector_Vector_Vector(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_ARRAY, FP_DONE); +} + +int Create_Str_Str(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_DONE); +} + +int Create_Void_Short(AMX *amx, const char *func) +{ + return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); +} + + + +int Create_Deprecated(AMX* amx, const char* func) +{ + return -1; +} diff --git a/dlls/hamsandwich/hook_create.h b/dlls/hamsandwich/hook_create.h index 908362f5..a384d921 100644 --- a/dlls/hamsandwich/hook_create.h +++ b/dlls/hamsandwich/hook_create.h @@ -1,94 +1,206 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#ifndef HOOK_CREATE_H -#define HOOK_CREATE_H +#ifndef HOOK_CREATE_H +#define HOOK_CREATE_H + + +int Create_Void_Void(AMX *amx, const char *func); + +int Create_Int_Void(AMX *amx, const char *func); + +int Create_Void_Entvar(AMX *amx, const char *func); + +int Create_Void_Cbase(AMX *amx, const char *func); + +int Create_Int_Float_Int(AMX *amx, const char *func); +int Create_Int_Float_Int_Int(AMX *amx, const char *func); -int Create_Void_Void(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); -int Create_Int_Void(AMX *amx, const char *func); +int Create_Int_Cbase(AMX *amx, const char *func); + +int Create_Void_Int_Int(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(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); + +int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func); + +int Create_Void_Int(AMX *amx, const char *func); + +int Create_Vector_Float_Cbase_Int(AMX *amx, const char *func); -int Create_Void_Entvar(AMX *amx, const char *func); +int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func); + +int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func); + +int Create_Void_Float_Vector_Trace_Int(AMX *amx, const char *func); + +int Create_Str_Void(AMX *amx, const char *func); + +int Create_Cbase_Void(AMX *amx, const char *func); + +int Create_Vector_Void(AMX *amx, const char *func); + +int Create_Vector_pVector(AMX *amx, const char *func); + +int Create_Int_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); + +int Create_Void_Entvar_Float(AMX *amx, const char *func); + +int Create_Void_Int_Int_Int(AMX *amx, const char *func); + +int Create_Void_ItemInfo(AMX *amx, const char *func); + +int Create_Float_Void(AMX *amx, const char *func); + +int Create_Float_Int(AMX *amx, const char *func); -int Create_Void_Cbase(AMX *amx, const char *func); +int Create_Void_Float_Int(AMX *amx, const char *func); + +int Create_Float_Float_Cbase(AMX *amx, const char *func); -int Create_Int_Float_Int(AMX *amx, const char *func); - -int Create_Void_Entvar_Int(AMX *amx, const char *func); +int Create_Void_Float(AMX *amx, const char *func); -int Create_Int_Cbase(AMX *amx, const char *func); +int Create_Void_Float_Float_Float_Int(AMX *amx, const char *func); -int Create_Void_Int_Int(AMX *amx, const char *func); +int Create_Vector_Float(AMX *amx, const char *func); -int Create_Int_Int_Str_Int(AMX *amx, const char *func); +int Create_Void_Float_Cbase(AMX *amx, const char *func); -int Create_Int_Int(AMX *amx, const char *func); +int Create_Int_Float_Float(AMX* amx, const char* func); -int Create_Int_Entvar(AMX *amx, const char *func); +int Create_Int_Float(AMX* amx, const char* func); -int Create_Int_Entvar_Entvar_Float_Int(AMX *amx, const char *func); +int Create_Int_Int_Int(AMX* amx, const char* func); -int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func); +int Create_Void_Str_Float_Float_Float(AMX* amx, const char* func); -int Create_Void_Int(AMX *amx, const char *func); +int Create_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, const char *func); -int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func); +int Create_Int_Vector_Vector_Float_Float(AMX *amx, const char *func); -int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func); +int Create_Int_Short(AMX* amx, const char* func); -int Create_Void_Float_Vector_Trace_Int(AMX *amx, const char *func); +int Create_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func); -int Create_Str_Void(AMX *amx, const char *func); +int Create_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func); -int Create_Cbase_Void(AMX *amx, const char *func); +int Create_Float_Int_Float(AMX *amx, const char *func); -int Create_Vector_Void(AMX *amx, const char *func); +int Create_Int_Str(AMX *amx, const char *func); -int Create_Vector_pVector(AMX *amx, const char *func); +int Create_Void_Edict(AMX *amx, const char *func); -int Create_Int_pVector(AMX *amx, const char *func); +int Create_Void_Int_Str_Bool(AMX *amx, const char *func); -int Create_Void_Entvar_Float_Float(AMX *amx, const char *func); +int Create_Void_Vector_Vector(AMX *amx, const char *func); -int Create_Int_pFloat_pFloat(AMX *amx, const char *func); +int Create_Void_Str_Bool(AMX *amx, const char *func); -int Create_Void_Entvar_Float(AMX *amx, const char *func); +int Create_Int_Str_Str_Int_Str_Int_Int(AMX *amx, const char *func); -int Create_Void_Int_Int_Int(AMX *amx, const char *func); +int Create_Int_Int_Int_Float_Int(AMX *amx, const char *func); -int Create_Void_ItemInfo(AMX *amx, const char *func); +int Create_Void_Str_Int(AMX *amx, const char *func); -int Create_Float_Void(AMX *amx, const char *func); +int Create_Void_Cbase_Int(AMX *amx, const char *func); -int Create_Void_Float_Int(AMX *amx, const char *func); +int Create_Void_Str(AMX *amx, const char *func); +int Create_Void_Vector(AMX *amx, const char *func); -int Create_Deprecated(AMX* amx, const char* func); +int Create_Int_Str_Vector_Str(AMX *amx, const char *func); -#endif +int Create_Int_Str_Str(AMX *amx, const char *func); + +int Create_Void_Float_Float(AMX *amx, const char *func); + +int Create_Void_Str_Str_Int(AMX *amx, const char *func); + +int Create_Int_pVector_pVector_Cbase_pFloat(AMX *amx, const char *func); + +int Create_Void_Cbase_pVector_Float(AMX *amx, const char *func); + +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_Int_Vector_Vector(AMX *amx, const char *func); + +int Create_Int_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); + +int Create_Bool_Void(AMX *amx, const char *func); + +int Create_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX *amx, const char *func); + +int Create_Int_Vector_Cbase(AMX *amx, const char *func); + +int Create_Int_Vector(AMX *amx, const char *func); + +int Create_Int_Cbase_pVector(AMX *amx, const char *func); + +int Create_Void_Bool(AMX *amx, const char *func); + +int Create_Bool_Cbase(AMX *amx, const char *func); + +int Create_Bool_Int(AMX *amx, const char *func); + +int Create_Void_Cbase_Float(AMX *amx, const char *func); + +int Create_Void_Cbase_Bool(AMX *amx, const char *func); + +int Create_Vector_Vector_Vector_Vector(AMX *amx, const char *func); + +int Create_Str_Str(AMX *amx, const char *func); + +int Create_Void_Short(AMX *amx, const char *func); + + +int Create_Deprecated(AMX* amx, const char* func); + +#endif diff --git a/dlls/hamsandwich/hook_native.cpp b/dlls/hamsandwich/hook_native.cpp index 0b6aeb1e..75224ea2 100644 --- a/dlls/hamsandwich/hook_native.cpp +++ b/dlls/hamsandwich/hook_native.cpp @@ -1,485 +1,805 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ -#include -#include -#include -#include +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ +#include +#include +#include +#include + +#include +#include "amxxmodule.h" + + +#include "CVector.h" + +#include "hook.h" +#include "forward.h" +#include "hook_callbacks.h" +#include "call_funcs.h" +#include "hook_create.h" +#include "offsets.h" +#include "hooklist.h" +#include "ham_utils.h" + +OffsetManager Offsets; + +bool gDoForwards=true; + +CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; + + +#define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, RT_##__STUFF__, RB_##__STUFF__, PC_##__STUFF__, reinterpret_cast(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__ + +hook_t hooklist[] = +{ + { V("spawn", Void_Void) }, + { V("precache", Void_Void) }, + { V("keyvalue", Void_Int) }, + { V("objectcaps", Int_Void) }, + { V("activate", Void_Void) }, + { V("setobjectcollisionbox", Void_Void) }, + { V("classify", Int_Void) }, + { V("deathnotice", Void_Entvar) }, + { V("traceattack", Void_Entvar_Float_Vector_Trace_Int) }, + { V("takedamage", Int_Entvar_Entvar_Float_Int) }, + { V("takehealth", Int_Float_Int) }, + { V("killed", Void_Entvar_Int) }, + { V("bloodcolor", Int_Void) }, + { V("tracebleed", Void_Float_Vector_Trace_Int) }, + { V("istriggered", Int_Cbase) }, + { V("mymonsterpointer", Cbase_Void) }, + { V("mysquadmonsterpointer", Cbase_Void) }, + { V("gettogglestate", Int_Void) }, + { V("addpoints", Void_Int_Int) }, + { V("addpointstoteam", Void_Int_Int) }, + { V("addplayeritem", Int_Cbase) }, + { V("removeplayeritem", Int_Cbase) }, + { V("giveammo", Int_Int_Str_Int) }, + { V("getdelay", Float_Void) }, + { V("ismoving", Int_Void) }, + { V("overridereset", Void_Void) }, + { V("damagedecal", Int_Int) }, + { V("settogglestate", Void_Int) }, + { V("startsneaking", Void_Void) }, + { V("stopsneaking", Void_Void) }, + { V("oncontrols", Int_Entvar) }, + { V("issneaking", Int_Void) }, + { V("isalive", Int_Void) }, + { V("isbspmodel", Int_Void) }, + { V("reflectgauss", Int_Void) }, + { V("hastarget", Int_Int) }, + { V("isinworld", Int_Void) }, + { V("isplayer", Int_Void) }, + { V("isnetclient", Int_Void) }, + { V("teamid", Str_Void) }, + { V("getnexttarget", Cbase_Void) }, + { V("think", Void_Void) }, + { V("touch", Void_Cbase) }, + { V("use", Void_Cbase_Cbase_Int_Float) }, + { V("blocked", Void_Cbase) }, + { V("respawn", Cbase_Void) }, + { V("updateowner", Void_Void) }, + { V("fbecomeprone", Int_Void) }, + { V("center", Vector_Void) }, + { V("eyeposition", Vector_Void) }, + { V("earposition", Vector_Void) }, + { V("bodytarget", Vector_pVector) }, + { V("illumination", Int_Void) }, + { V("fvisible", Int_Cbase) }, + { V("fvecvisible", Int_pVector) }, -#include -#include "amxxmodule.h" + /** Entity specific hooks **/ + + /* CBasePlayer */ + { V("player_jump", Void_Void) }, + { V("player_duck", Void_Void) }, + { V("player_prethink", Void_Void) }, + { V("player_postthink", Void_Void) }, + { V("player_getgunposition", Vector_Void) }, + { V("player_shouldfadeondeath", Int_Void) }, + { V("player_impulsecommands", Void_Void) }, + { V("player_updateclientdata", Void_Void) }, + + /* CBasePlayerItem */ + { V("item_addtoplayer", Int_Cbase) }, + { V("item_addduplicate", Int_Cbase) }, + { V("item_candeploy", Int_Void) }, + { V("item_deploy", Int_Void) }, + { V("item_canholster", Int_Void) }, + { V("item_holster", Void_Int) }, + { V("item_updateiteminfo", Void_Void) }, + { V("item_preframe", Void_Void) }, + { V("item_postframe", Void_Void) }, + { V("item_drop", Void_Void) }, + { V("item_kill", Void_Void) }, + { V("item_attachtoplayer", Void_Cbase) }, + { V("item_primaryammoindex", Int_Void) }, + { V("item_secondaryammoindex", Int_Void) }, + { V("item_updateclientdata", Int_Cbase) }, + { V("item_getweaponptr", Cbase_Void) }, + { V("item_itemslot", Int_Void) }, + /* CBasePlayerWeapon */ + { V("weapon_extractammo", Int_Cbase) }, + { V("weapon_extractclipammo", Int_Cbase) }, + { V("weapon_addweapon", Int_Void) }, + { V("weapon_playemptysound", Int_Void) }, + { V("weapon_resetemptysound", Void_Void) }, + { V("weapon_sendweaponanim", Void_Int_Int_Int) }, + { V("weapon_isusable", Int_Void) }, + { V("weapon_primaryattack", Void_Void) }, + { V("weapon_secondaryattack", Void_Void) }, + { V("weapon_reload", Void_Void) }, + { V("weapon_weaponidle", Void_Void) }, + { V("weapon_retireweapon", Void_Void) }, + { V("weapon_shouldweaponidle", Int_Void) }, + { V("weapon_usedecrement", Int_Void) }, -#include "CVector.h" + /** Mod specific hooks **/ + + /* The Specialists */ + { V("ts_breakablerespawn", Int_Int) }, + { V("ts_canusedthroughwalls", Int_Void) }, + { V("ts_respawnwait", Deprecated) }, + + /* Counter-Strike */ + { V("cstrike_restart", Void_Void) }, + { V("cstrike_roundrespawn", Void_Void) }, + { V("cstrike_item_candrop", Int_Void) }, + { V("cstrike_item_getmaxspeed", Float_Void) }, + + /* Day of Defeat */ + { V("dod_roundrespawn", Void_Void) }, + { V("dod_roundrespawnent", Void_Void) }, + { V("dod_roundstore", Void_Void) }, + { V("dod_areasetindex", Void_Int) }, + { V("dod_areasendstatus", Void_Cbase) }, + { V("dod_getstate", Int_Void) }, + { V("dod_getstateent", Int_Cbase) }, + { V("dod_item_candrop", Int_Void) }, + + /* Team Fortress Classic */ + { V("tfc_engineeruse", Int_Cbase) }, + { V("tfc_finished", Void_Void) }, + { V("tfc_empexplode", Void_Entvar_Float_Float) }, + { V("tfc_calcempdmgrad", Void_pFloat_pFloat) }, + { V("tfc_takeempblast", Void_Entvar) }, + { V("tfc_empremove", Void_Void) }, + { V("tfc_takeconcussionblast", Void_Entvar_Float) }, + { V("tfc_concuss", Void_Entvar) }, + + /* Earth's Special Forces */ + { V("esf_isenvmodel", Int_Void) }, + { V("esf_takedamage2", Int_Entvar_Entvar_Float_Float_Int) }, + + /* Natural-Selection */ + { V("ns_getpointvalue", Int_Void) }, + { V("ns_awardkill", Void_Entvar) }, + { V("ns_resetentity", Void_Void) }, + { V("ns_updateonremove", Void_Void) }, + + { V("ts_giveslowmul", Void_Void) }, + { V("ts_goslow", Void_Float_Int) }, + { V("ts_inslow", Int_Void) }, + { V("ts_isobjective", Int_Void) }, + { V("ts_enableobjective", Void_Int) }, + { V("ts_onfreeentprivatedata", Void_Void) }, + { V("ts_shouldcollide", Int_Cbase) }, + + /** New Additions (2011) **/ -#include "hook.h" -#include "forward.h" -#include "hook_callbacks.h" -#include "call_funcs.h" -#include "hook_create.h" -#include "offsets.h" -#include "hooklist.h" -#include "ham_utils.h" + { V("changeyaw", Float_Int) }, + { V("hashumangibs", Int_Void) }, + { V("hasaliengibs", Int_Void) }, + { V("fademonster", Void_Void) }, + { V("gibmonster", Void_Void) }, + { V("becomedead", Void_Void) }, + { V("irelationship", Int_Cbase) }, + { V("painsound", Void_Void) }, + { V("reportaistate", Void_Void) }, + { V("monsterinitdead", Void_Void) }, + { V("look", Void_Int) }, + { V("bestvisibleenemy", Cbase_Void) }, + { V("finviewcone", Int_Cbase) }, + { V("fvecinviewcone", Int_pVector) }, + { V("getdeathactivity", Int_Void) }, -OffsetManager Offsets; + /* Not supported by Counter-Strike, The Specialists and Natural Selection mods. */ + { V("runai", Void_Void) }, + { V("monsterthink", Void_Void) }, + { V("monsterinit", Void_Void) }, + { V("checklocalmove", Int_pVector_pVector_Cbase_pFloat) }, + { V("move", Void_Float) }, + { V("moveexecute", Void_Cbase_pVector_Float) }, + { V("shouldadvanceroute", Int_Float) }, + { V("getstoppedactivity", Int_Void) }, + { V("stop", Void_Void) }, + { V("checkrangeattack1", Int_Float_Float) }, + { V("checkrangeattack2", Int_Float_Float) }, + { V("checkmeleeattack1", Int_Float_Float) }, + { V("checkmeleeattack2", Int_Float_Float) }, + { V("schedulechange", Void_Void) }, + { V("canplaysequence", Int_Int_Int) }, + { V("canplaysentence", Int_Int) }, + { V("playsentence", Void_Str_Float_Float_Float) }, + { V("playscriptedsentence", Void_Str_Float_Float_Float_Int_Cbase) }, + { V("sentencestop", Void_Void) }, + { V("getidealstate", Int_Void) }, + { V("setactivity", Void_Int) }, + { V("checkenemy", Int_Cbase) }, + { V("ftriangulate", Int_pVector_pVector_Float_Cbase_pVector) }, + { V("setyawspeed", Void_Void) }, + { V("buildnearestroute", Int_Vector_Vector_Float_Float) }, + { V("findcover", Int_Vector_Vector_Float_Float) }, + { V("coverradius", Float_Void) }, + { V("fcancheckattacks", Int_Void) }, + { V("checkammo", Void_Void) }, + { V("ignoreconditions", Int_Void) }, + { V("fvalidatehinttype", Int_Short) }, + { V("fcanactiveidle", Int_Void) }, + { V("isoundmask", Int_Void) }, + { V("hearingsensitivity", Float_Void) }, + { V("barnaclevictimbitten", Void_Entvar) }, + { V("barnaclevictimreleased", Void_Void) }, + { V("preschedulethink", Void_Void) }, + { V("deathsound", Void_Void) }, + { V("alertsound", Void_Void) }, + { V("idlesound", Void_Void) }, + { V("stopfollowing", Void_Int) }, -bool gDoForwards=true; - -CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; - - -#define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, RT_##__STUFF__, PC_##__STUFF__, reinterpret_cast(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__ - -hook_t hooklist[] = -{ - { V("spawn", Void_Void) }, - { V("precache", Void_Void) }, - { V("keyvalue", Void_Int) }, - { V("objectcaps", Int_Void) }, - { V("activate", Void_Void) }, - { V("setobjectcollisionbox", Void_Void) }, - { V("classify", Int_Void) }, - { V("deathnotice", Void_Entvar) }, - { V("traceattack", Void_Entvar_Float_Vector_Trace_Int) }, - { V("takedamage", Int_Entvar_Entvar_Float_Int) }, - { V("takehealth", Int_Float_Int) }, - { V("killed", Void_Entvar_Int) }, - { V("bloodcolor", Int_Void) }, - { V("tracebleed", Void_Float_Vector_Trace_Int) }, - { V("istriggered", Int_Cbase) }, - { V("mymonsterpointer", Cbase_Void) }, - { V("mysquadmonsterpointer", Cbase_Void) }, - { V("gettogglestate", Int_Void) }, - { V("addpoints", Void_Int_Int) }, - { V("addpointstoteam", Void_Int_Int) }, - { V("addplayeritem", Int_Cbase) }, - { V("removeplayeritem", Int_Cbase) }, - { V("giveammo", Int_Int_Str_Int) }, - { V("getdelay", Float_Void) }, - { V("ismoving", Int_Void) }, - { V("overridereset", Void_Void) }, - { V("damagedecal", Int_Int) }, - { V("settogglestate", Void_Int) }, - { V("startsneaking", Void_Void) }, - { V("stopsneaking", Void_Void) }, - { V("oncontrols", Int_Entvar) }, - { V("issneaking", Int_Void) }, - { V("isalive", Int_Void) }, - { V("isbspmodel", Int_Void) }, - { V("reflectgauss", Int_Void) }, - { V("hastarget", Int_Int) }, - { V("isinworld", Int_Void) }, - { V("isplayer", Int_Void) }, - { V("isnetclient", Int_Void) }, - { V("teamid", Str_Void) }, - { V("getnexttarget", Cbase_Void) }, - { V("think", Void_Void) }, - { V("touch", Void_Cbase) }, - { V("use", Void_Cbase_Cbase_Int_Float) }, - { V("blocked", Void_Cbase) }, - { V("respawn", Cbase_Void) }, - { V("updateowner", Void_Void) }, - { V("fbecomeprone", Int_Void) }, - { V("center", Vector_Void) }, - { V("eyeposition", Vector_Void) }, - { V("earposition", Vector_Void) }, - { V("bodytarget", Vector_pVector) }, - { V("illumination", Int_Void) }, - { V("fvisible", Int_Cbase) }, - { V("fvecvisible", Int_pVector) }, - - /** Entity specific hooks **/ - - /* CBasePlayer */ - { V("player_jump", Void_Void) }, - { V("player_duck", Void_Void) }, - { V("player_prethink", Void_Void) }, - { V("player_postthink", Void_Void) }, - { V("player_getgunposition", Vector_Void) }, - { V("player_shouldfadeondeath", Int_Void) }, - { V("player_impulsecommands", Void_Void) }, - { V("player_updateclientdata", Void_Void) }, - - /* CBasePlayerItem */ - { V("item_addtoplayer", Int_Cbase) }, - { V("item_addduplicate", Int_Cbase) }, - { V("item_candeploy", Int_Void) }, - { V("item_deploy", Int_Void) }, - { V("item_canholster", Int_Void) }, - { V("item_holster", Void_Int) }, - { V("item_updateiteminfo", Void_Void) }, - { V("item_preframe", Void_Void) }, - { V("item_postframe", Void_Void) }, - { V("item_drop", Void_Void) }, - { V("item_kill", Void_Void) }, - { V("item_attachtoplayer", Void_Cbase) }, - { V("item_primaryammoindex", Int_Void) }, - { V("item_secondaryammoindex", Int_Void) }, - { V("item_updateclientdata", Int_Cbase) }, - { V("item_getweaponptr", Cbase_Void) }, - { V("item_itemslot", Int_Void) }, - - /* CBasePlayerWeapon */ - { V("weapon_extractammo", Int_Cbase) }, - { V("weapon_extractclipammo", Int_Cbase) }, - { V("weapon_addweapon", Int_Void) }, - { V("weapon_playemptysound", Int_Void) }, - { V("weapon_resetemptysound", Void_Void) }, - { V("weapon_sendweaponanim", Void_Int_Int_Int) }, - { V("weapon_isusable", Int_Void) }, - { V("weapon_primaryattack", Void_Void) }, - { V("weapon_secondaryattack", Void_Void) }, - { V("weapon_reload", Void_Void) }, - { V("weapon_weaponidle", Void_Void) }, - { V("weapon_retireweapon", Void_Void) }, - { V("weapon_shouldweaponidle", Int_Void) }, - { V("weapon_usedecrement", Int_Void) }, /** Mod specific hooks **/ - /* The Specialists */ - { V("ts_breakablerespawn", Int_Int) }, - { V("ts_canusedthroughwalls", Int_Void) }, - { V("ts_respawnwait", Deprecated) }, - /* Counter-Strike */ - { V("cstrike_restart", Void_Void) }, - { V("cstrike_roundrespawn", Void_Void) }, - { V("cstrike_item_candrop", Int_Void) }, - { V("cstrike_item_getmaxspeed", Float_Void) }, + { V("cstrike_weapon_sendweaponanim",Void_Int_Int) }, + { V("cstrike_player_resetmaxspeed", Void_Void) }, + { V("cstrike_player_isbot", Int_Void) }, + { V("cstrike_player_getautoaimvector", Vector_Float) }, + { V("cstrike_player_blind", Void_Float_Float_Float_Int) }, + { V("cstrike_player_ontouchingweapon",Void_Cbase) }, /* Day of Defeat */ - { V("dod_roundrespawn", Void_Void) }, - { V("dod_roundrespawnent", Void_Void) }, - { V("dod_roundstore", Void_Void) }, - { V("dod_areasetindex", Void_Int) }, - { V("dod_areasendstatus", Void_Cbase) }, - { V("dod_getstate", Int_Void) }, - { V("dod_getstateent", Int_Cbase) }, - { V("dod_item_candrop", Int_Void) }, + { V("dod_setscriptreset", Void_Void) }, + { V("dod_item_spawndeploy", Int_Void) }, + { V("dod_item_setdmgtime", Void_Float) }, + { V("dod_item_dropgren", Void_Void) }, + { V("dod_weapon_isuseable", Int_Void) }, + { V("dod_weapon_aim", Vector_Float_Cbase_Int) }, + { V("dod_weapon_flaim", Float_Float_Cbase) }, + { V("dod_weapon_removestamina", Void_Float_Cbase) }, + { V("dod_weapon_changefov", Int_Int) }, + { V("dod_weapon_zoomout", Int_Void) }, + { V("dod_weapon_zoomin", Int_Void) }, + { V("dod_weapon_getfov", Int_Void) }, + { V("dod_weapon_playeriswatersniping", Bool_Void) }, + { V("dod_weapon_updatezoomspeed", Void_Void) }, + { V("dod_weapon_special", Void_Void) }, - /* Team Fortress Classic */ - { V("tfc_engineeruse", Int_Cbase) }, - { V("tfc_finished", Void_Void) }, - { V("tfc_empexplode", Void_Entvar_Float_Float) }, - { V("tfc_calcempdmgrad", Int_pFloat_pFloat) }, - { V("tfc_takeempblast", Void_Entvar) }, - { V("tfc_empremove", Void_Void) }, - { V("tfc_takeconcussionblast", Void_Entvar_Float) }, - { V("tfc_concuss", Void_Entvar) }, + { V("tfc_dbgetitemname", Str_Void) }, + { V("tfc_radiusdamage", Void_Entvar_Entvar_Float_Int_Int) }, + { V("tfc_radiusdamage2", Void_Vector_Entvar_Entvar_Float_Int_Int) }, /* Earth's Special Forces */ - { V("esf_isenvmodel", Int_Void) }, - { V("esf_takedamage2", Int_Entvar_Entvar_Float_Float_Int) }, - + { V("esf_isfighter", Int_Void) }, + { V("esf_isbuddy", Int_Void) }, + { V("esf_emitsound", Void_Str_Int) }, + { V("esf_emitnullsound", Void_Int) }, + { V("esf_increasestrength", Void_Cbase_Int) }, + { V("esf_increasepl", Void_Int) }, + { V("esf_setpowerlevel", Void_Int) }, + { V("esf_setmaxpowerlevel", Void_Int) }, + { V("esf_stopanitrigger", Void_Int) }, + { V("esf_stopfly", Void_Void) }, + { V("esf_hideweapon", Void_Void) }, + { V("esf_clientremoveweapon", Void_Int) }, + { V("esf_sendclientcustommodel",Void_Str) }, + { V("esf_canturbo", Int_Void) }, + { V("esf_canprimaryfire", Int_Void) }, + { V("esf_cansecondaryfire", Int_Void) }, + { V("esf_canstopfly", Int_Void) }, + { V("esf_canblock", Int_Void) }, + { V("esf_canraiseKi", Int_Void) }, + { V("esf_canraisestamina", Int_Void) }, + { V("esf_canteleport", Int_Void) }, + { V("esf_canstartfly", Int_Void) }, + { V("esf_canstartpowerup", Int_Void) }, + { V("esf_canjump", Int_Void) }, + { V("esf_canwalljump", Int_Void) }, + { V("esf_issuperjump", Int_Void) }, + { V("esf_ismoveback", Int_Void) }, + { V("esf_checkwalljump", Int_Void) }, + { V("esf_enablewalljump", Void_Vector) }, + { V("esf_disablewalljump", Void_Void) }, + { V("esf_resetwalljumpvars", Void_Void) }, + { V("esf_getwalljumpanim", Int_Str_Vector_Str) }, + { V("esf_getwalljumpanim2", Int_Str_Str) }, + { V("esf_setwalljumpanimation", Void_Void) }, + { V("esf_setflymovetype", Void_Void) }, + { V("esf_isflymovetype", Int_Void) }, + { V("esf_iswalkmovetype", Int_Void) }, + { V("esf_setwalkmovetype", Void_Void) }, + { V("esf_drawchargebar", Void_Int) }, + { V("esf_startblock", Void_Void) }, + { V("esf_stopblock", Void_Void) }, + { V("esf_startfly", Void_Void) }, + { V("esf_getmaxspeed", Float_Void) }, + { V("esf_setanimation", Void_Int) }, + { V("esf_playanimation", Void_Void) }, + { V("esf_getmoveforward", Int_Void) }, + { V("esf_getmoveright", Int_Void) }, + { V("esf_getmoveup", Void_Void) }, + { V("esf_addblindfx", Void_Void) }, + { V("esf_removeblindfx", Void_Void) }, + { V("esf_disablepsbar", Void_Void) }, + { V("esf_addbeamboxcrosshair", Void_Int) }, + { V("esf_removebeamboxcrosshair", Void_Void) }, + { V("esf_drawpswinbonus", Void_Void) }, + { V("esf_drawpsbar", Void_Float_Float) }, + { V("esf_lockcrosshair", Void_Void) }, + { V("esf_unlockcrosshair", Void_Void) }, + { V("esf_rotatecrosshair", Void_Void) }, + { V("esf_unrotatecrosshair", Void_Void) }, + { V("esf_watermove", Void_Void) }, + { V("esf_checktimebaseddamage", Void_Void) }, + { V("esf_doessecondaryattack", Int_Void) }, + { V("esf_doesprimaryattack", Int_Void) }, + { V("esf_removespecialmodes", Void_Void) }, + { V("esf_stopturbo", Void_Void) }, + { V("esf_takebean", Void_Void) }, + { V("esf_getpowerlevel", Void_Void) }, + { V("esf_removeallotherweapons",Void_Void) }, + { V("esf_stopswoop", Void_Void) }, + { V("esf_setdeathanimation", Void_Void) }, + { V("esf_setmodel", Void_Void) }, + { V("esf_addattacks", Void_Void) }, + { V("esf_emitclasssound", Void_Str_Str_Int) }, + { V("esf_checklightning", Void_Void) }, + { V("esf_freezecontrols", Void_Void) }, + { V("esf_unfreezecontrols", Void_Void) }, + { V("esf_updateki", Void_Void) }, + { V("esf_updatehealth", Void_Void) }, + { V("esf_getteleportdir", Vector_Void) }, + { V("esf_weapon_holsterwhenmeleed", Void_Void) }, + /* Natural-Selection */ - { V("ns_getpointvalue", Int_Void) }, - { V("ns_awardkill", Void_Entvar) }, - { V("ns_resetentity", Void_Void) }, - { V("ns_updateonremove", Void_Void) }, + { V("ns_setbonecontroller", Float_Int_Float) }, + { V("ns_savedataforreset", Void_Void) }, + { V("ns_gethull", Int_Void) }, + { V("ns_getmaxwalkspeed", Float_Void) }, + { V("ns_setteamid", Str_Str) }, + { V("ns_geteffectiveplayerclass", Int_Void) }, + { V("ns_getauthenticationmask", Int_Void) }, + { V("ns_effectiveplayerclasschanged", Void_Void) }, + { V("ns_needsteamupdate", Void_Void) }, + { V("ns_sendteamupdate", Void_Void) }, + { V("ns_sendweaponupdate", Void_Void) }, + { V("ns_initplayerfromspawn", Void_Edict) }, + { V("ns_packdeadplayeritems", Void_Void) }, + { V("ns_getanimationforactivity",Void_Int_Str_Bool) }, + { V("ns_startobserver", Void_Vector_Vector) }, + { V("ns_stopobserver", Void_Void) }, + { V("ns_getadrenalinefactor", Float_Void) }, + { V("ns_givenameditem", Void_Str_Bool) }, + { V("ns_suicide", Void_Void) }, + { V("ns_getcanuseweapon", Int_Void) }, + { V("ns_weapon_getweaponprimetime", Float_Void) }, + { V("ns_weapon_primeweapon", Void_Void) }, + { V("ns_weapon_getisweaponprimed", Int_Void) }, + { V("ns_weapon_getisweaponpriming", Int_Void) }, + { V("ns_weapon_defaultdeploy", Int_Str_Str_Int_Str_Int_Int) }, + { V("ns_weapon_defaultreload", Int_Int_Int_Float_Int) }, + { V("ns_weapon_getdeploytime", Float_Void) }, - { V("ts_giveslowmul", Void_Void) }, - { V("ts_goslow", Void_Float_Int) }, - { V("ts_inslow", Int_Void) }, - { V("ts_isobjective", Int_Void) }, - { V("ts_enableobjective", Void_Int) }, - { V("ts_onfreeentprivatedata", Void_Void) }, - { V("ts_shouldcollide", Int_Cbase) }, + /* 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_updateonremove", Void_Void) }, + { V("sc_fvisible", Int_Cbase_Bool) }, + { V("sc_fvisiblefrompos", Int_Vector_Vector) }, + { V("sc_isfacing", Int_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("sc_shouldfadeondeath", Int_Void) }, + { V("sc_setupfriendly", Void_Void) }, + { V("sc_revivethink", Void_Void) }, + { V("sc_revive", Void_Void) }, + { V("sc_startmonster", Void_Void) }, + { V("sc_checkrangeattack1_move",Int_Float_Float) }, + { V("sc_checkrangeattack2_move",Int_Float_Float) }, + { V("sc_checkmeleeattack1_move",Int_Float_Float) }, + { V("sc_checkmeleeattack2_move",Int_Float_Float) }, + { V("sc_checktankusage", Int_Void) }, + { V("sc_setgaitactivity", Int_Void) }, + { V("sc_ftriangulate", Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool) }, + { V("sc_ftriangulateextension", Int_pVector_pVector_Float_Cbase_pVector) }, + { V("sc_findcovergrenade", Int_Vector_Vector_Float_Float) }, + { V("sc_findcoverdistance", Int_Vector_Vector_Float_Float) }, + { V("sc_findattackpoint", Int_Vector_Vector_Float_Float) }, + { V("sc_fvalidatecover", Int_pVector) }, + { V("sc_nofriendlyfire1", Int_Void) }, + { V("sc_nofriendlyfire2", Int_Vector) }, + { V("sc_nofriendlyfire3", Int_Vector_Cbase) }, + { V("sc_nofriendlyfiretopos", Int_Vector) }, + { V("sc_fvisiblegunpos", Int_Cbase_pVector) }, + { V("sc_finbulletcone", Int_Cbase_pVector) }, + { V("sc_callgibmonster", Void_Void) }, + { V("sc_checktimebaseddamage", Void_Void) }, + { V("sc_ismoving", Int_Void) }, + { V("sc_isplayerfollowing", Int_Void) }, + { V("sc_startplayerfollowing", Void_Cbase) }, + { V("sc_stopplayerfollowing", Void_Int) }, + { V("sc_usesound", Void_Void) }, + { V("sc_unusesound", Void_Void) }, + { V("sc_ridemonster", Void_Cbase) }, + { V("sc_checkandapplygenericattacks", Void_Void) }, + { V("sc_checkscared", Bool_Void) }, + { V("sc_checkcreaturedanger", Void_Void) }, + { V("sc_checkfalldamage", Void_Void) }, + { V("sc_checkrevival", Void_Void) }, + { V("sc_mediccallsound", Void_Void) }, -}; + { V("sc_player_menuinputperformed", Void_Bool) }, + { V("sc_player_ismenuinputdone",Bool_Void) }, + { V("sc_player_specialspawn", Void_Void) }, + { V("sc_player_isvalidinfoentity", Bool_Void) }, + { V("sc_player_levelend", Void_Void) }, + { V("sc_player_votestarted", Void_Int) }, + { V("sc_player_canstartnextvote", Bool_Int) }, + { V("sc_player_vote", Void_Int) }, + { V("sc_player_hasvoted", Bool_Void) }, + { V("sc_player_resetvote", Void_Void) }, + { V("sc_player_lastvoteinput", Int_Void) }, + { V("sc_player_initvote", Void_Void) }, + { V("sc_player_timetostartnextvote", Float_Void) }, + { 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("sc_item_materialize", Void_Void) }, -void FailPlugin(AMX *amx, int id, int err, const char *reason) -{ - int fwd=MF_RegisterSPForwardByName(amx, "__fatal_ham_error", FP_CELL, FP_CELL, FP_STRING, FP_DONE); + { V("sc_weapon_bulletaccuracy", Vector_Vector_Vector_Vector) }, + { V("sc_weapon_tertiaryattack", Void_Void) }, + { V("sc_weapon_burstsupplement",Void_Void) }, + { V("sc_weapon_getp_model", Str_Str) }, + { 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_setfov", Void_Int) }, + { V("sc_weapon_fcanrun", Int_Void) }, + { V("sc_weapon_customdecrement",Void_Float) }, + { V("sc_weapon_setv_model", Void_Str) }, + { V("sc_weapon_setp_model", Void_Str) }, + { V("sc_weapon_changeweaponskin",Void_Short) }, - MF_ExecuteForward(fwd, id, err, reason); + /** New Additions (2013) **/ - MF_UnregisterSPForward(fwd); -} -static cell AMX_NATIVE_CALL RegisterHam(AMX *amx, cell *params) -{ - // Make sure the function we're requesting is within bounds - int func=params[1]; - int post=params[4]; + { V("tfc_killed",Void_Entvar_Entvar_Int) }, + { V("tfc_istriggered", Int_Void) }, + { V("tfc_weapon_sendweaponanim", Void_Int_Int) }, + { V("tfc_weapon_getnextattackdelay", Float_Float) }, - CHECK_FUNCTION(func); + { V("sc_takehealth",Int_Float_Int_Int) }, + { V("sc_takearmor", Int_Float_Int_Int) }, + { V("sc_giveammo", Int_Int_Str_Int_Int) }, + { V("sc_checkattacker", Int_Cbase) }, + { V("sc_player_isconnected", Int_Void) }, - char *function=MF_GetAmxString(amx, params[3], 0, NULL); - char *classname=MF_GetAmxString(amx, params[2], 1, NULL); - - // Check the entity + { V("dod_weapon_sendweaponanim", Void_Int_Int) }, - // create an entity, assign it the gamedll's class, hook it and destroy it - edict_t *Entity=CREATE_ENTITY(); + { V("cs_weapon_isweapon", Int_Void) }, - CALL_GAME_ENTITY(PLID,classname,&Entity->v); + { V("gearbox_mysquadtalkmonsterpointer", Cbase_Void) }, + { V("gearbox_weapontimebase", Float_Void) }, - if (Entity->pvPrivateData == NULL) - { - REMOVE_ENTITY(Entity); + { V("ts_weapon_alternateattack", Void_Void) }, - MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve classtype for \"%s\", hook for \"%s\" not active.",classname,function); - - return 0; - } - void **vtable=GetVTable(Entity->pvPrivateData, Offsets.GetBase()); - - REMOVE_ENTITY(Entity); - - if (vtable == NULL) - { - MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve vtable for \"%s\", hook for \"%s\" not active.",classname,function); - - return 0; - } - - // Verify that the function is valid - // Don't fail the plugin if this fails, just emit a normal error - int fwd=hooklist[func].makefunc(amx, function); - - if (fwd == -1) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Function %s not found.", function); - - return 0; - } - - // We've passed all tests... - - int **ivtable=(int **)vtable; - - void *vfunction=(void *)ivtable[hooklist[func].vtid]; - - // Check the list of this function's hooks, see if the function we have is a hook - - CVector::iterator end=hooks[func].end(); - for (CVector::iterator i=hooks[func].begin(); - i!=end; - ++i) - { - if ((*i)->tramp == vfunction) - { - // Yes, this function is hooked - Forward *pfwd=new Forward(fwd); - if (post) - { - (*i)->post.push_back(pfwd); - } - else - { - (*i)->pre.push_back(pfwd); - } - return reinterpret_cast(pfwd); - } - } - - // If we got here, the function is not hooked - Hook *hook=new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].paramcount, classname); - hooks[func].push_back(hook); - - Forward *pfwd=new Forward(fwd); - if (post) - { - hook->post.push_back(pfwd); - } - else - { - hook->pre.push_back(pfwd); - } - - return reinterpret_cast(pfwd); -} -// RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0); -static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params) -{ - // Make sure the function we're requesting is within bounds - int func=params[1]; - int post=params[4]; - - CHECK_FUNCTION(func); - - char *function=MF_GetAmxString(amx, params[3], 0, NULL); - int entid=params[2]; - char classname[64]; - - // Check the entity - - edict_t *Entity=INDEXENT_NEW(entid); - - - if (Entity->pvPrivateData == NULL) - { - - MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve classtype for entity id \"%d\", hook for \"%s\" not active.",entid,function); - - return 0; - } - void **vtable=GetVTable(Entity->pvPrivateData, Offsets.GetBase()); - - - if (vtable == NULL) - { - MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve vtable for entity id \"%d\", hook for \"%s\" not active.",entid,function); - - return 0; - } - - // Verify that the function is valid - // Don't fail the plugin if this fails, just emit a normal error - int fwd=hooklist[func].makefunc(amx, function); - - if (fwd == -1) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Function %s not found.", function); - - return 0; - } - - // We've passed all tests... - - int **ivtable=(int **)vtable; - - void *vfunction=(void *)ivtable[hooklist[func].vtid]; - - // Check the list of this function's hooks, see if the function we have is a hook - - CVector::iterator end=hooks[func].end(); - for (CVector::iterator i=hooks[func].begin(); - i!=end; - ++i) - { - if ((*i)->tramp == vfunction) - { - // Yes, this function is hooked - Forward *pfwd=new Forward(fwd); - if (post) - { - (*i)->post.push_back(pfwd); - } - else - { - (*i)->pre.push_back(pfwd); - } - return reinterpret_cast(pfwd); - } - } - - // Note down the classname for the given class - // It may very well be wrong (such as lots of TS weapons have the same classname) - // but it's the best we can do, and better than nothing. - // (only used for display) - snprintf(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname)); - - // If we got here, the function is not hooked - Hook *hook=new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].paramcount, classname); - hooks[func].push_back(hook); - - Forward *pfwd=new Forward(fwd); - if (post) - { - hook->post.push_back(pfwd); - } - else - { - hook->pre.push_back(pfwd); - } - - return reinterpret_cast(pfwd); -} -static cell AMX_NATIVE_CALL ExecuteHam(AMX *amx, cell *params) -{ - int func=params[1]; - - CHECK_FUNCTION(func); - - gDoForwards=false; - return hooklist[func].call(amx, params); -} -static cell AMX_NATIVE_CALL ExecuteHamB(AMX *amx, cell *params) -{ - int func=params[1]; - - CHECK_FUNCTION(func); - - gDoForwards=true; - return hooklist[func].call(amx, params); -} - - -static cell AMX_NATIVE_CALL IsHamValid(AMX *amx, cell *params) -{ - int func=params[1]; - - if (func >= 0 && - func < HAM_LAST_ENTRY_DONT_USE_ME_LOL && - hooklist[func].isset!=0) - { - return 1; - } - return 0; -} - -static cell AMX_NATIVE_CALL DisableHamForward(AMX *amx, cell *params) -{ - Forward *fwd=reinterpret_cast(params[1]); - - if (fwd == 0) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid HamHook handle."); - return -1; - } - - fwd->state=FSTATE_STOP; - return 0; -} -static cell AMX_NATIVE_CALL EnableHamForward(AMX *amx, cell *params) -{ - Forward *fwd=reinterpret_cast(params[1]); - - if (fwd == 0) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid HamHook handle."); - return -1; - } - - fwd->state=FSTATE_OK; - return 0; -} -AMX_NATIVE_INFO RegisterNatives[] = -{ - { "RegisterHam", RegisterHam }, - { "RegisterHamFromEntity", RegisterHamFromEntity }, - { "ExecuteHam", ExecuteHam }, - { "ExecuteHamB", ExecuteHamB }, - { "IsHamValid", IsHamValid }, - { "DisableHamForward", DisableHamForward }, - { "EnableHamForward", EnableHamForward }, - - { NULL, NULL } -}; + { V("item_getiteminfo", Void_ItemInfo) } +}; + + +void FailPlugin(AMX *amx, int id, int err, const char *reason) +{ + int fwd=MF_RegisterSPForwardByName(amx, "__fatal_ham_error", FP_CELL, FP_CELL, FP_STRING, FP_DONE); + + MF_ExecuteForward(fwd, id, err, reason); + + MF_UnregisterSPForward(fwd); +} +static cell AMX_NATIVE_CALL RegisterHam(AMX *amx, cell *params) +{ + // Make sure the function we're requesting is within bounds + int func=params[1]; + int post=params[4]; + + CHECK_FUNCTION(func); + + char *function=MF_GetAmxString(amx, params[3], 0, NULL); + char *classname=MF_GetAmxString(amx, params[2], 1, NULL); + + // Check the entity + + // create an entity, assign it the gamedll's class, hook it and destroy it + edict_t *Entity=CREATE_ENTITY(); + + CALL_GAME_ENTITY(PLID,classname,&Entity->v); + + if (Entity->pvPrivateData == NULL) + { + REMOVE_ENTITY(Entity); + + MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve classtype for \"%s\", hook for \"%s\" not active.",classname,function); + + return 0; + } + void **vtable=GetVTable(Entity->pvPrivateData, Offsets.GetBase()); + + REMOVE_ENTITY(Entity); + + if (vtable == NULL) + { + MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve vtable for \"%s\", hook for \"%s\" not active.",classname,function); + + return 0; + } + + // Verify that the function is valid + // Don't fail the plugin if this fails, just emit a normal error + int fwd=hooklist[func].makefunc(amx, function); + + if (fwd == -1) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Function %s not found.", function); + + return 0; + } + + // We've passed all tests... + + int **ivtable=(int **)vtable; + + void *vfunction=(void *)ivtable[hooklist[func].vtid]; + + // Check the list of this function's hooks, see if the function we have is a hook + + CVector::iterator end=hooks[func].end(); + for (CVector::iterator i=hooks[func].begin(); + i!=end; + ++i) + { + if ((*i)->tramp == vfunction) + { + // Yes, this function is hooked + Forward *pfwd=new Forward(fwd); + if (post) + { + (*i)->post.push_back(pfwd); + } + else + { + (*i)->pre.push_back(pfwd); + } + return reinterpret_cast(pfwd); + } + } + + // If we got here, the function is not hooked + Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname); + hooks[func].push_back(hook); + + Forward *pfwd=new Forward(fwd); + if (post) + { + hook->post.push_back(pfwd); + } + else + { + hook->pre.push_back(pfwd); + } + + return reinterpret_cast(pfwd); +} +// RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0); +static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params) +{ + // Make sure the function we're requesting is within bounds + int func=params[1]; + int post=params[4]; + + CHECK_FUNCTION(func); + + char *function=MF_GetAmxString(amx, params[3], 0, NULL); + int entid=params[2]; + char classname[64]; + + // Check the entity + + edict_t *Entity=INDEXENT_NEW(entid); + + + if (Entity->pvPrivateData == NULL) + { + + MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve classtype for entity id \"%d\", hook for \"%s\" not active.",entid,function); + + return 0; + } + void **vtable=GetVTable(Entity->pvPrivateData, Offsets.GetBase()); + + + if (vtable == NULL) + { + MF_LogError(amx, AMX_ERR_NATIVE,"Failed to retrieve vtable for entity id \"%d\", hook for \"%s\" not active.",entid,function); + + return 0; + } + + // Verify that the function is valid + // Don't fail the plugin if this fails, just emit a normal error + int fwd=hooklist[func].makefunc(amx, function); + + if (fwd == -1) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Function %s not found.", function); + + return 0; + } + + // We've passed all tests... + + int **ivtable=(int **)vtable; + + void *vfunction=(void *)ivtable[hooklist[func].vtid]; + + // Check the list of this function's hooks, see if the function we have is a hook + + CVector::iterator end=hooks[func].end(); + for (CVector::iterator i=hooks[func].begin(); + i!=end; + ++i) + { + if ((*i)->tramp == vfunction) + { + // Yes, this function is hooked + Forward *pfwd=new Forward(fwd); + if (post) + { + (*i)->post.push_back(pfwd); + } + else + { + (*i)->pre.push_back(pfwd); + } + return reinterpret_cast(pfwd); + } + } + + // Note down the classname for the given class + // It may very well be wrong (such as lots of TS weapons have the same classname) + // but it's the best we can do, and better than nothing. + // (only used for display) + snprintf(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname)); + + // If we got here, the function is not hooked + Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname); + hooks[func].push_back(hook); + + Forward *pfwd=new Forward(fwd); + if (post) + { + hook->post.push_back(pfwd); + } + else + { + hook->pre.push_back(pfwd); + } + + return reinterpret_cast(pfwd); +} +static cell AMX_NATIVE_CALL ExecuteHam(AMX *amx, cell *params) +{ + int func=params[1]; + + CHECK_FUNCTION(func); + + gDoForwards=false; + return hooklist[func].call(amx, params); +} +static cell AMX_NATIVE_CALL ExecuteHamB(AMX *amx, cell *params) +{ + int func=params[1]; + + CHECK_FUNCTION(func); + + gDoForwards=true; + return hooklist[func].call(amx, params); +} + + +static cell AMX_NATIVE_CALL IsHamValid(AMX *amx, cell *params) +{ + int func=params[1]; + + if (func >= 0 && + func < HAM_LAST_ENTRY_DONT_USE_ME_LOL && + hooklist[func].isset!=0) + { + return 1; + } + return 0; +} + +static cell AMX_NATIVE_CALL DisableHamForward(AMX *amx, cell *params) +{ + Forward *fwd=reinterpret_cast(params[1]); + + if (fwd == 0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid HamHook handle."); + return -1; + } + + fwd->state=FSTATE_STOP; + return 0; +} +static cell AMX_NATIVE_CALL EnableHamForward(AMX *amx, cell *params) +{ + Forward *fwd=reinterpret_cast(params[1]); + + if (fwd == 0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid HamHook handle."); + return -1; + } + + fwd->state=FSTATE_OK; + return 0; +} +AMX_NATIVE_INFO RegisterNatives[] = +{ + { "RegisterHam", RegisterHam }, + { "RegisterHamFromEntity", RegisterHamFromEntity }, + { "ExecuteHam", ExecuteHam }, + { "ExecuteHamB", ExecuteHamB }, + { "IsHamValid", IsHamValid }, + { "DisableHamForward", DisableHamForward }, + { "EnableHamForward", EnableHamForward }, + + { NULL, NULL } +}; diff --git a/dlls/hamsandwich/hooklist.h b/dlls/hamsandwich/hooklist.h index 24263680..ef74a22e 100644 --- a/dlls/hamsandwich/hooklist.h +++ b/dlls/hamsandwich/hooklist.h @@ -1,46 +1,47 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ -#ifndef HOOKLIST_T_H -#define HOOKLIST_T_H - -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 isvoid; // whether or not the target trampoline uses voids - int paramcount; // how many parameters are in the func - void *targetfunc; // the target hook - int (*makefunc)(AMX *, const char*); // function that creates forwards - cell (*call)(AMX *, cell*); // function to call the vcall -} hook_t; - -extern hook_t hooklist[]; - -#endif +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ +#ifndef HOOKLIST_T_H +#define HOOKLIST_T_H + +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 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 + void *targetfunc; // the target hook + int (*makefunc)(AMX *, const char*); // function that creates forwards + cell (*call)(AMX *, cell*); // function to call the vcall +} hook_t; + +extern hook_t hooklist[]; + +#endif diff --git a/dlls/hamsandwich/include/ham_const.inc b/dlls/hamsandwich/include/ham_const.inc deleted file mode 100644 index 6b592bd6..00000000 --- a/dlls/hamsandwich/include/ham_const.inc +++ /dev/null @@ -1,1129 +0,0 @@ -#if defined _ham_const_included - #endinput -#endif -#define _ham_const_included - -/** - * Ham return types. - * - - * Return these from hooks to disable calling the target function. - * Numbers match up with fakemeta's FMRES_* for clarity. They are interchangable. - * 0 (or no return) is also interpretted as HAM_IGNORED. - */ -#define HAM_IGNORED 1 /**< Calls target function, returns normal value */ -#define HAM_HANDLED 2 /**< Tells the module you did something, still calls target function and returns normal value */ -#define HAM_OVERRIDE 3 /**< Still calls the target function, but returns whatever is set with SetHamReturn*() */ -#define HAM_SUPERCEDE 4 /**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */ - -/** - * A few notes about all of the following functions: - * - Not all functions will do as you expect on all mods. - * If a function does not do what you would believe it should - * DO NOT file a bug report, you will be ignored. - * - * - Passing invalid parameters has potential to crash the server - * So be careful, and adequately test! - * - * - All functions take (and pass) a "this" index as the first param. - * This is the entity from which the function is being executed on. - * - * - All functions and forwards (eg: {Register,Execute}Ham[B]) require - * the mod to have the pev and base keys in addition to the function - * keys for the corresponding mod/operating system in hamdata.ini - * - * - Some functions that return booleans may need to be logically ANDed - * to get the results desired. e.g: if (ExecuteHam(Ham_TS_IsObjective, this) & 0x0000FFFF != 0) { // true.. } - * because the module will return the full integer value. - */ - -enum Ham -{ - /** - * Description: This is typically called whenever an entity is created. - * It is the virtual equivilent of spawn from the engine. - * Some mods call this on player spawns too. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Spawn, this); - */ - Ham_Spawn = 0, - - /** - * Description: This is typically called on map change. - * This will typically precache all assets required by the entity. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Precache, this); - */ - Ham_Precache, - - /** - * Description: Typically this is similar to an engine keyvalue call. - * Use the kvd natives from fakemeta to handle the kvd_handle passed. - * NOTE: Do not pass handle 0 to this! Use get_kvd_handle(0) from fakemeta instead! - * Forward params: function(this, kvd_handle); - * Return type: None. - * Execute params: ExecuteHam(Ham_Keyvalue, this, kvd_handle); - */ - Ham_Keyvalue, - - /** - * Description: Returns flags for how an entity can be used (FCAP_* constants in hlsdk_const.inc) - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_ObjectCaps, this); - */ - Ham_ObjectCaps, - - /** - * Description: Usually called to activate some objects. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Activate, this); - */ - Ham_Activate, - - /** - * Description: Usually called after the engine call with the same name. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_SetObjectCollisionBox, this); - */ - Ham_SetObjectCollisionBox, - - /** - * Description: Returns an integer number that corresponds with what type of entity this is. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Classify, this); - */ - Ham_Classify, - - /** - * Description: Typically called when an entity dies to notify any children entities about the death. - * Forward params: function(this, idchild) - * Return type: None. - * Execute params: ExecuteHam(Ham_DeathNotice, this, idchild) - */ - Ham_DeathNotice, - - /** - * Description: Usually called whenever an entity gets attacked by a hitscan (such as a gun) weapon. - * Use the get/set tr2 natives in fakemeta to handle the traceresult data. - * Do not use a handle of 0 as a traceresult in execution, use create_tr2() from Fakemeta - * to pass a custom handle instead. (Don't forget to free the handle when you're done.) - * Forward params: function(this, idattacker, Float:damage, Float:direction[3], traceresult, damagebits) - * Return type: None. - * Execute params: ExecuteHam(Ham_TraceAttack, this, idattacker, Float:damage, Float:direction[3], tracehandle, damagebits); - */ - Ham_TraceAttack, - - /** - * Description: Usually called whenever an entity takes any kind of damage. - * Inflictor is the entity that caused the damage (such as a gun). - * Attacker is the entity that tirggered the damage (such as the gun's owner). - * Forward params: function(this, idinflictor, idattacker, Float:damage, damagebits); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits); - */ - Ham_TakeDamage, - - /** - * Description: Usually called whenever an entity gets a form of a heal. - * Forward params: function(this, Float:health, damagebits); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_TakeHealth, this, Float:health, damagebits); - */ - Ham_TakeHealth, - - /** - * Description: Normally called whenever an entity dies. - * Forward params: function(this, idattacker, shouldgib) - * Return type: None. - * Execute params: ExecuteHam(Ham_Killed, this, idattacker, shouldgib); - */ - Ham_Killed, - - /** - * Description: Normally returns the blood color of the entity. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_BloodColor, this) - */ - Ham_BloodColor, - - /** - * Description: Traces where blood should appear. - * Forward params: function(this, Float:Damage, Float:Direction[3], trace_handle, damagebits); - * Return type: None. - * Execute params: ExecuteHam(Ham_TraceBleed, this, Float:damage, Float:direction[3], trace_handle, damagebits); - */ - Ham_TraceBleed, - - /** - * Description: Returns whether an entity is activated. - * Forward params: function(this, idActivator); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_IsTriggered, this, idActivator); - */ - Ham_IsTriggered, - - /** - * Description: Returns the id of the entity if its class is derived off of CBaseMonster, -1 otherwise. - * Forward params: function(this) - * Return type: Entity. - * Execute params: ExecuteHam(Ham_MyMonsterPointer, this); - */ - Ham_MyMonsterPointer, - - /** - * Description: Returns the id of the entity if its class is derived off of CBaseSquadMonster, -1 otherwise. - * Forward params: function(this) - * Return type: Entity. - * Execute params: ExecuteHam(Ham_MySquadMonsterPointer, this); - */ - Ham_MySquadMonsterPointer, - - /** - * Description: Returns the toggle state of the entity. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_GetToggleState, this); - */ - Ham_GetToggleState, - - /** - * 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_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_AddPointsToTeam, - - /** - * Description: Adds an item to the player's inventory. - * Forward params: function(this, idother); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_AddPlayerItem, this, idother); - */ - Ham_AddPlayerItem, - - /** - * Description: Removes an item to the player's inventory. - * Forward params: function(this, idother); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_RemovePlayerItem, this, idother); - */ - Ham_RemovePlayerItem, - - /** - * Description: Gives ammo to the entity. - * Forward params: function(this, Amount, const Name[], Max) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_GiveAmmo, this, amount, "type", max); - */ - Ham_GiveAmmo, - - /** - * Description: Unsure, I believe this is the delay between activation for an entity. - * Forward params: function(this) - * Return type: Float. - * Execute params: ExecuteHam(Ham_GetDelay, this, Float:output) - */ - Ham_GetDelay, - - /** - * Description: Whether or not the entity is moving. - * Forward params: function(this); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_IsMoving, this); - */ - Ham_IsMoving, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_OverrideReset, this) - */ - Ham_OverrideReset, - - /** - * Description: Returns the damage decal of the entity for the damage type. - * Forward params: function(this, damagebits) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_DamageDecal, this); - */ - Ham_DamageDecal, - - /** - * Description: Sets the toggle state of the entity. - * Forward params: function(this, state) - * Return type: None. - * Execute params: ExecuteHam(Ham_SetToggleState, this, state); - */ - Ham_SetToggleState, - - /** - * Description: Not entirely sure what this does. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_StartSneaking, this); - */ - Ham_StartSneaking, - - /** - * Description: Not entirely sure what this does. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_StopSneaking, this); - */ - Ham_StopSneaking, - - /** - * Description: Not entirely sure. - * Forward params: function(this, idOn) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_OnControls, this, idOn); - */ - Ham_OnControls, - - /** - * Description: Whether or not the entity is sneaking. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsSneaking, this); - */ - Ham_IsSneaking, - - /** - * Description: Whether or not the entity is alive. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsAlive, this); - */ - Ham_IsAlive, - - /** - * Description: Whether or not the entity uses a BSP model. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsBSPModel, this); - */ - Ham_IsBSPModel, - - /** - * Description: Whether or not the entity can reflect gauss shots.. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_ReflectGauss, this); - */ - Ham_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_HasTarget, this, strindex); - */ - Ham_HasTarget, - - /** - * Description: Whether or not the entity is in the world. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsInWorld, this); - */ - Ham_IsInWorld, - - /** - * Description: Whether or not the entity is a player. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsPlayer, this); - */ - Ham_IsPlayer, - - /** - * Description: Whether or not the entity is a net client. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsNetClient, this); - */ - Ham_IsNetClient, - - /** - * Description: Get the entity's team id. - * Forward params: function(this); - * Return type: String (string length returned and string byref'd in ExecuteHam). - * Execute params: ExecuteHam(Ham_TeamId, this, buffer[], size); - */ - Ham_TeamId, - - /** - * Description: Returns the next target of this. - * Forward params: function(this); - * Return type: Entity. - * Execute params: ExecuteHam(Ham_GetNextTarget, this); - */ - Ham_GetNextTarget, - - /** - * Description: Called whenever an entity thinks. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Think, this); - */ - Ham_Think, - - /** - * Description: Called whenever two entities touch. - * Forward params: function(this, idother); - * Return type: None. - * Execute params: ExecuteHam(Ham_Touch, this, idother); - */ - Ham_Touch, - - /** - * Description: Called whenver one entity uses another. - * Forward params: function(this, idcaller, idactivator, use_type, Float:value) - * Return type: None. - * Execute params: ExecuteHam(Ham_Use, this, idcaller, idactivator, use_type, Float:value); - */ - Ham_Use, - - /** - * Description: Normally called whenever one entity blocks another from moving. - * Forward params: function(this, idother); - * Return type: None. - * Execute params: ExecuteHam(Ham_Blocked, this, idother); - */ - Ham_Blocked, - - /** - * Description: Normally called when a map-based item respawns, such as a health kit or something. - * Forward params: function(this); - * Return type: Entity. - * Execute params: ExecuteHam(Ham_Respawn, this); - */ - Ham_Respawn, - - /** - * Description: Used in Half-Life to update a monster's owner. - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_UpdateOwner, this); - */ - Ham_UpdateOwner, - - /** - * Description: Normally called whenever a barnacle grabs the entity. - * Forward params: function(this); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_FBecomeProne, this); - */ - Ham_FBecomeProne, - - /** - * Description: Returns the center of the entity. - * Forward params: function(this); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_Center, this, Float:output[3]); - */ - Ham_Center, - - /** - * Description: Returns the eye position of the entity. - * Forward params: function(this); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_EyePosition, this, Float:output[3]); - */ - Ham_EyePosition, - - /** - * Description: Returns the ear position of the entity. - * Forward params: function(this); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_EarPosition, this, Float:output[3]); - */ - Ham_EarPosition, - - /** - * Description: Position to shoot at. - * Forward params: function(this, Float:srcvector[3]); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_BodyTarget, Float:srcvector[3], Float:returnvector[3]) - */ - Ham_BodyTarget, - - /** - * Description: Returns the illumination of the entity. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Illumination, this); - */ - Ham_Illumination, - - /** - * Description: Unsure, I assume it is whether or not the other entity is visible to this entity. - * Forward params: function(this, idOther); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_FVisible, this, idOther); - */ - Ham_FVisible, - - /** - * Description: Unsure, I assume it is whether or not the target vector is visible to this entity. - * Forward params: function(this, const Float:origin[3]); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_FVecVisible, this, const Float:origin[3]); - */ - Ham_FVecVisible, - - - /** - * Players have all the attributes of normal entities, in addition to these. - */ - - /** - * Description: Typically called every frame when a player has jump held. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_Jump, this); - */ - Ham_Player_Jump, - - /** - * Description: Typically called every frame when a player has duck held. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_Duck, this); - */ - Ham_Player_Duck, - - /** - * Description: Typically called every frame during PlayerPreThink engine call. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_PreThink, this); - */ - Ham_Player_PreThink, - - /** - * Description: Typically called every frame during PlayerPostThink engine call. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_PostThink, this); - */ - Ham_Player_PostThink, - - /** - * Description: Returns a vector that tells the gun position. - * Forward params: function(this) - * Return type: Vector, byreffed in execute. - * Execute params: ExecuteHam(Ham_Player_GetGunPosition, this, Float:output[3]); - */ - Ham_Player_GetGunPosition, - - /** - * Description: Whether or not the player should fade on death. - * Forward param: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Player_ShouldFadeOnDeath, this); - */ - Ham_Player_ShouldFadeOnDeath, - - /** - * Description: Called whenever an impulse command is executed. - * Forward param: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_ImpulseComands, this); - */ - Ham_Player_ImpulseCommands, - - /** - * Description: Updates the client's data for hud changes (such as ammo). Usually called every frame. - * Forward param: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_UpdateClientData, this); - */ - Ham_Player_UpdateClientData, - - /** - * 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_Item_AddToPlayer, - - /** - * Description: Unsure. - * Forward params: function(this, idOriginal); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_AddDuplicate, this, idOriginal); - */ - Ham_Item_AddDuplicate, - - /** - * Description: Whether or not this entity can be deployed. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_CanDeploy, this); - */ - Ham_Item_CanDeploy, - - /** - * Description: Deploys the entity (usually a weapon). - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_Deploy, this); - */ - Ham_Item_Deploy, - - /** - * Description: Whether or not the entity can be holstered. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_CanHolster, this); - */ - Ham_Item_CanHolster, - - /** - * Description: Whether or not the entity (usually weapon) can be holstered. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_Holster, this); - */ - Ham_Item_Holster, - - /** - * Description: Updates the HUD info about this item. - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_UpdateItemInfo, this); - */ - Ham_Item_UpdateItemInfo, - - /** - * Description: Called each frame for an item, normally only on active items. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_PreFrame, this); - */ - Ham_Item_PreFrame, - - /** - * Description: Called each frame for an item, normally only on active items. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_PostFrame, this); - */ - Ham_Item_PostFrame, - - /** - * Description: Called when an item gets dropped, normally on death only. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_Drop, this); - */ - Ham_Item_Drop, - - /** - * Description: Normally called when an item gets deleted. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_Drop, this); - */ - Ham_Item_Kill, - - /** - * Description: Called when an entity starts being attached to (normally invisible and "following") a player. - * Forward params: function(this, idPlayer) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_AttachToPlayer, this, idPlayer) - */ - Ham_Item_AttachToPlayer, - - /** - * Description: Returns the ammo index of the item. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Item_PrimaryAmmoIndex, this); - */ - Ham_Item_PrimaryAmmoIndex, - - /** - * Description: Returns the secondary ammo index of the item. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Item_SecondaryAmmoIndex, this); - */ - Ham_Item_SecondaryAmmoIndex, - - /** - * Description: Updates item data for the client. - * Forward params: function(this, idPlayer) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Item_UpdateClientData, this, idPlayer); - */ - Ham_Item_UpdateClientData, - - /** - * Description: Returns the entity index if the item is a weapon, -1 otherwise. - * Forward params: function(this) - * Return type: Entity. - * Execute Params: ExecuteHam(Ham_Item_GetWeaponPtr, this) - */ - Ham_Item_GetWeaponPtr, - - /** - * Description: Returns the item slot for the item. - * Forward params: function(this) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_Item_ItemSlot, this) - */ - Ham_Item_ItemSlot, - - - /** - * Weapons have all the attributes to Ham_Item_*, in addition to these. - */ - - /** - * Description: Gets ammo from the target weapon. - * Forward params: function(this, idTarget) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget) - */ - Ham_Weapon_ExtractAmmo, - - /** - * Description: Gets clip ammo from the target weapon. - * Forward params: function(this, idTarget) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget) - */ - Ham_Weapon_ExtractClipAmmo, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_AddWeapon, this); - */ - Ham_Weapon_AddWeapon, - - /** - * Description: Plays the weapon's empty sound. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_PlayEmptySound, this); - */ - Ham_Weapon_PlayEmptySound, - - /** - * Description: Sets the weapon so that it can play empty sound again. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_ResetEmptySound, this); - */ - Ham_Weapon_ResetEmptySound, - - /** - * Description: Sends an animation event for the weapon. - * Forward params: function(this, iAnim, skiplocal, body); - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_SendWeaponAnim, this, iAnim, skiplocal, body); - */ - Ham_Weapon_SendWeaponAnim, - - /** - * Description: Whether or not the weapon is usable (has ammo, etc.) - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_IsUsable, this) - */ - Ham_Weapon_IsUsable, - - /** - * Description: Called when the main attack of a weapon is triggered. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_PrimaryAttack, this); - */ - Ham_Weapon_PrimaryAttack, - - /** - * Description: Called when the secondary attack of a weapon is triggered. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_SecondaryAttack, this); - */ - Ham_Weapon_SecondaryAttack, - - /** - * Description: Called when the weapon is reloaded. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_Reload, this); - */ - Ham_Weapon_Reload, - - /** - * Description: Displays the idle animation for the weapon. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_WeaponIdle, this); - */ - Ham_Weapon_WeaponIdle, - - /** - * Description: There is no more ammo for this gun, so switch to the next best one. - * Forward params: function(this) - * Return type: None. - * ExecuteParams: ExecuteHam(Ham_Weapon_RetireWeapon, this) - */ - Ham_Weapon_RetireWeapon, - - /** - * Description: Whether or not the weapon should idle. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute Params: ExecuteHam(Ham_Weapon_ShouldWeaponIdle, this) - */ - Ham_Weapon_ShouldWeaponIdle, - - /** - * Description: Not sure. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_UseDecrement, this); - */ - Ham_Weapon_UseDecrement, - - /** - * Description: - - * Forward params: function(this, someboolvalue) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_BreakableRespawn, this, someboolvalue); - */ - Ham_TS_BreakableRespawn, - - /** - * Description: - - * Forward params: function(this) - * Return type: Integer (boolean) - * Execute params: ExecuteHam(Ham_TS_CanUsedThroughWalls, this); - */ - Ham_TS_CanUsedThroughWalls, - - /** - * Description: Unsure - this was removed in TS 3.0 (and thus is deprecated). - * Forward params: function(this) - * Return type: Integer (I think...) - * Execute params: ExecuteHam(Ham_TS_RespawnWait, this); - */ - Ham_TS_RespawnWait, - - /** - * Description: This is called on a map reset for most map based entities. - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_CS_Restart, this); - */ - Ham_CS_Restart, - - /** - * Description: Respawn function for players/bots only! Do not use this on non player/bot entities! - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_CS_RoundRespawn, this); - */ - Ham_CS_RoundRespawn, - /** - * Description: Whether or not the player can drop the specified item. - * Forward params: function(this) - * Return type: Integer - * Execute params: ExecuteHam(Ham_CS_Item_CanDrop, this); - */ - Ham_CS_Item_CanDrop, - - /** - * Description: Gets the maximum speed for whenever a player has the item deployed. - * Forward params: function(this); - * Return type: Float, byrefed in execute. - * Execute params: ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output); - */ - Ham_CS_Item_GetMaxSpeed, - - /** - * Description: I assume this spawns players at the start of a new round. - * Forward params: function(this) - * Return type: None. - * Execute Params: ExecuteHam(Ham_DOD_RoundRespawn, this); - */ - Ham_DOD_RoundRespawn, - - /** - * Description: I assume this spawns entities (like func_breakables) at the start of a new round. - * Forward params: function(this) - * Return type: None. - * Execute Params: ExecuteHam(Ham_DOD_RoundRespawn, this); - */ - Ham_DOD_RoundRespawnEnt, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None, I think... - * Execute params: ExecuteHam(Ham_DOD_RoundStore, this); - */ - Ham_DOD_RoundStore, - - /** - * Description: Unsure. - * Forward params: function(this, someintegervalue) - * Return type: None. - * Execute params: ExecuteHam(Ham_DOD_AreaSetIndex, this, someintegervalue) - */ - Ham_DOD_AreaSetIndex, - - /** - * Description: Unsure - * Forward params: function(this, idPlayer) - * Return type: None. - * Execute Params: ExecuteHam(Ham_DOD_AreaSendStatus, this, idPlayer); - */ - Ham_DOD_AreaSendStatus, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_DOD_GetState, this); - */ - Ham_DOD_GetState, - - /** - * Description: Unsure. - * Forward params: function(this, idtarget) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_DOD_GetStateEnt, this, idtarget); - */ - Ham_DOD_GetStateEnt, - - /** - * Description: Whether or not a player can drop this item. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute Params: ExecuteHam(Ham_DOD_Item_CanDrop, this); - */ - Ham_DOD_Item_CanDrop, - - /** - * Description: Unsure. - * Forward params: function(this, iduser) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_TFC_EngineerUse, this, iduser) - */ - Ham_TFC_EngineerUse, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_Finished, this); - */ - Ham_TFC_Finished, - - /** - * Description: Unsure. - * Forward params: function(this, entityid, Float:floata, Float:floatb) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_EmpExplode, this, entityid, Float:floata, Float:floatb) - */ - Ham_TFC_EmpExplode, - - /** - * Description: Unsure. - * Forward params: function(this, Float:floata, Float:floatb) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_CalcEmpDmgRad, this, Float:floata, Float:floatb) - */ - Ham_TFC_CalcEmpDmgRad, - - /** - * Description: Unsure. - * Forward params: function(this, entityid) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_TakeEmpBlast, this, entityid); - */ - Ham_TFC_TakeEmpBlast, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_EmpRemove, this); - */ - Ham_TFC_EmpRemove, - - - /** - * Description: Unsure. - * Forward params: function(this, entityid, Float:floata) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_TakeConcussionBlast, this, entityid, Float:floata); - */ - Ham_TFC_TakeConcussionBlast, - - /** - * Description: Unsure. - * Forward params: function(this, entityid) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_Concuss, this, entityid); - */ - Ham_TFC_Concuss, - - - /** - * Description: Unsure. - * Is only in ESF Open Beta. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_ESF_IsEnvModel, this); - */ - Ham_ESF_IsEnvModel, - - /** - * Description: Unsure. - * Is only in ESF Open Beta. - * Forward params: function(this, entityida, entityidb, Float:floata, Float:floatb, dmgbits) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_ESF_TakeDamage2, this, entityida, entityidb, Float:floata, Float:floatb, dmgbits); - */ - Ham_ESF_TakeDamage2, - - /** - * Description: Returns how many points each entity is worth. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_NS_GetPointValue, this); - */ - Ham_NS_GetPointValue, - - /** - * Description: Unsure. Probably awards this with the killing of idvictim. - * Forward params: function(this, idvictim) - * Return type: None. - * Execute params: ExecuteHam(Ham_NS_AwardKill, this, idvictim); - */ - Ham_NS_AwardKill, - - /** - * Description: Unsure, probably whenever an entity resets after a new round. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_NS_ResetEntity, this); - */ - Ham_NS_ResetEntity, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_NS_UpdateOnRemove, this) - */ - Ham_NS_UpdateOnRemove, - - - /** Virtual functions added to TS in TS 3 */ - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_GiveSlowMul, this) - */ - Ham_TS_GiveSlowMul, - - /** - * Description: Unsure. The second paramater is actually a char. - * Forward params: function(this, Float:someval, someotherval) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_GoSlow, this, Float:someval, someotherval) - */ - Ham_TS_GoSlow, - - /** - * Description: Probably returns true if the user is in slow mo. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_TS_InSlow, this) - */ - Ham_TS_InSlow, - - /** - * Description: Returns true if the entity is an objective. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_TS_IsObjective, this) - */ - Ham_TS_IsObjective, - - /** - * Description: Unsure. - * Forward params: function(this, bool:someval) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_EnableObjective, this, bool:someval) - */ - Ham_TS_EnableObjective, - - /** - * Description: Probably called when the engine call to OnEntFreePrivateData is called (the entity destructor.) - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_OnEntFreePrivateData, this) - */ - Ham_TS_OnFreeEntPrivateData, - - /** - * Description: Probably called when the engine call to ShouldCollide is called. - * Forward params: function(this, otherEntity) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_TS_ShouldCollide, this, otherEntity) - */ - Ham_TS_ShouldCollide, - - - /** - * DONT USE ME LOL - */ - HAM_LAST_ENTRY_DONT_USE_ME_LOL -}; - -enum HamError -{ - HAM_OK = 0, - - HAM_INVALID_FUNC, // The function is not valid - HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini - - HAM_ERR_END -}; diff --git a/dlls/hamsandwich/include/hamsandwich.inc b/dlls/hamsandwich/include/hamsandwich.inc deleted file mode 100644 index d2e90840..00000000 --- a/dlls/hamsandwich/include/hamsandwich.inc +++ /dev/null @@ -1,379 +0,0 @@ -/** - * Ham Sandwich module include file. - * (c) 2007, The AMX Mod X Development Team - * - * - - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of this program with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ - -/** - * Ham Sandwich is a module that is used to hook and call virtual functions of - * entities. - * Virtual functions are mod-specific functions. This means that in order - * for this to work on a mod, it needs to be configured with the hamdata.ini - * file. - * Be very careful with parameter passing to these functions. - */ - -#if defined _hamsandwich_included - #endinput -#endif -#define _hamsandwich_included - -#include - -#if AMXX_VERSION_NUM >= 175 - #pragma reqlib hamsandwich - #if !defined AMXMODX_NOAUTOLOAD - #pragma loadlib hamsandwich - #endif -#else - #pragma library hamsandwich -#endif - -/** - * Hooks the virtual table for the specified entity class. - * An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt"); - * Look at the Ham enum for parameter lists. - * - * @param function The function to hook. - * @param EntityClass The entity classname to hook. - * @param callback The forward to call. - * @param post Whether or not to forward this in post. - * @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off. - */ -native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0); - -/** - * Hooks the virtual table for the specified entity's class. - * An example would be: RegisterHam(Ham_TakeDamage, id, "player_hurt"); - * Look at the Ham enum for parameter lists. - * Note: This will cause hooks for the entire internal class that the entity is - * not exclusively for the provided entity. - * - * @param function The function to hook. - * @param EntityId The entity classname to hook. - * @param callback The forward to call. - * @param post Whether or not to forward this in post. - * @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off. - */ -native HamHook:RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0); - - -/** - * Stops a ham forward from triggering. - * Use the return value from RegisterHam as the parameter here! - * - * @param fwd The forward to stop. - */ -native DisableHamForward(HamHook:fwd); - -/** - * Starts a ham forward back up. - * Use the return value from RegisterHam as the parameter here! - * - * @param fwd The forward to re-enable. - */ -native EnableHamForward(HamHook:fwd); - -/** - * Executes the virtual function on the entity. - * Look at the Ham enum for parameter lists. - * - * @param function The function to call. - * @param id The id of the entity to execute it on. - */ -native ExecuteHam(Ham:function, this, any:...); - -/** - * Executes the virtual function on the entity, this will trigger all hooks on that function. - * Be very careful about recursion! - * Look at the Ham enum for parameter lists. - * - * @param function The function to call. - * @param id The id of the entity to execute it on. - */ -native ExecuteHamB(Ham:function, this, any:...); - -/** - * Gets the return status of the current hook. - * This is useful to determine what return natives to use. - * - * @return The current status of the hook (such as HAM_SUPERCEDE). - */ -native GetHamReturnStatus(); - -/** - * Gets the return value of a hook for hooks that return integers or booleans. - * - * @param output The variable to store the value in. - */ -native GetHamReturnInteger(&output); - -/** - * Gets the return value of a hook for hooks that return float. - * - * @param output The variable to store the value in. - */ -native GetHamReturnFloat(&Float:output); - -/** - * Gets the return value of a hook for hooks that return Vectors. - * - * @param output The variable to store the value in. - */ -native GetHamReturnVector(Float:output[3]); - -/** - * Gets the return value of a hook for hooks that return entities. - * - * @param output The variable to store the value in. Will be -1 on null. - */ -native GetHamReturnEntity(&output); - -/** - * Gets the return value of a hook for hooks that return strings. - * - * @param output The buffer to store the string in. - * @param size The string size of the buffer. - */ -native GetHamReturnString(output[], size); - -/** - * Gets the original return value of a hook for hooks that return integers or booleans. - * - * @param output The variable to store the value in. - */ -native GetOrigHamReturnInteger(&output); - -/** - * Gets the original return value of a hook for hooks that return floats. - * - * @param output The variable to store the value in. - */ -native GetOrigHamReturnFloat(&Float:output); - -/** - * Gets the original return value of a hook for hooks that return Vectors. - * - * @param output The variable to store the value in. - */ -native GetOrigHamReturnVector(Float:output[3]); - -/** - * Gets the original return value of a hook for hooks that return entities. - * - * @param output The variable to store the value in. -1 on null. - */ -native GetOrigHamReturnEntity(&output); - -/** - * Gets the original return value of a hook for hooks that return strings. - * - * @param output The buffer to store the string in. - * @param size The size of the buffer. - */ -native GetOrigHamReturnString(output[], size); - - -/** - * Sets the return value of a hook that returns an integer or boolean. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnInteger(value); - -/** - * Sets the return value of a hook that returns a float. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnFloat(Float:value); - -/** - * Sets the return value of a hook that returns a Vector. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnVector(const Float:value[3]); - -/** - * Sets the return value of a hook that returns an entity. Set to -1 for null. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnEntity(value); - -/** - * Sets the return value of a hook that returns a string. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnString(const value[]); - - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are integers. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamInteger(which, value); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are floats. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamFloat(which, Float:value); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are Vectors. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamVector(which, const Float:value[3]); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are entities. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamEntity(which, value); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are strings. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamString(which, const output[]); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are trace result handles. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamTraceResult(which, tr_handle); - - -/** - * Returns whether or not the function for the specified Ham is valid. - * Things that would make it invalid would be bounds (an older module version - * may not have all of the functions), and the function not being found in - * the mod's hamdata.ini file. - * - * @param function The function to look up. - * @return true if the function is valid, false otherwise. - */ -native bool:IsHamValid(Ham:function); - -/** - * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}. - * This requires the mod to have the pev and base fields set in hamdata.ini. - * Note this dereferences memory! Improper use of this will crash the server. - * This will return an index of the corresponding cbase field in private data. - * Returns -1 on a null entry. - * - * @param id The entity to examine the private data. - * @param offset The windows offset of the data. - * @param linuxdiff The linux difference of the data. - * @return The index of the corresponding pdata field. -1 for none set. - */ -native get_pdata_cbase(id, offset, linuxdiff=5); - -/** - * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}. - * This requires the mod to have the pev and base fields set in hamdata.ini. - * This will set the corresponding cbase field in private data with the index. - * Pass -1 to null the entry. - * - * @param id The entity to examine the private data. - * @param offset The windows offset of the data. - * @param value The index to store, -1 for invalid - * @param linuxdiff The linux difference of the data. - */ -native set_pdata_cbase(id, offset, value, linuxdiff=5); - -/** - * This is similar to the get_pdata_cbase, however it does not dereference memory. - * This is many times slower than get_pdata_cbase, and this should only be used - * for testing and finding of offsets, not actual release quality plugins. - * This will return an index of the corresponding cbase field in private data. - * Returns -1 on a null entry. -2 on an invalid entry. - * - * @param id Entry to examine the private data. - * @param offset The windows offset of the data. - * @param linuxdiff The linux difference of the data. - * @return The index of the corresponding pdata field, -1 for null, -2 for invalid. - */ -native get_pdata_cbase_safe(id, offset, linuxdiff=5); - - - - -// This is the callback from the module, this handles any fatal errors. -// This will in turn call the "HamFilter(Ham:id, HamError:err, const reason[])" public, if it exists. -// Return PLUGIN_HANDLED from within the HamFilter to stop the plugin from failing. -// Any other return value will fail the plugin. -// You do not need to have a HamFilter, if there is none, all fatal errors will fail the plugin. -// Do not modify this! -public __fatal_ham_error(Ham:id, HamError:err, const reason[]) -{ - - new func=get_func_id("HamFilter", -1); - new bool:fail=true; - - if (func != -1 && callfunc_begin_i(func, -1)==1) - { - callfunc_push_int(_:id); - callfunc_push_int(_:err); - callfunc_push_str(reason, false); - if (callfunc_end()==PLUGIN_HANDLED) - { - fail=false; - } - } - if (fail) - { - set_fail_state(reason); - } - -} diff --git a/dlls/hamsandwich/offsets.h b/dlls/hamsandwich/offsets.h index 947b6ec6..815d9ea3 100644 --- a/dlls/hamsandwich/offsets.h +++ b/dlls/hamsandwich/offsets.h @@ -1,84 +1,84 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ - -#ifndef OFFSETS_H -#define OFFSETS_H - -#include "ham_const.h" - -// Just a singleton class that keeps pev/base/offset values managed. - -class OffsetManager -{ -private: - size_t pev; - size_t baseclass; - int baseset; - int pevset; - -public: - OffsetManager() - { - memset(this,0x0,sizeof(*this)); - } - void SetPev(size_t value) - { - pevset=1; - pev=value; - }; - size_t GetPev(void) - { - return pev; - }; - int IsPevSet() - { - return pevset; - }; - int IsBaseSet() - { - return baseset; - }; - void SetBase(size_t value) - { - baseset=1; - baseclass=value; - }; - size_t GetBase(void) - { - return baseclass; - }; - bool IsValid() - { - return pevset != 0 && baseset != 0; - } -}; - -extern OffsetManager Offsets; - -#endif +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +#ifndef OFFSETS_H +#define OFFSETS_H + +#include "ham_const.h" + +// Just a singleton class that keeps pev/base/offset values managed. + +class OffsetManager +{ +private: + size_t pev; + size_t baseclass; + int baseset; + int pevset; + +public: + OffsetManager() + { + memset(this,0x0,sizeof(*this)); + } + void SetPev(size_t value) + { + pevset=1; + pev=value; + }; + size_t GetPev(void) + { + return pev; + }; + int IsPevSet() + { + return pevset; + }; + int IsBaseSet() + { + return baseset; + }; + void SetBase(size_t value) + { + baseset=1; + baseclass=value; + }; + size_t GetBase(void) + { + return baseclass; + }; + bool IsValid() + { + return pevset != 0 && baseset != 0; + } +}; + +extern OffsetManager Offsets; + +#endif diff --git a/dlls/hamsandwich/pdata.cpp b/dlls/hamsandwich/pdata.cpp index 174cde4b..9839c6b8 100644 --- a/dlls/hamsandwich/pdata.cpp +++ b/dlls/hamsandwich/pdata.cpp @@ -1,182 +1,182 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ -#include "amxxmodule.h" -#include "offsets.h" -#include "NEW_Util.h" -#include "ham_utils.h" - -inline edict_t* INDEXENT2( int iEdictNum ) -{ - if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients) - return MF_GetPlayerEdict(iEdictNum); +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ +#include "amxxmodule.h" +#include "offsets.h" +#include "NEW_Util.h" +#include "ham_utils.h" + +inline edict_t* INDEXENT2( int iEdictNum ) +{ + if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients) + return MF_GetPlayerEdict(iEdictNum); + else + return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum); +} + +#ifdef DONT_TOUCH_THIS_AGAIN_BAIL +#define FM_CHECK_ENTITY(x) \ + if (x < 0 || x > gpGlobals->maxEntities) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ + return 0; \ + } else { \ + if (x <= gpGlobals->maxClients) { \ + if (!MF_IsPlayerIngame(x)) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ + return 0; \ + } \ + } else { \ + if (x != 0 && FNullEnt(INDEXENT(x))) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ + return 0; \ + } \ + } \ + } +#endif + +#define FM_CHECK_ENTITY(x) \ + if (x < 0 || x > gpGlobals->maxEntities) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ + return 0; \ + } else if (x != 0 && FNullEnt(INDEXENT2(x))) { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ + return 0; \ + } + +// Return -1 on null, -2 on invalid, and the the index of any other. +static cell AMX_NATIVE_CALL get_pdata_cbase_safe(AMX *amx, cell *params) +{ + int index=params[1]; + FM_CHECK_ENTITY(index); + int iOffset=params[2]; +#ifdef __linux__ + iOffset += params[3]; +#elif defined __APPLE__ + // Use Linux offset in older plugins + if (params[0] / sizeof(cell) == 3) + iOffset += params[3]; else - return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum); -} - -#ifdef DONT_TOUCH_THIS_AGAIN_BAIL -#define FM_CHECK_ENTITY(x) \ - if (x < 0 || x > gpGlobals->maxEntities) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ - return 0; \ - } else { \ - if (x <= gpGlobals->maxClients) { \ - if (!MF_IsPlayerIngame(x)) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \ - return 0; \ - } \ - } else { \ - if (x != 0 && FNullEnt(INDEXENT(x))) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ - return 0; \ - } \ - } \ - } -#endif - -#define FM_CHECK_ENTITY(x) \ - if (x < 0 || x > gpGlobals->maxEntities) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \ - return 0; \ - } else if (x != 0 && FNullEnt(INDEXENT2(x))) { \ - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \ - return 0; \ - } - -// Return -1 on null, -2 on invalid, and the the index of any other. -static cell AMX_NATIVE_CALL get_pdata_cbase_safe(AMX *amx, cell *params) -{ - int index=params[1]; - FM_CHECK_ENTITY(index); - int iOffset=params[2]; -#ifdef __linux__ - iOffset += params[3]; -#elif defined __APPLE__ - // Use Linux offset in older plugins - if (params[0] / sizeof(cell) == 3) - iOffset += params[3]; - else - iOffset += params[4]; -#endif - if (iOffset <0) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid offset provided. (got: %d)", iOffset); - return 0; - } - void *ptr=*((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)); - - if (ptr == 0) - { - return -1; - } - - for (int i=0; imaxEntities; ++i) - { - if (ptr == INDEXENT_NEW(i)->pvPrivateData) - { - return i; - } - } - - return -2; -} -static cell AMX_NATIVE_CALL get_pdata_cbase(AMX *amx, cell *params) -{ - int index=params[1]; - FM_CHECK_ENTITY(index); - int iOffset=params[2]; -#ifdef __linux__ - iOffset += params[3]; -#elif defined __APPLE__ - // Use Linux offset in older plugins - if (params[0] / sizeof(cell) == 3) - iOffset += params[3]; - else - iOffset += params[4]; -#endif - - if (iOffset <0) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid offset provided. (got: %d)", iOffset); - return 0; - } - void *ptr=*((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)); - - return PrivateToIndex(ptr); -} -static cell AMX_NATIVE_CALL set_pdata_cbase(AMX *amx, cell *params) -{ - int index=params[1]; - FM_CHECK_ENTITY(index); - int target=params[3]; - - if (target != -1) - { - FM_CHECK_ENTITY(target); - } - int iOffset=params[2]; -#ifdef __linux__ - iOffset += params[4]; -#elif defined __APPLE__ - // Use Linux offset in older plugins - if (params[0] / sizeof(cell) == 4) - iOffset += params[4]; - else - iOffset += params[5]; -#endif - if (iOffset <0) - { - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid offset provided. (got: %d)", iOffset); - return 0; - } - - if (target == -1) - { - *((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)) = NULL; - } - else - { - *((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)) = INDEXENT_NEW(target)->pvPrivateData; - } - - return 1; -} - -AMX_NATIVE_INFO pdata_natives_safe[] = -{ - { "get_pdata_cbase_safe", get_pdata_cbase_safe }, - - { NULL, NULL } -}; -AMX_NATIVE_INFO pdata_natives[] = -{ - { "get_pdata_cbase", get_pdata_cbase }, - { "set_pdata_cbase", set_pdata_cbase }, - - { NULL, NULL } -}; + iOffset += params[4]; +#endif + if (iOffset <0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid offset provided. (got: %d)", iOffset); + return 0; + } + void *ptr=*((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)); + + if (ptr == 0) + { + return -1; + } + + for (int i=0; imaxEntities; ++i) + { + if (ptr == INDEXENT_NEW(i)->pvPrivateData) + { + return i; + } + } + + return -2; +} +static cell AMX_NATIVE_CALL get_pdata_cbase(AMX *amx, cell *params) +{ + int index=params[1]; + FM_CHECK_ENTITY(index); + int iOffset=params[2]; +#ifdef __linux__ + iOffset += params[3]; +#elif defined __APPLE__ + // Use Linux offset in older plugins + if (params[0] / sizeof(cell) == 3) + iOffset += params[3]; + else + iOffset += params[4]; +#endif + + if (iOffset <0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid offset provided. (got: %d)", iOffset); + return 0; + } + void *ptr=*((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)); + + return PrivateToIndex(ptr); +} +static cell AMX_NATIVE_CALL set_pdata_cbase(AMX *amx, cell *params) +{ + int index=params[1]; + FM_CHECK_ENTITY(index); + int target=params[3]; + + if (target != -1) + { + FM_CHECK_ENTITY(target); + } + int iOffset=params[2]; +#ifdef __linux__ + iOffset += params[4]; +#elif defined __APPLE__ + // Use Linux offset in older plugins + if (params[0] / sizeof(cell) == 4) + iOffset += params[4]; + else + iOffset += params[5]; +#endif + if (iOffset <0) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid offset provided. (got: %d)", iOffset); + return 0; + } + + if (target == -1) + { + *((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)) = NULL; + } + else + { + *((void **)((int *)INDEXENT_NEW(index)->pvPrivateData + iOffset)) = INDEXENT_NEW(target)->pvPrivateData; + } + + return 1; +} + +AMX_NATIVE_INFO pdata_natives_safe[] = +{ + { "get_pdata_cbase_safe", get_pdata_cbase_safe }, + + { NULL, NULL } +}; +AMX_NATIVE_INFO pdata_natives[] = +{ + { "get_pdata_cbase", get_pdata_cbase }, + { "set_pdata_cbase", set_pdata_cbase }, + + { NULL, NULL } +}; diff --git a/dlls/hamsandwich/sdk/moduleconfig.h b/dlls/hamsandwich/sdk/moduleconfig.h index 05bc2b0a..4f24e57d 100644 --- a/dlls/hamsandwich/sdk/moduleconfig.h +++ b/dlls/hamsandwich/sdk/moduleconfig.h @@ -56,7 +56,7 @@ #define FN_AMXX_ATTACH OnAmxxAttach /** AMXX Detach (unload) */ -//#define FN_AMXX_DETACH OnAmxxDetach +#define FN_AMXX_DETACH OnAmxxDetach /** All plugins loaded * Do forward functions init here (MF_RegisterForward) diff --git a/dlls/hamsandwich/srvcmd.cpp b/dlls/hamsandwich/srvcmd.cpp index d87c004f..a877c457 100644 --- a/dlls/hamsandwich/srvcmd.cpp +++ b/dlls/hamsandwich/srvcmd.cpp @@ -1,140 +1,139 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. - */ - -#include "amxxmodule.h" - -#include - -#include "CVector.h" - -#include "ham_const.h" -#include "hooklist.h" -#include "offsets.h" -#include "forward.h" -#include "hook.h" - - -extern hook_t hooklist[]; -extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; - -void print_srvconsole(const char *fmt, ...) -{ - va_list argptr; - static char string[384]; - va_start(argptr, fmt); - vsnprintf(string, sizeof(string) - 1, fmt, argptr); - string[sizeof(string) - 1] = '\0'; - va_end(argptr); - - SERVER_PRINT(string); -} - - - -void HamCommand(void) -{ - const char *cmd=CMD_ARGV(1); - - if (strcmp(cmd, "list")==0) - { - unsigned int Total=0; - print_srvconsole("%-24s | %10s\n","Name","Set","Value"); - print_srvconsole("------------------------------------\n"); - print_srvconsole("%-24s | %10d\n", "pev", Offsets.GetPev()); - print_srvconsole("%-24s | %10d\n", "base", Offsets.GetBase()); - - if (Offsets.IsPevSet()) - { - Total++; - } - if (Offsets.IsBaseSet()) - { - Total++; - } - - int count=2; - for (int i=0; i= 5) - { - count = 0; - print_srvconsole("------------------------------------\n"); - - } - - - } - print_srvconsole("\n%u keys, %u set.\n\n", HAM_LAST_ENTRY_DONT_USE_ME_LOL, Total); - return; - } - else if (strcmp(cmd, "hooks")==0) - { - print_srvconsole("%-24s | %-27s | %10s | %10s\n", "Key", "Classname", "Pre", "Post"); - print_srvconsole("--------------------------------------------------------------------------------\n"); - unsigned int ForwardCount=0; - unsigned int HookCount=0; - int count = 0; - for (int i=0; i::iterator end=hooks[i].end(); - - for (CVector::iterator j=hooks[i].begin(); - j!=end; - ++j) - { - HookCount++; - ForwardCount+=(*j)->pre.size() + (*j)->post.size(); - - print_srvconsole("%-24s | %-27s | %10d | %10d\n",hooklist[i].name, (*j)->ent, (*j)->pre.size(), (*j)->post.size()); - if (count >= 5) - { - print_srvconsole("--------------------------------------------------------------------------------\n"); - } - } - } - print_srvconsole("\n%u hooks, %u forwards.\n\n", HookCount, ForwardCount); - return; - } - - // Unknown command - print_srvconsole("Usage: ham < command > [ argument ]\n"); - print_srvconsole("Commands:\n"); - print_srvconsole(" %-22s - %s\n", "list", "list all keys and their values from the config file."); - print_srvconsole(" %-22s - %s\n", "hooks", "list all active hooks"); -} - +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +#include "amxxmodule.h" + +#include + +#include "CVector.h" + +#include "ham_const.h" +#include "hooklist.h" +#include "offsets.h" +#include "forward.h" +#include "hook.h" + + +extern hook_t hooklist[]; +extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; + +void print_srvconsole(const char *fmt, ...) +{ + va_list argptr; + static char string[384]; + va_start(argptr, fmt); + vsnprintf(string, sizeof(string) - 1, fmt, argptr); + string[sizeof(string) - 1] = '\0'; + va_end(argptr); + + SERVER_PRINT(string); +} + + + +void HamCommand(void) +{ + const char *cmd=CMD_ARGV(1); + + if (strcmp(cmd, "list")==0) + { + unsigned int Total=0; + print_srvconsole("%-24s | %10s\n","Name","Set","Value"); + print_srvconsole("------------------------------------\n"); + print_srvconsole("%-24s | %10d\n", "pev", Offsets.GetPev()); + print_srvconsole("%-24s | %10d\n", "base", Offsets.GetBase()); + + if (Offsets.IsPevSet()) + { + Total++; + } + if (Offsets.IsBaseSet()) + { + Total++; + } + + int count=2; + for (int i=0; i= 5) + { + count = 0; + print_srvconsole("------------------------------------\n"); + + } + + + } + print_srvconsole("\n%u keys, %u set.\n\n", HAM_LAST_ENTRY_DONT_USE_ME_LOL, Total); + return; + } + else if (strcmp(cmd, "hooks")==0) + { + print_srvconsole("%-24s | %-27s | %10s | %10s\n", "Key", "Classname", "Pre", "Post"); + print_srvconsole("--------------------------------------------------------------------------------\n"); + unsigned int ForwardCount=0; + unsigned int HookCount=0; + int count = 0; + for (int i=0; i::iterator end=hooks[i].end(); + + for (CVector::iterator j=hooks[i].begin(); + j!=end; + ++j) + { + HookCount++; + ForwardCount+=(*j)->pre.size() + (*j)->post.size(); + + print_srvconsole("%-24s | %-27s | %10d | %10d\n",hooklist[i].name, (*j)->ent, (*j)->pre.size(), (*j)->post.size()); + if (count >= 5) + { + print_srvconsole("--------------------------------------------------------------------------------\n"); + } + } + } + print_srvconsole("\n%u hooks, %u forwards.\n\n", HookCount, ForwardCount); + return; + } + + // Unknown command + print_srvconsole("Usage: ham < command > [ argument ]\n"); + print_srvconsole("Commands:\n"); + print_srvconsole(" %-22s - %s\n", "list", "list all keys and their values from the config file."); + print_srvconsole(" %-22s - %s\n", "hooks", "list all active hooks"); +} diff --git a/dlls/hamsandwich/typetocell.h b/dlls/hamsandwich/typetocell.h index b8afe3c8..fb0cb519 100644 --- a/dlls/hamsandwich/typetocell.h +++ b/dlls/hamsandwich/typetocell.h @@ -1,89 +1,89 @@ -/* Ham Sandwich - * Copyright 2007 - * By the AMX Mod X Development Team - * - * Ham Sandwich is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * Ham Sandwich is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Ham Sandwich; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of Ham Sandwich with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. */ -#ifndef TYPETOCELL_H -#define TYPETOCELL_H - -#include -#include "amxxmodule.h" - -#include "CVector.h" - -#include "hook.h" -#include "forward.h" - -#include "ham_const.h" -#include "ham_utils.h" - - - -inline cell TypeToCell(const float& value) -{ - return amx_ftoc2(value); -} -inline cell TypeToCell(const float*& value) -{ - return amx_ftoc2(*value); -} - -inline cell TypeToCell(const Vector*& value) -{ - return reinterpret_cast(value); -} -inline cell TypeToCell(const int& value) -{ - return value; -} - -inline cell TypeToCell(const edict_t*& value) -{ - if (value == NULL) - { - return -1; - } - - return ENTINDEX_NEW(value); -} - -inline cell TypeToCell(const entvars_t*& value) -{ - if (value == NULL) - { - return -1; - } - - return ENTINDEX_NEW(value->pContainingEntity); -} - -inline cell TypeToCell(const HLBaseEntity*& value) -{ - return PrivateToIndex(reinterpret_cast(value)); -} - - -#endif +#ifndef TYPETOCELL_H +#define TYPETOCELL_H + +#include +#include "amxxmodule.h" + +#include "CVector.h" + +#include "hook.h" +#include "forward.h" + +#include "ham_const.h" +#include "ham_utils.h" + + + +inline cell TypeToCell(const float& value) +{ + return amx_ftoc2(value); +} +inline cell TypeToCell(const float*& value) +{ + return amx_ftoc2(*value); +} + +inline cell TypeToCell(const Vector*& value) +{ + return reinterpret_cast(value); +} +inline cell TypeToCell(const int& value) +{ + return value; +} + +inline cell TypeToCell(const edict_t*& value) +{ + if (value == NULL) + { + return -1; + } + + return ENTINDEX_NEW(value); +} + +inline cell TypeToCell(const entvars_t*& value) +{ + if (value == NULL) + { + return -1; + } + + return ENTINDEX_NEW(value->pContainingEntity); +} + +inline cell TypeToCell(const HLBaseEntity*& value) +{ + return PrivateToIndex(reinterpret_cast(value)); +} + + +#endif diff --git a/plugins/include/ham_const.inc b/plugins/include/ham_const.inc index 27f9e0fb..f9ce0bd4 100644 --- a/plugins/include/ham_const.inc +++ b/plugins/include/ham_const.inc @@ -1,1129 +1,3751 @@ -#if defined _ham_const_included - #endinput -#endif -#define _ham_const_included +#if defined _ham_const_included + #endinput +#endif +#define _ham_const_included + +/** + * Ham return types. + * - + * Return these from hooks to disable calling the target function. + * Numbers match up with fakemeta's FMRES_* for clarity. They are interchangable. + * 0 (or no return) is also interpretted as HAM_IGNORED. + */ +#define HAM_IGNORED 1 /**< Calls target function, returns normal value */ +#define HAM_HANDLED 2 /**< Tells the module you did something, still calls target function and returns normal value */ +#define HAM_OVERRIDE 3 /**< Still calls the target function, but returns whatever is set with SetHamReturn*() */ +#define HAM_SUPERCEDE 4 /**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */ + +/** + * A few notes about all of the following functions: + * - Not all functions will do as you expect on all mods. + * If a function does not do what you would believe it should + * DO NOT file a bug report, you will be ignored. + * + * - Passing invalid parameters has potential to crash the server + * So be careful, and adequately test! + * + * - All functions take (and pass) a "this" index as the first param. + * This is the entity from which the function is being executed on. + * + * - All functions and forwards (eg: {Register,Execute}Ham[B]) require + * the mod to have the pev and base keys in addition to the function + * keys for the corresponding mod/operating system in hamdata.ini + * + * - Some functions that return booleans may need to be logically ANDed + * to get the results desired. e.g: if (ExecuteHam(Ham_TS_IsObjective, this) & 0x0000FFFF != 0) { // true.. } + * because the module will return the full integer value. + */ + +enum Ham +{ + /** + * Description: This is typically called whenever an entity is created. + * It is the virtual equivilent of spawn from the engine. + * Some mods call this on player spawns too. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Spawn, this); + */ + Ham_Spawn = 0, -/** - * Ham return types. - * - - * Return these from hooks to disable calling the target function. - * Numbers match up with fakemeta's FMRES_* for clarity. They are interchangable. - * 0 (or no return) is also interpretted as HAM_IGNORED. - */ -#define HAM_IGNORED 1 /**< Calls target function, returns normal value */ -#define HAM_HANDLED 2 /**< Tells the module you did something, still calls target function and returns normal value */ -#define HAM_OVERRIDE 3 /**< Still calls the target function, but returns whatever is set with SetHamReturn*() */ -#define HAM_SUPERCEDE 4 /**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */ + /** + * Description: This is typically called on map change. + * This will typically precache all assets required by the entity. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Precache, this); + */ + Ham_Precache, -/** - * A few notes about all of the following functions: - * - Not all functions will do as you expect on all mods. - * If a function does not do what you would believe it should - * DO NOT file a bug report, you will be ignored. - * - * - Passing invalid parameters has potential to crash the server - * So be careful, and adequately test! - * - * - All functions take (and pass) a "this" index as the first param. - * This is the entity from which the function is being executed on. - * - * - All functions and forwards (eg: {Register,Execute}Ham[B]) require - * the mod to have the pev and base keys in addition to the function - * keys for the corresponding mod/operating system in hamdata.ini - * - * - Some functions that return booleans may need to be logically ANDed - * to get the results desired. e.g: if (ExecuteHam(Ham_TS_IsObjective, this) & 0x0000FFFF != 0) { // true.. } - * because the module will return the full integer value. - */ + /** + * Description: Typically this is similar to an engine keyvalue call. + * Use the kvd natives from fakemeta to handle the kvd_handle passed. + * NOTE: Do not pass handle 0 to this! Use get_kvd_handle(0) from fakemeta instead! + * Forward params: function(this, kvd_handle); + * Return type: None. + * Execute params: ExecuteHam(Ham_Keyvalue, this, kvd_handle); + */ + Ham_Keyvalue, -enum Ham -{ - /** - * Description: This is typically called whenever an entity is created. - * It is the virtual equivilent of spawn from the engine. - * Some mods call this on player spawns too. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Spawn, this); - */ - Ham_Spawn = 0, - - /** - * Description: This is typically called on map change. - * This will typically precache all assets required by the entity. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Precache, this); - */ - Ham_Precache, - - /** - * Description: Typically this is similar to an engine keyvalue call. - * Use the kvd natives from fakemeta to handle the kvd_handle passed. - * NOTE: Do not pass handle 0 to this! Use get_kvd_handle(0) from fakemeta instead! - * Forward params: function(this, kvd_handle); - * Return type: None. - * Execute params: ExecuteHam(Ham_Keyvalue, this, kvd_handle); - */ - Ham_Keyvalue, - - /** - * Description: Returns flags for how an entity can be used (FCAP_* constants in hlsdk_const.inc) - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_ObjectCaps, this); - */ - Ham_ObjectCaps, - - /** - * Description: Usually called to activate some objects. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Activate, this); - */ - Ham_Activate, - - /** - * Description: Usually called after the engine call with the same name. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_SetObjectCollisionBox, this); - */ - Ham_SetObjectCollisionBox, - - /** - * Description: Returns an integer number that corresponds with what type of entity this is. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Classify, this); - */ - Ham_Classify, - - /** - * Description: Typically called when an entity dies to notify any children entities about the death. - * Forward params: function(this, idchild) - * Return type: None. - * Execute params: ExecuteHam(Ham_DeathNotice, this, idchild) - */ - Ham_DeathNotice, - - /** - * Description: Usually called whenever an entity gets attacked by a hitscan (such as a gun) weapon. - * Use the get/set tr2 natives in fakemeta to handle the traceresult data. - * Do not use a handle of 0 as a traceresult in execution, use create_tr2() from Fakemeta - * to pass a custom handle instead. (Don't forget to free the handle when you're done.) - * Forward params: function(this, idattacker, Float:damage, Float:direction[3], traceresult, damagebits) - * Return type: None. - * Execute params: ExecuteHam(Ham_TraceAttack, this, idattacker, Float:damage, Float:direction[3], tracehandle, damagebits); - */ - Ham_TraceAttack, - - /** - * Description: Usually called whenever an entity takes any kind of damage. - * Inflictor is the entity that caused the damage (such as a gun). - * Attacker is the entity that tirggered the damage (such as the gun's owner). - * Forward params: function(this, idinflictor, idattacker, Float:damage, damagebits); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits); - */ - Ham_TakeDamage, - - /** - * Description: Usually called whenever an entity gets a form of a heal. - * Forward params: function(this, Float:health, damagebits); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_TakeHealth, this, Float:health, damagebits); - */ - Ham_TakeHealth, - - /** - * Description: Normally called whenever an entity dies. - * Forward params: function(this, idattacker, shouldgib) - * Return type: None. - * Execute params: ExecuteHam(Ham_Killed, this, idattacker, shouldgib); - */ - Ham_Killed, - - /** - * Description: Normally returns the blood color of the entity. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_BloodColor, this) - */ - Ham_BloodColor, - - /** - * Description: Traces where blood should appear. - * Forward params: function(this, Float:Damage, Float:Direction[3], trace_handle, damagebits); - * Return type: None. - * Execute params: ExecuteHam(Ham_TraceBleed, this, Float:damage, Float:direction[3], trace_handle, damagebits); - */ - Ham_TraceBleed, - - /** - * Description: Returns whether an entity is activated. - * Forward params: function(this, idActivator); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_IsTriggered, this, idActivator); - */ - Ham_IsTriggered, - - /** - * Description: Returns the id of the entity if its class is derived off of CBaseMonster, -1 otherwise. - * Forward params: function(this) - * Return type: Entity. - * Execute params: ExecuteHam(Ham_MyMonsterPointer, this); - */ - Ham_MyMonsterPointer, - - /** - * Description: Returns the id of the entity if its class is derived off of CBaseSquadMonster, -1 otherwise. - * Forward params: function(this) - * Return type: Entity. - * Execute params: ExecuteHam(Ham_MySquadMonsterPointer, this); - */ - Ham_MySquadMonsterPointer, - - /** - * Description: Returns the toggle state of the entity. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_GetToggleState, this); - */ - Ham_GetToggleState, - - /** - * 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_AddPoints, + /** + * Description: Returns flags for how an entity can be used. + * Forward params: function(this) + * Return type: Integer (FCAP_* constants, see hlsdk_const.inc). + * Execute params: ExecuteHam(Ham_ObjectCaps, this); + */ + Ham_ObjectCaps, - /** - * 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_AddPointsToTeam, - - /** - * Description: Adds an item to the player's inventory. - * Forward params: function(this, idother); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_AddPlayerItem, this, idother); - */ - Ham_AddPlayerItem, - - /** - * Description: Removes an item to the player's inventory. - * Forward params: function(this, idother); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_RemovePlayerItem, this, idother); - */ - Ham_RemovePlayerItem, - - /** - * Description: Gives ammo to the entity. - * Forward params: function(this, Amount, const Name[], Max) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_GiveAmmo, this, amount, "type", max); - */ - Ham_GiveAmmo, - - /** - * Description: Unsure, I believe this is the delay between activation for an entity. - * Forward params: function(this) - * Return type: Float. - * Execute params: ExecuteHam(Ham_GetDelay, this, Float:output) - */ - Ham_GetDelay, - - /** - * Description: Whether or not the entity is moving. - * Forward params: function(this); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_IsMoving, this); - */ - Ham_IsMoving, - - /** + /** + * Description: Usually called to activate some objects. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Activate, this); + */ + Ham_Activate, + + /** + * Description: Usually called after the engine call with the same name. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SetObjectCollisionBox, this); + */ + Ham_SetObjectCollisionBox, + + /** + * Description: Returns an integer number that corresponds with what type of entity this is. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_Classify, this); + */ + Ham_Classify, + + /** + * Description: Typically called when an entity dies to notify any children entities about the death. + * Forward params: function(this, idchild) + * Return type: None. + * Execute params: ExecuteHam(Ham_DeathNotice, this, idchild) + */ + Ham_DeathNotice, + + /** + * Description: Usually called whenever an entity gets attacked by a hitscan (such as a gun) weapon. + * Use the get/set tr2 natives in fakemeta to handle the traceresult data. + * Do not use a handle of 0 as a traceresult in execution, use create_tr2() from Fakemeta + * to pass a custom handle instead. (Don't forget to free the handle when you're done.) + * Forward params: function(this, idattacker, Float:damage, Float:direction[3], traceresult, damagebits) + * Return type: None. + * Execute params: ExecuteHam(Ham_TraceAttack, this, idattacker, Float:damage, Float:direction[3], tracehandle, damagebits); + */ + Ham_TraceAttack, + + /** + * Description: Usually called whenever an entity takes any kind of damage. + * Inflictor is the entity that caused the damage (such as a gun). + * Attacker is the entity that tirggered the damage (such as the gun's owner). + * Forward params: function(this, idinflictor, idattacker, Float:damage, damagebits); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits); + */ + Ham_TakeDamage, + + /** + * Description: Usually called whenever an entity gets a form of a heal. + * Forward params: function(this, Float:health, damagebits); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_TakeHealth, this, Float:health, damagebits); + */ + Ham_TakeHealth, + + /** + * Description: Normally called whenever an entity dies. + * For Team Fortress Classic mod, see Ham_TFC_Killed. + * Forward params: function(this, idattacker, shouldgib) + * Return type: None. + * Execute params: ExecuteHam(Ham_Killed, this, idattacker, shouldgib); + */ + Ham_Killed, + + /** + * Description: Normally returns the blood color of the entity. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_BloodColor, this) + */ + Ham_BloodColor, + + /** + * Description: Traces where blood should appear. + * Forward params: function(this, Float:Damage, Float:Direction[3], trace_handle, damagebits); + * Return type: None. + * Execute params: ExecuteHam(Ham_TraceBleed, this, Float:damage, Float:direction[3], trace_handle, damagebits); + */ + Ham_TraceBleed, + + /** + * 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_IsTriggered, this, idActivator); + */ + Ham_IsTriggered, + + /** + * Description: Returns the id of the entity if its class is derived off of CBaseMonster, -1 otherwise. + * Forward params: function(this) + * Return type: Entity. + * Execute params: ExecuteHam(Ham_MyMonsterPointer, this); + */ + Ham_MyMonsterPointer, + + /** + * Description: Returns the id of the entity if its class is derived off of CBaseSquadMonster, -1 otherwise. + * Forward params: function(this) + * Return type: Entity. + * Execute params: ExecuteHam(Ham_MySquadMonsterPointer, this); + */ + Ham_MySquadMonsterPointer, + + /** + * Description: Returns the toggle state of the entity. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_GetToggleState, this); + */ + Ham_GetToggleState, + + /** + * Description: Typically adds points to the entity. + * This function is not supported by Team Fortress Classic mod. + * Forward params: function(this, points, bool:cangonegative); + * Return type: None. + * Execute params: ExecuteHam(Ham_AddPoints, this, points, bool:cangonegative); + */ + Ham_AddPoints, + + /** + * Description: Typically adds points to everybody on the entity's team. + * This function is not supported by Team Fortress Classic mod. + * Forward params: function(this, points, bool:cangonegative); + * Return type: None. + * Execute params: ExecuteHam(Ham_AddPointsToTeam, this, points, bool:cangonegative); + */ + Ham_AddPointsToTeam, + + /** + * Description: Adds an item to the player's inventory. + * Forward params: function(this, idother); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_AddPlayerItem, this, idother); + */ + Ham_AddPlayerItem, + + /** + * Description: Removes an item to the player's inventory. + * Forward params: function(this, idother); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_RemovePlayerItem, this, idother); + */ + Ham_RemovePlayerItem, + + /** + * Description: Gives ammo to the entity. + * This function is not supported for the following mods: + * Earth's Special Forces. + * Sven-Coop 4.8+, see Ham_SC_GiveAmmo instead. + * Team Fortress Classic, see Ham_TFC_GiveAmmo instead. + * Forward params: function(this, Amount, const Name[], Max) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_GiveAmmo, this, amount, "type", max); + */ + Ham_GiveAmmo, + + /** + * Description: Unsure, I believe this is the delay between activation for an entity. + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_GetDelay, this, Float:output) + */ + Ham_GetDelay, + + /** + * Description: Whether or not the entity is moving. + * Forward params: function(this); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_IsMoving, this); + */ + Ham_IsMoving, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_OverrideReset, this) + */ + Ham_OverrideReset, + + /** + * Description: Returns the damage decal of the entity for the damage type. + * Forward params: function(this, damagebits) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_DamageDecal, this); + */ + Ham_DamageDecal, + + /** + * Description: Sets the toggle state of the entity. + * Forward params: function(this, state) + * Return type: None. + * Execute params: ExecuteHam(Ham_SetToggleState, this, state); + */ + Ham_SetToggleState, + + /** + * Description: Not entirely sure what this does. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_StartSneaking, this); + */ + Ham_StartSneaking, + + /** + * Description: Not entirely sure what this does. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_StopSneaking, this); + */ + Ham_StopSneaking, + + /** + * Description: Not entirely sure. + * Forward params: function(this, idOn) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_OnControls, this, idOn); + */ + Ham_OnControls, + + /** + * Description: Whether or not the entity is sneaking. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_IsSneaking, this); + */ + Ham_IsSneaking, + + /** + * Description: Whether or not the entity is alive. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_IsAlive, this); + */ + Ham_IsAlive, + + /** + * Description: Whether or not the entity uses a BSP model. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_IsBSPModel, this); + */ + Ham_IsBSPModel, + + /** + * Description: Whether or not the entity can reflect gauss shots.. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ReflectGauss, this); + */ + Ham_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_HasTarget, this, strindex); + */ + Ham_HasTarget, + + /** + * Description: Whether or not the entity is in the world. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_IsInWorld, this); + */ + Ham_IsInWorld, + + /** + * Description: Whether or not the entity is a player. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_IsPlayer, this); + */ + Ham_IsPlayer, + + /** + * Description: Whether or not the entity is a net client. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_IsNetClient, this); + */ + Ham_IsNetClient, + + /** + * Description: Get the entity's team id. + * This function is not supported by Team Fortress Classic mod. + * Forward params: function(this); + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_TeamId, this, buffer[], size); + */ + Ham_TeamId, + + /** + * Description: Returns the next target of this. + * Forward params: function(this); + * Return type: Entity. + * Execute params: ExecuteHam(Ham_GetNextTarget, this); + */ + Ham_GetNextTarget, + + /** + * Description: Called whenever an entity thinks. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Think, this); + */ + Ham_Think, + + /** + * Description: Called whenever two entities touch. + * Forward params: function(this, idother); + * Return type: None. + * Execute params: ExecuteHam(Ham_Touch, this, idother); + */ + Ham_Touch, + + /** + * Description: Called whenver one entity uses another. + * Forward params: function(this, idcaller, idactivator, use_type, Float:value) + * Return type: None. + * Execute params: ExecuteHam(Ham_Use, this, idcaller, idactivator, use_type, Float:value); + */ + Ham_Use, + + /** + * Description: Normally called whenever one entity blocks another from moving. + * Forward params: function(this, idother); + * Return type: None. + * Execute params: ExecuteHam(Ham_Blocked, this, idother); + */ + Ham_Blocked, + + /** + * Description: Normally called when a map-based item respawns, such as a health kit or something. + * Forward params: function(this); + * Return type: Entity. + * Execute params: ExecuteHam(Ham_Respawn, this); + */ + Ham_Respawn, + + /** + * Description: Used in Half-Life to update a monster's owner. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_UpdateOwner, this); + */ + Ham_UpdateOwner, + + /** + * Description: Normally called whenever a barnacle grabs the entity. + * Forward params: function(this); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_FBecomeProne, this); + */ + Ham_FBecomeProne, + + /** + * Description: Returns the center of the entity. + * Forward params: function(this); + * Return type: Vector (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_Center, this, Float:output[3]); + */ + Ham_Center, + + /** + * Description: Returns the eye position of the entity. + * Forward params: function(this); + * Return type: Vector (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_EyePosition, this, Float:output[3]); + */ + Ham_EyePosition, + + /** + * Description: Returns the ear position of the entity. + * Forward params: function(this); + * Return type: Vector (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_EarPosition, this, Float:output[3]); + */ + Ham_EarPosition, + + /** + * Description: Position to shoot at. + * Forward params: function(this, Float:srcvector[3]); + * Return type: Vector (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_BodyTarget, Float:srcvector[3], Float:returnvector[3]) + */ + Ham_BodyTarget, + + /** + * Description: Returns the illumination of the entity. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_Illumination, this); + */ + Ham_Illumination, + + /** + * Description: Returns true if a line can be traced from the caller's eyes to the target. + * Forward params: function(this, idOther); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_FVisible, this, idOther); + */ + Ham_FVisible, + + /** + * 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_FVecVisible, this, const Float:origin[3]); + */ + Ham_FVecVisible, + + + /** + * Players have all the attributes of normal entities, in addition to these. + */ + + /** + * Description: Typically called every frame when a player has jump held. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Player_Jump, this); + */ + Ham_Player_Jump, + + /** + * Description: Typically called every frame when a player has duck held. + * This function is not supported in Earth's Special Forces mod. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Player_Duck, this); + */ + Ham_Player_Duck, + + /** + * Description: Typically called every frame during PlayerPreThink engine call. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Player_PreThink, this); + */ + Ham_Player_PreThink, + + /** + * Description: Typically called every frame during PlayerPostThink engine call. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Player_PostThink, this); + */ + Ham_Player_PostThink, + + /** + * Description: Returns a vector that tells the gun position. + * This function is not supported by Team Fortress Classic. + * Forward params: function(this) + * Return type: Vector (byreffed in ExecuteHam);. + * Execute params: ExecuteHam(Ham_Player_GetGunPosition, this, Float:output[3]); + */ + Ham_Player_GetGunPosition, + + /** + * Description: Whether or not the player should fade on death. + * Forward param: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Player_ShouldFadeOnDeath, this); + */ + Ham_Player_ShouldFadeOnDeath, + + /** + * Description: Called whenever an impulse command is executed. + * Forward param: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Player_ImpulseComands, this); + */ + Ham_Player_ImpulseCommands, + + /** + * Description: Updates the client's data for hud changes (such as ammo). Usually called every frame. + * This function is not supported by Team Fortress Classic mod. + * Forward param: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Player_UpdateClientData, this); + */ + Ham_Player_UpdateClientData, + + + /** + * 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_Item_AddToPlayer, + + /** + * Description: Unsure. + * Forward params: function(this, idOriginal); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Item_AddDuplicate, this, idOriginal); + */ + Ham_Item_AddDuplicate, + + /** + * Description: Whether or not this entity can be deployed. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Item_CanDeploy, this); + */ + Ham_Item_CanDeploy, + + /** + * Description: Deploys the entity (usually a weapon). + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Item_Deploy, this); + */ + Ham_Item_Deploy, + + /** + * Description: Whether or not the entity can be holstered. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Item_CanHolster, this); + */ + Ham_Item_CanHolster, + + /** + * Description: Whether or not the entity (usually weapon) can be holstered. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Item_Holster, this); + */ + Ham_Item_Holster, + + /** + * Description: Updates the HUD info about this item. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_UpdateItemInfo, this); + */ + Ham_Item_UpdateItemInfo, + + /** + * Description: Called each frame for an item, normally only on active items. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Item_PreFrame, this); + */ + Ham_Item_PreFrame, + + /** + * Description: Called each frame for an item, normally only on active items. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Item_PostFrame, this); + */ + Ham_Item_PostFrame, + + /** + * Description: Called when an item gets dropped, normally on death only. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Item_Drop, this); + */ + Ham_Item_Drop, + + /** + * Description: Normally called when an item gets deleted. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Item_Kill, this); + */ + Ham_Item_Kill, + + /** + * Description: Called when an entity starts being attached to (normally invisible and "following") a player. + * Forward params: function(this, idPlayer) + * Return type: None. + * Execute params: ExecuteHam(Ham_Item_AttachToPlayer, this, idPlayer) + */ + Ham_Item_AttachToPlayer, + + /** + * Description: Returns the ammo index of the item. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_Item_PrimaryAmmoIndex, this); + */ + Ham_Item_PrimaryAmmoIndex, + + /** + * Description: Returns the secondary ammo index of the item. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_Item_SecondaryAmmoIndex, this); + */ + Ham_Item_SecondaryAmmoIndex, + + /** + * Description: Updates item data for the client. + * Forward params: function(this, idPlayer) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_Item_UpdateClientData, this, idPlayer); + */ + Ham_Item_UpdateClientData, + + /** + * Description: Returns the entity index if the item is a weapon, -1 otherwise. + * Forward params: function(this) + * Return type: Entity. + * Execute Params: ExecuteHam(Ham_Item_GetWeaponPtr, this) + */ + Ham_Item_GetWeaponPtr, + + /** + * Description: Returns the item slot for the item. + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_Item_ItemSlot, this) + */ + Ham_Item_ItemSlot, + + + /** + * Weapons have all the attributes to Ham_Item_*, in addition to these. + */ + + /** + * Description: Gets ammo from the target weapon. + * This function is not supported in Earth's Special Forces mod. + * Forward params: function(this, idTarget) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget) + */ + Ham_Weapon_ExtractAmmo, + + /** + * Description: Gets clip ammo from the target weapon. + * This function is not supported in Earth's Special Forces mod. + * Forward params: function(this, idTarget) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget) + */ + Ham_Weapon_ExtractClipAmmo, + + /** + * 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_Weapon_AddWeapon, this); + */ + Ham_Weapon_AddWeapon, + + /** + * Description: Plays the weapon's empty sound. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Weapon_PlayEmptySound, this); + */ + Ham_Weapon_PlayEmptySound, + + /** + * Description: Sets the weapon so that it can play empty sound again. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Weapon_ResetEmptySound, this); + */ + Ham_Weapon_ResetEmptySound, + + /** + * Description: Sends an animation event for the weapon. + * This function has different versions for the following mods: + * Counter-Strike: see Ham_CS_Weapon_SendWeaponAnim. + * Team Fortress Classic: see Ham_TFC_Weapon_SendWeaponAnim. + * Day Of Defeat: see Ham_DOD_Weapon_SendWeaponAnim. + * Forward params: function(this, iAnim, skiplocal, body); + * Return type: None. + * Execute params: ExecuteHam(Ham_Weapon_SendWeaponAnim, this, iAnim, skiplocal, body); + */ + Ham_Weapon_SendWeaponAnim, + + /** + * 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_Weapon_IsUsable, this) + */ + Ham_Weapon_IsUsable, + + /** + * Description: Called when the main attack of a weapon is triggered. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Weapon_PrimaryAttack, this); + */ + Ham_Weapon_PrimaryAttack, + + /** + * Description: Called when the secondary attack of a weapon is triggered. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Weapon_SecondaryAttack, this); + */ + Ham_Weapon_SecondaryAttack, + + /** + * Description: Called when the weapon is reloaded. + * This function is not supported in Earth's Special Forces mod. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Weapon_Reload, this); + */ + Ham_Weapon_Reload, + + /** + * Description: Displays the idle animation for the weapon. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Weapon_WeaponIdle, this); + */ + Ham_Weapon_WeaponIdle, + + /** + * Description: There is no more ammo for this gun, so switch to the next best one. + * Forward params: function(this) + * Return type: None. + * ExecuteParams: ExecuteHam(Ham_Weapon_RetireWeapon, this) + */ + Ham_Weapon_RetireWeapon, + + /** + * Description: Whether or not the weapon should idle. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute Params: ExecuteHam(Ham_Weapon_ShouldWeaponIdle, this) + */ + Ham_Weapon_ShouldWeaponIdle, + + /** * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_OverrideReset, this) - */ - Ham_OverrideReset, - + * This function is not supported by Team Fortress Classic. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_Weapon_UseDecrement, this); + */ + Ham_Weapon_UseDecrement, + + /** - * Description: Returns the damage decal of the entity for the damage type. - * Forward params: function(this, damagebits) + * The following functions are specific to The Specialists. + */ + + /** + * Description: - + * Forward params: function(this, someboolvalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_TS_BreakableRespawn, this, someboolvalue); + */ + Ham_TS_BreakableRespawn, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean) + * Execute params: ExecuteHam(Ham_TS_CanUsedThroughWalls, this); + */ + Ham_TS_CanUsedThroughWalls, + + /** + * Description: Unsure - this was removed in TS 3.0 (and thus is deprecated). + * Forward params: function(this) + * Return type: Integer (I think...) + * Execute params: ExecuteHam(Ham_TS_RespawnWait, this); + */ + Ham_TS_RespawnWait, + + + /** + * The following functions are specific to Counter-Strike. + */ + + /** + * Description: This is called on a map reset for most map based entities. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_CS_Restart, this); + */ + Ham_CS_Restart, + + /** + * Description: Respawn function for players/bots only! Do not use this on non player/bot entities! + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_CS_RoundRespawn, this); + */ + Ham_CS_RoundRespawn, + + /** + * Description: Whether or not the player can drop the specified item. + * Forward params: function(this) * Return type: Integer. - * Execute params: ExecuteHam(Ham_DamageDecal, this); - */ - Ham_DamageDecal, - - /** - * Description: Sets the toggle state of the entity. - * Forward params: function(this, state) - * Return type: None. - * Execute params: ExecuteHam(Ham_SetToggleState, this, state); - */ - Ham_SetToggleState, - - /** - * Description: Not entirely sure what this does. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_StartSneaking, this); - */ - Ham_StartSneaking, + * Execute params: ExecuteHam(Ham_CS_Item_CanDrop, this); + */ + Ham_CS_Item_CanDrop, + + /** + * Description: Gets the maximum speed for whenever a player has the item deployed. + * Forward params: function(this); + * Return type: Float (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output); + */ + Ham_CS_Item_GetMaxSpeed, + /** - * Description: Not entirely sure what this does. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_StopSneaking, this); + * The following functions are specific to Day Of Defeat. */ - Ham_StopSneaking, - - /** - * Description: Not entirely sure. - * Forward params: function(this, idOn) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_OnControls, this, idOn); - */ - Ham_OnControls, - - /** - * Description: Whether or not the entity is sneaking. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsSneaking, this); - */ - Ham_IsSneaking, - - /** - * Description: Whether or not the entity is alive. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsAlive, this); - */ - Ham_IsAlive, - - /** - * Description: Whether or not the entity uses a BSP model. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsBSPModel, this); - */ - Ham_IsBSPModel, - - /** - * Description: Whether or not the entity can reflect gauss shots.. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_ReflectGauss, this); - */ - Ham_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_HasTarget, this, strindex); - */ - Ham_HasTarget, - - /** - * Description: Whether or not the entity is in the world. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsInWorld, this); - */ - Ham_IsInWorld, - - /** - * Description: Whether or not the entity is a player. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsPlayer, this); - */ - Ham_IsPlayer, - /** - * Description: Whether or not the entity is a net client. + /** + * Description: I assume this spawns players at the start of a new round. + * Forward params: function(this) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_RoundRespawn, this); + */ + Ham_DOD_RoundRespawn, + + /** + * Description: I assume this spawns entities (like func_breakables) at the start of a new round. + * Forward params: function(this) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_RoundRespawnEnt, this); + */ + Ham_DOD_RoundRespawnEnt, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: None, I think... + * Execute params: ExecuteHam(Ham_DOD_RoundStore, this); + */ + Ham_DOD_RoundStore, + + /** + * Description: Unsure. + * Forward params: function(this, someintegervalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_DOD_AreaSetIndex, this, someintegervalue) + */ + Ham_DOD_AreaSetIndex, + + /** + * Description: Unsure. + * Forward params: function(this, idPlayer) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_AreaSendStatus, this, idPlayer); + */ + Ham_DOD_AreaSendStatus, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_GetState, this); + */ + Ham_DOD_GetState, + + /** + * Description: Unsure. + * Forward params: function(this, idtarget) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_GetStateEnt, this, idtarget); + */ + Ham_DOD_GetStateEnt, + + /** + * Description: Whether or not a player can drop this item. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute Params: ExecuteHam(Ham_DOD_Item_CanDrop, this); + */ + Ham_DOD_Item_CanDrop, + + + /** + * The following functions are specific to The Team Fortress Classic. + */ + + /** + * Description: Unsure. + * Forward params: function(this, playerId) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_TFC_EngineerUse, this, playerId) + */ + Ham_TFC_EngineerUse, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_Finished, this); + */ + Ham_TFC_Finished, + + /** + * Description: Unsure. + * Forward params: function(this, grenId, Float:damage, Float:radius) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_EmpExplode, this, grenId, Float:damage, Float:radius) + */ + Ham_TFC_EmpExplode, + + /** + * Description: Unsure. + * 'damage' and 'radius' are byref'd in ExecuteHam. + * Forward params: function(this, Float:damage, Float:radius) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_CalcEmpDmgRad, this, Float:damage, Float:radius) + */ + Ham_TFC_CalcEmpDmgRad, + + /** + * Description: Unsure. + * Forward params: function(this, grenId) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_TakeEmpBlast, this, grenId); + */ + Ham_TFC_TakeEmpBlast, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_EmpRemove, this); + */ + Ham_TFC_EmpRemove, + + /** + * Description: Unsure. + * Forward params: function(this, grenId, Float:bounceMax) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_TakeConcussionBlast, this, grenId, Float:bounceMax); + */ + Ham_TFC_TakeConcussionBlast, + + /** + * Description: Unsure. + * Forward params: function(this, grenId) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_Concuss, this, grenId); + */ + Ham_TFC_Concuss, + + + /** + * The following functions are specific to Earth's Special Forces. + */ + + /** + * Description: Unsure. + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsEnvModel, this); + */ + Ham_ESF_IsEnvModel, + + /** + * Description: Unsure. + * This is available only in ESF Open Beta. + * Forward params: function(this, entityida, entityidb, Float:floata, Float:floatb, dmgbits) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ESF_TakeDamage2, this, entityida, entityidb, Float:floata, Float:floatb, dmgbits); + */ + Ham_ESF_TakeDamage2, + + + /** + * The following functions are specific to Natural Selection. + */ + + /** + * Description: Returns how many points each entity is worth. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_NS_GetPointValue, this); + */ + Ham_NS_GetPointValue, + + /** + * Description: Unsure. Probably awards this with the killing of idvictim. + * Forward params: function(this, idvictim) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_AwardKill, this, idvictim); + */ + Ham_NS_AwardKill, + + /** + * Description: Unsure, probably whenever an entity resets after a new round. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_ResetEntity, this); + */ + Ham_NS_ResetEntity, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_UpdateOnRemove, this) + */ + Ham_NS_UpdateOnRemove, + + + /** + * The following functions are specific to The Specialists. + */ + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_TS_GiveSlowMul, this) + */ + Ham_TS_GiveSlowMul, + + /** + * Description: Unsure. The second paramater is actually a char. + * Forward params: function(this, Float:someval, someotherval) + * Return type: None. + * Execute params: ExecuteHam(Ham_TS_GoSlow, this, Float:someval, someotherval) + */ + Ham_TS_GoSlow, + + /** + * Description: Probably returns true if the user is in slow mo. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_TS_InSlow, this) + */ + Ham_TS_InSlow, + + /** + * Description: Returns true if the entity is an objective. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_TS_IsObjective, this) + */ + Ham_TS_IsObjective, + + /** + * Description: Unsure. + * Forward params: function(this, bool:someval) + * Return type: None. + * Execute params: ExecuteHam(Ham_TS_EnableObjective, this, bool:someval) + */ + Ham_TS_EnableObjective, + + /** + * Description: Probably called when the engine call to OnEntFreePrivateData is called (the entity destructor.) + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_TS_OnEntFreePrivateData, this) + */ + Ham_TS_OnFreeEntPrivateData, + + /** + * Description: Probably called when the engine call to ShouldCollide is called. + * Forward params: function(this, otherEntity) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_TS_ShouldCollide, this, otherEntity) + */ + Ham_TS_ShouldCollide, + + + /** + * LATE ADDITIONS (2011) + */ + + /** + * Description: Turns a monster towards its ideal_yaw. + * Forward params: function(this, speed); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ChangeYaw, this, speed); + */ + Ham_ChangeYaw, + + /** + * Description: Returns if monster has human gibs. * Forward params: function(this); * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_IsNetClient, this); + * Execute params: ExecuteHam(Ham_HasHumanGibs, this); */ - Ham_IsNetClient, + Ham_HasHumanGibs, - /** - * Description: Get the entity's team id. - * Forward params: function(this); - * Return type: String (string length returned and string byref'd in ExecuteHam). - * Execute params: ExecuteHam(Ham_TeamId, this, buffer[], size); - */ - Ham_TeamId, - /** - * Description: Returns the next target of this. + * Description: Returns if monster has alien gibs. * Forward params: function(this); - * Return type: Entity. - * Execute params: ExecuteHam(Ham_GetNextTarget, this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_HasAlienGibs, this); */ - Ham_GetNextTarget, - + Ham_HasAlienGibs, + /** - * Description: Called whenever an entity thinks. - * Forward params: function(this) + * Description: Slowly fades a entity out, then removes it. + * Using this on player will crash your server. + * Forward params: function(this); * Return type: None. - * Execute params: ExecuteHam(Ham_Think, this); + * Execute params: ExecuteHam(Ham_FadeMonster, this); */ - Ham_Think, - + Ham_FadeMonster, + /** - * Description: Called whenever two entities touch. + * Description: Create some gore and get rid of a monster's model. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_GibMonster, this); + */ + Ham_GibMonster, + + /** + * Description: Called when monster dies and prepares its entity to become a corpse. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_BecomeDead, this); + */ + Ham_BecomeDead, + + /** + * Description: Checks relation ship between two monsters. * Forward params: function(this, idother); - * Return type: None. - * Execute params: ExecuteHam(Ham_Touch, this, idother); + * Return type: Integer (R_* constants, see HLDSK). + * Execute params: ExecuteHam(Ham_IRelationship, this, idother); */ - Ham_Touch, - - /** - * Description: Called whenver one entity uses another. - * Forward params: function(this, idcaller, idactivator, use_type, Float:value) - * Return type: None. - * Execute params: ExecuteHam(Ham_Use, this, idcaller, idactivator, use_type, Float:value); - */ - Ham_Use, - - /** - * Description: Normally called whenever one entity blocks another from moving. - * Forward params: function(this, idother); - * Return type: None. - * Execute params: ExecuteHam(Ham_Blocked, this, idother); - */ - Ham_Blocked, - - /** - * Description: Normally called when a map-based item respawns, such as a health kit or something. - * Forward params: function(this); - * Return type: Entity. - * Execute params: ExecuteHam(Ham_Respawn, this); - */ - Ham_Respawn, - - /** - * Description: Used in Half-Life to update a monster's owner. - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_UpdateOwner, this); - */ - Ham_UpdateOwner, - - /** - * Description: Normally called whenever a barnacle grabs the entity. - * Forward params: function(this); - * Return type: Integer. - * Execute params: ExecuteHam(Ham_FBecomeProne, this); - */ - Ham_FBecomeProne, - - /** - * Description: Returns the center of the entity. - * Forward params: function(this); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_Center, this, Float:output[3]); - */ - Ham_Center, - - /** - * Description: Returns the eye position of the entity. - * Forward params: function(this); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_EyePosition, this, Float:output[3]); - */ - Ham_EyePosition, + Ham_IRelationship, /** - * Description: Returns the ear position of the entity. + * Description: Called when monster is about to emit pain sound. + * Not guaranteed to actually emit sound. (random, time, etc..) * Forward params: function(this); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_EarPosition, this, Float:output[3]); + * Return type: None. + * Execute params: ExecuteHam(Ham_PainSound, this); */ - Ham_EarPosition, - + Ham_PainSound, + /** - * Description: Position to shoot at. - * Forward params: function(this, Float:srcvector[3]); - * Return type: Vector (byref'd in Execute). - * Execute params: ExecuteHam(Ham_BodyTarget, Float:srcvector[3], Float:returnvector[3]) + * Description: Prints debug information about monster to console. (state, activity, and other) + * This function is called by impulse 103. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_ReportAIState, this); */ - Ham_BodyTarget, - + Ham_ReportAIState, + /** - * Description: Returns the illumination of the entity. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Illumination, this); + * Description: Called when monster has died. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_MonsterInitDead, this); */ - Ham_Illumination, - + Ham_MonsterInitDead, + /** - * Description: Unsure, I assume it is whether or not the other entity is visible to this entity. + * Description: Function to find enemies or food by sight. + * distance is maximum distance (in units) monster can see. + * Forward params: function(this, distance); + * Return type: None. + * Execute params: ExecuteHam(Ham_Look, this, distance); + */ + Ham_Look, + + /** + * Description: This functions searches the link list whose head is the caller's m_pLink field. + * Forward params: function(this); + * Return type: Integer (entity). + * Execute params: ExecuteHam(Ham_BestVisibleEnemy, this); + */ + Ham_BestVisibleEnemy, + + /** + * Description: Returns true if the passed ent is in the caller's forward view cone. + * The dot product is performed in 2d, making the view cone infinitely tall. * Forward params: function(this, idOther); * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_FVisible, this, idOther); + * Execute params: ExecuteHam(Ham_FInViewCone, this, idOther); */ - Ham_FVisible, - + Ham_FInViewCone, + /** - * Description: Unsure, I assume it is whether or not the target vector is visible to this entity. + * Description: Returns true if the passed ent is in the caller's forward view cone. + * The dot product is performed in 2d, making the view cone infinitely tall. * Forward params: function(this, const Float:origin[3]); * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_FVecVisible, this, const Float:origin[3]); + * Execute params: ExecuteHam(Ham_FVecInViewCone, this, const Float:origin[3]); */ - Ham_FVecVisible, - - - /** - * Players have all the attributes of normal entities, in addition to these. - */ - - /** - * Description: Typically called every frame when a player has jump held. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_Jump, this); - */ - Ham_Player_Jump, + Ham_FVecInViewCone, /** - * Description: Typically called every frame when a player has duck held. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_Duck, this); + * Description: Determines the best type of death animation to play. + * Forward params: function(this); + * Return type: Integer (ACT_* constants, see HLDSK. It might different depending the mod). + * Execute params: ExecuteHam(Ham_GetDeathActivity, this); */ - Ham_Player_Duck, - - /** - * Description: Typically called every frame during PlayerPreThink engine call. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_PreThink, this); - */ - Ham_Player_PreThink, + Ham_GetDeathActivity, + /** - * Description: Typically called every frame during PlayerPostThink engine call. + * The following functions are not supported by Counter-Strike, The Specialists and Natural Selection mods + */ + + /** + * Description: Runs core AI functions. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. * Forward params: function(this) * Return type: None. - * Execute params: ExecuteHam(Ham_Player_PostThink, this); + * Execute params: ExecuteHam(Ham_RunAI, this); */ - Ham_Player_PostThink, - + Ham_RunAI, + /** - * Description: Returns a vector that tells the gun position. + * Description: Calls out to core AI functions and handles this monster's specific animation events. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_MonsterThink, this); + */ + Ham_MonsterThink, + + /** + * Description: After a monster is spawned, it needs to be dropped into the world, checked for mobility problems + * and put on the proper path, if any. This function does all of those things after the monster spawns. + * Any initialization that should take place for all monsters goes here. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_MonsterInit, this); + */ + Ham_MonsterInit, + + /** + * Description: Check validity of a straight move through space. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, const Float:start[3], const Float:end[3], target, Float:dist) + * Return type: Integer (See LOCALMOVE_* constants). + * Execute params: ExecuteHam(Ham_CheckLocalMove, this, const Float:start[3], const Float:end[3], target, Float:dist); + */ + Ham_CheckLocalMove, + + /** + * Description: Takes a single step towards the next ROUTE location. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:interval) + * Return type: None. + * Execute params: ExecuteHam(Ham_Move, this, Float:interval); + */ + Ham_Move, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, targetEnt, const Float:dir[3], Float:interval) + * Return type: None. + * Execute params: ExecuteHam(Ham_MoveExecute, this, targetEnt, const Float:dir[3], Float:interval); + */ + Ham_MoveExecute, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:waypointDist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ShouldAdvanceRoute, this, Float:waypointDist); + */ + Ham_ShouldAdvanceRoute, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this) + * Return type: Integer (ACT_* constants, see HLDSK. It might different depending the mod). + * Execute params: ExecuteHam(Ham_GetStoppedActivity, this); + */ + Ham_GetStoppedActivity, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_Stop, this); + */ + Ham_Stop, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CheckRangeAttack1, this, Float:dot, Float:dist); + */ + Ham_CheckRangeAttack1, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CheckRangeAttack2, this, Float:dot, Float:dist); + */ + Ham_CheckRangeAttack2, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CheckMeleeAttack1, this, Float:dot, Float:dist); + */ + Ham_CheckMeleeAttack1, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CheckMeleeAttack2, this, Float:dot, Float:dist); + */ + Ham_CheckMeleeAttack2, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: None. + * Execute params: ExecuteHam(Ham_ScheduleChange, this, Float:dot, Float:dist); + */ + Ham_ScheduleChange, + + /** + * 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. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, bool:disregardState, interruptLevel); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CanPlaySequence, this, bool:disregardState, interruptLevel); + */ + Ham_CanPlaySequence, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, bool:disregardState); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CanPlaySentence, this, bool:disregardState); + */ + Ham_CanPlaySentence, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, const sentence[], Float:duration, Float:volume, Float:attenuation); + * Return type: None. + * Execute params: ExecuteHam(Ham_PlaySentence, this, const sentence[], Float:duration, Float:volume, Float:attenuation); + */ + Ham_PlaySentence, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * 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_PlayScriptedSentence, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SentenceStop, this); + */ + Ham_SentenceStop, + + /** + * Description: Surveys the Conditions information available and finds the best new state for a monster. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Integer (MONSTERSTATE_* constants, see HLDSK). + * Execute params: ExecuteHam(Ham_GetIdealState, this); + */ + Ham_GetIdealState, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, newActivity); + * Return type: None. + * Execute params: ExecuteHam(Ham_SetActivity, this, newActivity); + */ + Ham_SetActivity, + + /** + * Description: Part of the condition collection process gets and stores data and conditions + * pertaining to a monster's enemy. Returns TRUE if Enemy LKP was updated. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, idEnemy); + * Return type: None. + * Execute params: ExecuteHam(Ham_CheckEnemy, this, idEnemy); + */ + Ham_CheckEnemy, + + /** + * Description: Tries to overcome local obstacles by triangulating a path around them. + * 'dist' is how far the obstruction that we are trying to triangulate around is from the monster. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, const Float:start[3], const Float:end[3], Float:dist, targetEnt, Float:apex[3]); + * Return type: None. + * Execute params: ExecuteHam(Ham_FTriangulate, this, const Float:start[3], const Float:end[3], Float:dist, targetEnt, Float:apex[3]); + */ + Ham_FTriangulate, + + /** + * Description: Allows each sequence to have a different turn rate associated with it. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SetYawSpeed, this); + */ + Ham_SetYawSpeed, + + /** + * Description: Tries to build a route as close to the target as possible, even if there isn't a path to the final point. + * If supplied, search will return a node at least as far away as MinDist from vecThreat, but no farther than minDist. + * If maxDist isn't supplied, it defaults to a reasonable value. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_BuildNearestRoute, this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist); + */ + Ham_BuildNearestRoute, + + /** + * Description: Tries to find a nearby node that will hide the caller from its enemy. + * If supplied, search will return a node at least as far away as MinDist from vecThreat, but no farther than minDist. + * If maxDist isn't supplied, it defaults to a reasonable value. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_FindCover, this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist); + */ + Ham_FindCover, + + /** + * Description: Default cover radius. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Float. + * Execute params: ExecuteHam(Ham_CoverRadius, this); + */ + Ham_CoverRadius, + + /** + * Description: Prequalifies a monster to do more fine checking of potential attacks. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_FCanCheckAttacks, this); + */ + Ham_FCanCheckAttacks, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_CheckAmmo, this); + */ + Ham_CheckAmmo, + + /** + * Description: Before a set of conditions is allowed to interrupt a monster's schedule, this function removes + * conditions that we have flagged to interrupt the current schedule, but may not want to interrupt + * the schedule every time. (Pain, for instance) + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_IgnoreConditions, this); + */ + Ham_IgnoreConditions, + + /** + * Description: Tells use whether or not the monster cares about the type of Hint Node given. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, hint); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_FValidateHintType, this, hint); + */ + Ham_FValidateHintType, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_FValidateHintType, this); + */ + Ham_FCanActiveIdle, + + /** + * Description: Returns a bit mask indicating which types of sounds this monster regards. + * In the base class implementation, monsters care about all sounds, but no scents. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ISoundMask, this); + */ + Ham_ISoundMask, + + /** + * Description: - + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Float. + * Execute params: ExecuteHam(Ham_HearingSensitivity, this); + */ + Ham_HearingSensitivity, + + /** + * Description: Called by Barnacle victims when the barnacle pulls their head into its mouth. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this, idBarnacle); + * Return type: Float. + * Execute params: ExecuteHam(Ham_BarnacleVictimBitten, this, idBarnacle); + */ + Ham_BarnacleVictimBitten, + + /** + * Description: Called by barnacle victims when the host barnacle is killed. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: Float. + * Execute params: ExecuteHam(Ham_BarnacleVictimReleased, this); + */ + Ham_BarnacleVictimReleased, + + /** + * Description: Runs after conditions are collected and before scheduling code is run. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_PrescheduleThink, this); + */ + Ham_PrescheduleThink, + + /** + * Description: Plays death sounds. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_DeathSound, this); + */ + Ham_DeathSound, + + /** + * Description: Plays alert sounds. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_AlertSound, this); + */ + Ham_AlertSound, + + /** + * Description: Plays idle sounds. + * This function is not supported by Counter-Strike, The Specialists and Natural Selection mods. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_IdleSound, this); + */ + Ham_IdleSound, + + /** + * Description: This should stop a monster following a target. + * Forward params: function(this, bool:clearSchedule) + * Return type: None. + * Execute Params: ExecuteHam(Ham_StopFollowing, this, bool:clearSchedule); + */ + Ham_StopFollowing, + + + /** + * The following functions are specific to Counter-Strike. + */ + + /** + * Description: Sends an animation event for the weapon. skiplocal is 1 if client is predicting weapon animations. + * Forward params: function(this, anim, skiplocal); + * Return type: None. + * Execute params: ExecuteHam(Ham_CS_Weapon_SendWeaponAnim, this, anim, skiplocal); + */ + Ham_CS_Weapon_SendWeaponAnim, + + /** + * Description: Resets the player's max speed. + * Forward params: function(this); + * Return type: None. + * Execute params: ExecuteHam(Ham_CS_Player_ResetMaxSpeed, this); + */ + Ham_CS_Player_ResetMaxSpeed, + + /** + * Description: Whether or not the player is a bot. + * Forward params: function(this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_CS_Player_IsBot, this); + */ + Ham_CS_Player_IsBot, + + /** + * Description: Returns a vector that tells the autoaim direction. + * Set crosshair position to point to enemey if sv_aim is 1. + * Forward params: function(this, Float:delta) * Return type: Vector, byreffed in execute. - * Execute params: ExecuteHam(Ham_Player_GetGunPosition, this, Float:output[3]); + * Execute params: ExecuteHam(Ham_CS_Player_GetAutoaimVector, this, Float:delta, Float:output[3]); */ - Ham_Player_GetGunPosition, - - /** - * Description: Whether or not the player should fade on death. - * Forward param: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Player_ShouldFadeOnDeath, this); - */ - Ham_Player_ShouldFadeOnDeath, + Ham_CS_Player_GetAutoaimVector, /** - * Description: Called whenever an impulse command is executed. - * Forward param: function(this) + * Description: Whether or not the player is being flashing. (flashbang grenade explosion) + * blindTime is the time you are considered as being blind. (holdTime * 0.33). + * Forward params: function(this, Float:blindTime, Float:duration, Float:holdTime, alpha); * Return type: None. - * Execute params: ExecuteHam(Ham_Player_ImpulseComands, this); + * Execute params: ExecuteHam(Ham_CS_Player_Blind, this, Float:blindTime, Float:duration, Float:holdTime, alpha); */ - Ham_Player_ImpulseCommands, - - /** - * Description: Updates the client's data for hud changes (such as ammo). Usually called every frame. - * Forward param: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Player_UpdateClientData, this); - */ - Ham_Player_UpdateClientData, - - /** - * 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_Item_AddToPlayer, + Ham_CS_Player_Blind, /** - * Description: Unsure. - * Forward params: function(this, idOriginal); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_AddDuplicate, this, idOriginal); - */ - Ham_Item_AddDuplicate, - - /** - * Description: Whether or not this entity can be deployed. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_CanDeploy, this); - */ - Ham_Item_CanDeploy, - - /** - * Description: Deploys the entity (usually a weapon). - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_Deploy, this); - */ - Ham_Item_Deploy, - - /** - * Description: Whether or not the entity can be holstered. - * Forward params: function(this); - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_CanHolster, this); - */ - Ham_Item_CanHolster, - - /** - * Description: Whether or not the entity (usually weapon) can be holstered. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Item_Holster, this); - */ - Ham_Item_Holster, - - /** - * Description: Updates the HUD info about this item. - * Forward params: function(this); + * Description: Whether or not the player is touching a weapon on the ground. + * Forward params: function(this, entityid); * Return type: None. - * Execute params: ExecuteHam(Ham_UpdateItemInfo, this); + * Execute params: ExecuteHam(Ham_CS_Player_OnTouchingWeapon, this, entityid); */ - Ham_Item_UpdateItemInfo, - - /** - * Description: Called each frame for an item, normally only on active items. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_PreFrame, this); - */ - Ham_Item_PreFrame, - - /** - * Description: Called each frame for an item, normally only on active items. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_PostFrame, this); - */ - Ham_Item_PostFrame, - - /** - * Description: Called when an item gets dropped, normally on death only. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_Drop, this); - */ - Ham_Item_Drop, - - /** - * Description: Normally called when an item gets deleted. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_Drop, this); - */ - Ham_Item_Kill, - - /** - * Description: Called when an entity starts being attached to (normally invisible and "following") a player. - * Forward params: function(this, idPlayer) - * Return type: None. - * Execute params: ExecuteHam(Ham_Item_AttachToPlayer, this, idPlayer) - */ - Ham_Item_AttachToPlayer, - - /** - * Description: Returns the ammo index of the item. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Item_PrimaryAmmoIndex, this); - */ - Ham_Item_PrimaryAmmoIndex, - - /** - * Description: Returns the secondary ammo index of the item. - * Forward params: function(this) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Item_SecondaryAmmoIndex, this); - */ - Ham_Item_SecondaryAmmoIndex, + Ham_CS_Player_OnTouchingWeapon, + /** - * Description: Updates item data for the client. - * Forward params: function(this, idPlayer) - * Return type: Integer. - * Execute params: ExecuteHam(Ham_Item_UpdateClientData, this, idPlayer); + * The following functions are specific to Day Of Defeat. */ - Ham_Item_UpdateClientData, - - /** - * Description: Returns the entity index if the item is a weapon, -1 otherwise. - * Forward params: function(this) - * Return type: Entity. - * Execute Params: ExecuteHam(Ham_Item_GetWeaponPtr, this) - */ - Ham_Item_GetWeaponPtr, - - /** - * Description: Returns the item slot for the item. - * Forward params: function(this) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_Item_ItemSlot, this) - */ - Ham_Item_ItemSlot, - - - /** - * Weapons have all the attributes to Ham_Item_*, in addition to these. - */ - - /** - * Description: Gets ammo from the target weapon. - * Forward params: function(this, idTarget) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget) - */ - Ham_Weapon_ExtractAmmo, - /** - * Description: Gets clip ammo from the target weapon. - * Forward params: function(this, idTarget) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_Weapon_ExtractAmmo, this, idTarget) - */ - Ham_Weapon_ExtractClipAmmo, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_AddWeapon, this); - */ - Ham_Weapon_AddWeapon, - - /** - * Description: Plays the weapon's empty sound. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_PlayEmptySound, this); - */ - Ham_Weapon_PlayEmptySound, - - /** - * Description: Sets the weapon so that it can play empty sound again. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_ResetEmptySound, this); - */ - Ham_Weapon_ResetEmptySound, - - /** - * Description: Sends an animation event for the weapon. - * Forward params: function(this, iAnim, skiplocal, body); - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_SendWeaponAnim, this, iAnim, skiplocal, body); - */ - Ham_Weapon_SendWeaponAnim, - - /** - * Description: Whether or not the weapon is usable (has ammo, etc.) - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_IsUsable, this) - */ - Ham_Weapon_IsUsable, - - /** - * Description: Called when the main attack of a weapon is triggered. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_PrimaryAttack, this); - */ - Ham_Weapon_PrimaryAttack, - - /** - * Description: Called when the secondary attack of a weapon is triggered. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_SecondaryAttack, this); - */ - Ham_Weapon_SecondaryAttack, - - /** - * Description: Called when the weapon is reloaded. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_Reload, this); - */ - Ham_Weapon_Reload, - - /** - * Description: Displays the idle animation for the weapon. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_Weapon_WeaponIdle, this); - */ - Ham_Weapon_WeaponIdle, - - /** - * Description: There is no more ammo for this gun, so switch to the next best one. - * Forward params: function(this) - * Return type: None. - * ExecuteParams: ExecuteHam(Ham_Weapon_RetireWeapon, this) - */ - Ham_Weapon_RetireWeapon, - - /** - * Description: Whether or not the weapon should idle. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute Params: ExecuteHam(Ham_Weapon_ShouldWeaponIdle, this) - */ - Ham_Weapon_ShouldWeaponIdle, - - /** - * Description: Not sure. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_Weapon_UseDecrement, this); - */ - Ham_Weapon_UseDecrement, - /** * Description: - - * Forward params: function(this, someboolvalue) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_BreakableRespawn, this, someboolvalue); + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_SetScriptReset, this); */ - Ham_TS_BreakableRespawn, + Ham_DOD_SetScriptReset, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_Item_SpawnDeploy, this); + */ + Ham_DOD_Item_SpawnDeploy, + + /** + * Description: - + * Forward params: function(this, Float:someValue) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_Item_SetDmgTime, this, Float:someValue); + */ + Ham_DOD_Item_SetDmgTime, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_Item_DropGren, this); + */ + Ham_DOD_Item_DropGren, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute Params: ExecuteHam(Ham_DOD_Weapon_IsUseable, this); + */ + Ham_DOD_Weapon_IsUseable, + + /** + * Description: - + * Forward params: function(this, Float:accuracyFactor, idother, shared_rand) + * Return type: Vector, byreffed in execute. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_Aim, this, Float:accuracyFactor, idother, shared_rand, Float:output[3]); + */ + Ham_DOD_Weapon_Aim, + + /** + * Description: - + * Forward params: function(this, Float:accuracyFactor, idother) + * Return type: Float. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_flAim, this, Float:accuracyFactor, idother); + */ + Ham_DOD_Weapon_flAim, + + /** + * Description: - + * Forward params: function(this, Float:amount, targetEnt) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_RemoveStamina, this, Float:amount, targetEnt); + */ + Ham_DOD_Weapon_RemoveStamina, + + /** + * Description: - + * Forward params: function(this, fov) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_ChangeFOV, this, fov); + */ + Ham_DOD_Weapon_ChangeFOV, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_ZoomOut, this); + */ + Ham_DOD_Weapon_ZoomOut, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_ZoomIn, this); + */ + Ham_DOD_Weapon_ZoomIn, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_GetFOV, this); + */ + Ham_DOD_Weapon_GetFOV, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute Params: ExecuteHam(Ham_DOD_Weapon_IsWaterSniping, this); + */ + Ham_DOD_Weapon_PlayerIsWaterSniping, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_UpdateZoomSpeed, this); + */ + Ham_DOD_Weapon_UpdateZoomSpeed, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute Params: ExecuteHam(Ham_DOD_Weapon_Special, this); + */ + Ham_DOD_Weapon_Special, + + + /** + * The following functions are specific to Team Fortress Classic. + */ + + /** + * Description: Get the item name. + * Forward params: function(this, const buffer[]); + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_TFC_DB_GetItemName, this, buffer[], size); + */ + Ham_TFC_DB_GetItemName, + + /** + * Description: This entity is exploding, or otherwise needs to inflict damage upon entities within a certain range. + * Forward params: function(this, inflictorId, attackerId, Float:damage, classIgnore, bitsDamageType) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_RadiusDamage, this, inflictorId, attackerId, Float:damage, classIgnore, bitsDamageType); + */ + Ham_TFC_RadiusDamage, + + /** + * Description: This entity is exploding, or otherwise needs to inflict damage upon entities within a certain range. + * Forward params: function(this, const Float:source[3], inflictorId, attackerId, Float:damage, classIgnore, bitsDamageType) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_RadiusDamage2, this, const Float:source[3], inflictorId, attackerId, Float:damage, classIgnore, bitsDamageType); + */ + Ham_TFC_RadiusDamage2, + + + /** + * The following functions are specific to Earth's Special Forces. + */ + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsFighter, this); + */ + Ham_ESF_IsFighter, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsBuddy, this); + */ + Ham_ESF_IsBuddy, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, const char sample[], somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_EmitSound, this, const sample[], somevalue); + */ + Ham_ESF_EmitSound, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_EmitNullSound, this, somevalue); + */ + Ham_ESF_EmitNullSound, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, someentid, somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_IncreaseStrength, this, someentid, somevalue); + */ + Ham_ESF_IncreaseStrength, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_IncreasePL, this, somevalue); + */ + Ham_ESF_IncreasePL, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetPowerLevel, this, somevalue); + */ + Ham_ESF_SetPowerLevel, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetMaxPowerLevel, this, somevalue); + */ + Ham_ESF_SetMaxPowerLevel, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, anim) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StopAniTrigger, this, anim); + */ + Ham_ESF_StopAniTrigger, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StopFly, this); + */ + Ham_ESF_StopFly, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_HideWeapon, this); + */ + Ham_ESF_HideWeapon, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_HideWeapon, this, somevalue); + */ + Ham_ESF_ClientRemoveWeapon, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, const model[]) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SendClientsCustomModel, this, const model[]); + */ + Ham_ESF_SendClientsCustomModel, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanTurbo, this); + */ + Ham_ESF_CanTurbo, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanPrimaryFire, this); + */ + Ham_ESF_CanPrimaryFire, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanSecondaryFire, this); + */ + Ham_ESF_CanSecondaryFire, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanStopFly, this); + */ + Ham_ESF_CanStopFly, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanBlock, this); + */ + Ham_ESF_CanBlock, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanRaiseKi, this); + */ + Ham_ESF_CanRaiseKi, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanRaiseStamina, this); + */ + Ham_ESF_CanRaiseStamina, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanTeleport, this); + */ + Ham_ESF_CanTeleport, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanStartFly, this); + */ + Ham_ESF_CanStartFly, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanStartPowerup, this); + */ + Ham_ESF_CanStartPowerup, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanJump, this); + */ + Ham_ESF_CanJump, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_CanWallJump, this); + */ + Ham_ESF_CanWallJump, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsSuperJump, this); + */ + Ham_ESF_IsSuperJump, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsMoveBack, this); + */ + Ham_ESF_IsMoveBack, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ESF_CheckWallJump, this); + */ + Ham_ESF_CheckWallJump, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, const Float:somevalue[3]) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_EnableWallJump, this, const Float:somevalue[3]); + */ + Ham_ESF_EnableWallJump, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_DisableWallJump, this); + */ + Ham_ESF_DisableWallJump, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_ResetWallJumpVars, this); + */ + Ham_ESF_ResetWallJumpVars, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, const value[], const Float:somevalue[3], const someothervalue[]) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_GetWallJumpAnim, const value[], const Float:somevalue[3], const someothervalue[]); + */ + Ham_ESF_GetWallJumpAnim, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, const somevalue[], const someothervalue[]) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_GetWallJumpAnim2, this, const somevalue[], const someothervalue[]); + */ + Ham_ESF_GetWallJumpAnim2, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetFlyMoveType, this); + */ + Ham_ESF_SetWallJumpAnimation, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetFlyMoveType, this); + */ + Ham_ESF_SetFlyMoveType, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsFlyMoveType, this); + */ + Ham_ESF_IsFlyMoveType, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_IsWalkMoveType, this); + */ + Ham_ESF_IsWalkMoveType, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetWalkMoveType, this); + */ + Ham_ESF_SetWalkMoveType, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_DrawChargeBar, this, somevalue); + */ + Ham_ESF_DrawChargeBar, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StartBlock, this); + */ + Ham_ESF_StartBlock, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StopBlock, this); + */ + Ham_ESF_StopBlock, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StartFly, this); + */ + Ham_ESF_StartFly, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, Float:value) + * Return type: Float. + * Execute params: ExecuteHam(Ham_ESF_GetMaxSpeed, this, Float:value); + */ + Ham_ESF_GetMaxSpeed, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, anim) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetAnimation, this, anim); + */ + Ham_ESF_SetAnimation, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_PlayAnimation, this); + */ + Ham_ESF_PlayAnimation, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ESF_GetMoveForward, this); + */ + Ham_ESF_GetMoveForward, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ESF_GetMoveRight, this); + */ + Ham_ESF_GetMoveRight, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ESF_GetMoveUp, this); + */ + Ham_ESF_GetMoveUp, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_AddBlindFX, this); + */ + Ham_ESF_AddBlindFX, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_RemoveBlindFX, this); + */ + Ham_ESF_RemoveBlindFX, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_DisablePSBar, this); + */ + Ham_ESF_DisablePSBar, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_AddBeamBoxCrosshair, this, somevalue); + */ + Ham_ESF_AddBeamBoxCrosshair, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_RemoveBeamBoxCrosshair, this); + */ + Ham_ESF_RemoveBeamBoxCrosshair, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_DrawPSWinBonus, this); + */ + Ham_ESF_DrawPSWinBonus, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, Float:value, Float:othervalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_DrawPSBar, this, Float:value, Float:othervalue); + */ + Ham_ESF_DrawPSBar, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_LockCrosshair, this); + */ + Ham_ESF_LockCrosshair, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_UnLockCrosshair, this); + */ + Ham_ESF_UnLockCrosshair, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_RotateCrosshair, this); + */ + Ham_ESF_RotateCrosshair, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_UnRotateCrosshair, this); + */ + Ham_ESF_UnRotateCrosshair, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_WaterMove, this); + */ + Ham_ESF_WaterMove, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_CheckTimeBasedDamage, this); + */ + Ham_ESF_CheckTimeBasedDamage, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_DoesSecondaryAttack, this); + */ + Ham_ESF_DoesSecondaryAttack, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_ESF_DoesPrimaryAttack, this); + */ + Ham_ESF_DoesPrimaryAttack, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_RemoveSpecialModes, this); + */ + Ham_ESF_RemoveSpecialModes, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StopTurbo, this); + */ + Ham_ESF_StopTurbo, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_TakeBean, this); + */ + Ham_ESF_TakeBean, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_GetPowerLevel, this); + */ + Ham_ESF_GetPowerLevel, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_RemoveAllOtherWeapons, this); + */ + Ham_ESF_RemoveAllOtherWeapons, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_StopSwoop, this); + */ + Ham_ESF_StopSwoop, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetDeathAnimation, this); + */ + Ham_ESF_SetDeathAnimation, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_SetModel, this); + */ + Ham_ESF_SetModel, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_AddAttacks, this); + */ + Ham_ESF_AddAttacks, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this, const value[], const othervalue[], somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_EmitClassSound, this, const value[], const othervalue[], somevalue); + */ + Ham_ESF_EmitClassSound, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_CheckLightning, this); + */ + Ham_ESF_CheckLightning, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_FreezeControls, this); + */ + Ham_ESF_FreezeControls, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_UnFreezeControls, this); + */ + Ham_ESF_UnFreezeControls, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_UpdateKi, this); + */ + Ham_ESF_UpdateKi, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_ESF_UpdateHealth, this); + */ + Ham_ESF_UpdateHealth, + + /** + * Description: - + * This is available only in ESF Open Beta. + * Forward params: function(this) + * Return type: Vector. + * Execute params: ExecuteHam(Ham_ESF_GetTeleportDir, this, output[3]); + */ + Ham_ESF_GetTeleportDir, + + /** + * Description: Unsure. + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_ESF_Weapon_HolsterMeleed, this); + */ + Ham_ESF_Weapon_HolsterWhenMeleed, + + + /** + * The following functions are specific to Natural Selection. + */ + + /** + * Description: - + * Forward params: function(this, controller, Float:value) + * Return type: Float. + * Execute params: ExecuteHam(Ham_SetBoneController, this, controller, Float:value) + */ + Ham_NS_SetBoneController, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_SaveDataForReset, this) + */ + Ham_NS_SaveDataForReset, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_NS_GetHull, this) + */ + Ham_NS_GetHull, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_NS_GetMaxWalkSpeed, this) + */ + Ham_NS_GetMaxWalkSpeed, + + /** + * Description: - + * Forward params: function(this, const teamID[]) + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_NS_SetTeamID, this, const teamID[]) + */ + Ham_NS_SetTeamID, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_NS_GetPlayerClass, this) + */ + Ham_NS_GetEffectivePlayerClass, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_NS_GetAuthenticationMask, this) + */ + Ham_NS_GetAuthenticationMask, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_EffectivePlayerClassChanged, this) + */ + Ham_NS_EffectivePlayerClassChanged, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_NeedsTeamUpdate, this) + */ + Ham_NS_NeedsTeamUpdate, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_SendTeamUpdate, this) + */ + Ham_NS_SendTeamUpdate, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_SendWeaponUpdate, this) + */ + Ham_NS_SendWeaponUpdate, + + /** + * Description: - + * Forward params: function(this, idOther) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_InitPlayerFromSpawn, this, idOther) + */ + Ham_NS_InitPlayerFromSpawn, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_PackDeadPlayerItems, this) + */ + Ham_NS_PackDeadPlayerItems, + + /** + * Description: Gets sequence name based on index. + * animationName are passed by reference in ExecuteHam. outputLength is the max output length. + * Forward params: function(this, activity, const animationName[], bool:somevalue) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_GetAnimationForActivity, this, activity, output[], bool:somevalue, outputLength) + */ + Ham_NS_GetAnimationForActivity, + + /** + * Description: - + * Forward params: function(this, const Float:position[3], const Float:viewAngles[3]) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_StartObserver, this, const Float:position[3], const Float:viewAngles[3]) + */ + Ham_NS_StartObserver, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_StopObserver, this) + */ + Ham_NS_StopObserver, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_NS_GetAdrenalineFactor, this) + */ + Ham_NS_GetAdrenalineFactor, + + /** + * Description: - + * Forward params: function(this, const name[], bool:showpickup)) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_GiveNamedItem, this, const name[], bool:showpickup) + */ + Ham_NS_GiveNamedItem, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_Suicide, this) + */ + Ham_NS_Suicide, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_NS_GetCanUseWeapon, this) + */ + Ham_NS_GetCanUseWeapon, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_NS_Weapon_GetWeapPrimeTime, this) + */ + Ham_NS_Weapon_GetWeaponPrimeTime, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_NS_Weapon_PrimeWeapon, this) + */ + Ham_NS_Weapon_PrimeWeapon, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_NS_Weapon_GetIsWeaponPrimed, this) + */ + Ham_NS_Weapon_GetIsWeaponPrimed, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_NS_Weapon_GetIsWeapPriming, this) + */ + Ham_NS_Weapon_GetIsWeaponPriming, + + /** + * Description: - + * Forward params: function(this, const viewModel[], const weaponModel[], anim, const animExt[], skiplocal, body) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_NS_Weapon_DefaultDeploy, this, const viewModel[], const weaponModel[], anim, const animExt[], skiplocal, body) + */ + Ham_NS_Weapon_DefaultDeploy, + + /** + * Description: - + * Forward params: function(this, clipsize, anim, Float:delay, body) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_NS_Weapon_DefaultReload, this, clipsize, anim, Float:delay, body) + */ + Ham_NS_Weapon_DefaultReload, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_NS_Weapon_GetDeployTime, this) + */ + Ham_NS_Weapon_GetDeployTime, + + + /** + * The following functions are specific to Sven Co-op. + */ + + /** + * Description: Returns the type of group (i.e, "houndeye", or "human military" + * so that monsters with different classnames still realize that they are teammates. + * (overridden for monsters that form groups) + * Classes list: + * CLASS_NONE 0 + * CLASS_MACHINE 1 + * CLASS_PLAYER 2 + * CLASS_HUMAN_PASSIVE 3 + * CLASS_HUMAN_MILITARY 4 + * CLASS_ALIEN_MILITARY 5 + * CLASS_ALIEN_PASSIVE 6 + * CLASS_ALIEN_MONSTER 7 + * CLASS_ALIEN_PREY 8 + * CLASS_ALIEN_PREDATOR 9 + * CLASS_INSECT 10 + * CLASS_PLAYER_ALLY 11 + * CLASS_PLAYER_BIOWEAPON 12 + * CLASS_ALIEN_BIOWEAPON 13 + * CLASS_XRACE_PITDRONE 14 + * CLASS_XRACE_SHOCK 15 + * CLASS_BARNACLE 99 + * Forward params: function(this, class) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_GetClassification, this, class) + */ + Ham_SC_GetClassification, + + /** + * Description: Whether entity is a monter. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsMonster, this) + */ + Ham_SC_IsMonster, + + /** + * Description: Whether entity uses PhysX feature. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsPhysX, this) + */ + Ham_SC_IsPhysX, + + /** + * Description: Whether this is a point entity. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsPointEntity, this) + */ + Ham_SC_IsPointEntity, + + /** + * Description: Whether entity is a machine. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsMachine, this) + */ + Ham_SC_IsMachine, + + /** + * Description: Removes the entity and all its content in critical situation. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CriticalRemove, this) + */ + Ham_SC_CriticalRemove, + + /** + * Description: Updates global tables that need to know about entities being removed. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(UpdateOnRemove, this) + */ + Ham_SC_UpdateOnRemove, + + /** + * Description: Returns true if a line can be traced from the caller's eyes to the target vector. + * Forward params: function(this, entity, bool:ignoreGlass) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FVisible, this, entity, bool:ignoreGlass) + */ + Ham_SC_FVisible, + + /** + * Description: Returns true if a line can be traced from the given point to the target point. + * Forward params: function(this, const Float:target[3], const Float:start[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FVisibleFromPos, this, const Float:target[3], const Float:start[3]) + */ + Ham_SC_FVisibleFromPos, + + /** + * Description: Returns true if passed in entity is facing current entity. + * Some examples of dotProduct value : + * VIEW_FIELD_FULL -1.0 + * VIEW_FIELD_WIDE -0.7 + * VIEW_FIELD_NARROW 0.7 + * VIEW_FIELD_ULTRA_NARROW 0.9 + * Forward params: function(this, entTest, Float:dotProduct) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsFacing, this, entTest, Float:dotProduct) + */ + Ham_SC_IsFacing, + + /** + * Description: Gets points without killing an entity. + * Forward params: function(this, Float:damage) + * Return type: Float. + * Execute params: ExecuteHam(Ham_SC_GetPointsForDamage, this, Float:damage) + */ + Ham_SC_GetPointsForDamage, + + /** + * Description: Gets points for making some damage. + * Forward params: function(this, attacker, inflictor, Float:damage) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_GetDamagePoints, this, attacker, inflictor, Float:damage) + */ + Ham_SC_GetDamagePoints, + + /** + * Description: Constructor. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_OnCreate, this) + */ + Ham_SC_OnCreate, + + /** + * Description: Desctructor. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_OnDestroy, this) + */ + Ham_SC_OnDestroy, + + /** + * Description: Returns false if the entity is somehow invalid. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsValidEntity, this) + */ + Ham_SC_IsValidEntity, + + /** + * Description: Checks if this monster should fade out. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_ShouldFadeOnDeath, this) + */ + Ham_SC_ShouldFadeOnDeath, + + /** + * Description: Sets up a friendly monster. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_SetupFriendly, this) + */ + Ham_SC_SetupFriendly, + + /** + * Description: Tries to revive a monster. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_ReviveThink, this) + */ + Ham_SC_ReviveThink, + + /** + * Description: Revives a monster. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Revive, this) + */ + Ham_SC_Revive, + + /** + * Description: Final bit of initization before a monster is turned over to the AI. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_StartMonster, this) + */ + Ham_SC_StartMonster, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CheckRangeAttack1_Move, this, Float:dot, Float:dist) + */ + Ham_SC_CheckRangeAttack1_Move, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CheckRangeAttack2_Move, this, Float:dot, Float:dist) + */ + Ham_SC_CheckRangeAttack2_Move, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CheckMeleeAttack1_Move, this, Float:dot, Float:dist) + */ + Ham_SC_CheckMeleeAttack1_Move, + + /** + * Description: Surveys conditions and set appropriate conditions bits for attack types. + * Forward params: function(this, Float:dot, Float:dist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CheckMeleeAttack2_Move, this, Float:dot, Float:dist) + */ + Ham_SC_CheckMeleeAttack2_Move, + + /** + * Description: Checks tank usage. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CheckTankUsage, this) + */ + Ham_SC_CheckTankUsage, + + /** + * Description: Sets a monster's gait activity. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_SetGaitActivity, this) + */ + Ham_SC_SetGaitActivity, + + /** + * Description: Tries to overcome local obstacles by triangulating a path around them. + * Forward params: function(this, const Float:start[3], const Float:end[3], Float:dist, targetEnt, Float:apex[3], Float:apex2[3], bool:coverPath) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FTriangulate, this, const Float:start[3], const Float:end[3], Float:dist, targetEnt, Float:apex[3], Float:apex2[3], bool:coverPath ) + */ + Ham_SC_FTriangulate, + + /** + * Description: Tries to overcome local obstacles by triangulating a path around them. + * Forward params: function(this, const Float:start[3], const Float:end[3], Float:dist, targetEnt, Float:apex[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FTriangulateExtension, this, const Float:start[3], const Float:end[3], Float:dist, targetEnt, Float:apex[3]) + */ + Ham_SC_FTriangulateExtension, + + /** + * Description: Tries to find a nearby node that will hide the caller from its enemy. + * If supplied, search will return a node at least as far away as minDist, but no farther than maxDist. + * If maxDist isn't supplied, it defaults to a reasonable value. + * Forward params: function(this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FindCoverGrenade, this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist) + */ + Ham_SC_FindCoverGrenade, + + /** + * Description: Tries to find a nearby node that will hide the caller from its enemy. + * If supplied, search will return a node at least as far away as minDist, but no farther than maxDist. + * If maxDist isn't supplied, it defaults to a reasonable value. + * Forward params: function(this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FindCoverDistance, this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist) + */ + Ham_SC_FindCoverDistance, + + /** + * Description: Tries to find a nearby node that will hide the caller from its enemy. + * If supplied, search will return a node at least as far away as minDist, but no farther than maxDist. + * If maxDist isn't supplied, it defaults to a reasonable value. + * Forward params: function(this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FindAttackPoint, this, const Float:threat[3], const Float:viewOffset[3], Float:minDist, Float:maxDist) + */ + Ham_SC_FindAttackPoint, + + /** + * Description: Determines whether or not the chosen cover location is a good one to move to. + * Currently based on proximity to others in the squad. + * Forward params: function(this, const Float:coverLocation[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FValidateCover, this, const Float:coverLocation[3]) + */ + Ham_SC_FValidateCover, + + /** + * Description: Checks for possibility of friendly fire. + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_NoFriendlyFire, this) + */ + Ham_SC_NoFriendlyFire1, + + /** + * Description: Checks for possibility of friendly fire. + * Forward params: function(this, const Float:pos[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_NoFriendlyFire2, this, const Float:pos[3]) + */ + Ham_SC_NoFriendlyFire2, + + /** + * Description: Checks for possibility of friendly fire. + * Forward params: function(this, const Float:pos[3], targetEnt) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_NoFriendlyFire3, this, const Float:pos[3], targetEnt) + */ + Ham_SC_NoFriendlyFire3, + + /** + * Description: Checks for possibility of friendly fire from the calling monster's origin to toPos. + * Forward params: function(this, const Float:toPos[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_NoFriendlyFireToPos, this, const Float:toPos[3]) + */ + Ham_SC_NoFriendlyFireToPos, + + /** + * Description: Same as FVisible but from gun position. + * Forward params: function(this, entity, Float:pos[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FVisibleGunPos, this, entity, Float:pos[3]) + */ + Ham_SC_FVisibleGunPos, + + /** + * Description: Checks for monsters in this generic cone. + * Forward params: function(this, entity, const Float:pos[3]) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_FInBulletCone, this, entity, const Float:pos[3]) + */ + Ham_SC_FInBulletCone, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_CallGibMonster, this) + */ + Ham_SC_CallGibMonster, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_CheckTimeBasedDamage, this) + */ + Ham_SC_CheckTimeBasedDamage, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsMoving, this) + */ + Ham_SC_IsMoving, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_IsPlayerFollowing, this) + */ + Ham_SC_IsPlayerFollowing, + + /** + * Description: - + * Forward params: function(this, idleader) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_StartPlayerFollowing, this, idleader) + */ + Ham_SC_StartPlayerFollowing, + + /** + * Description: - + * Forward params: function(this, bool:clearSchedule) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_StopPlayerFollowing, this, bool:clearSchedule) + */ + Ham_SC_StopPlayerFollowing, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_UseSound, this) + */ + Ham_SC_UseSound, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_UnUseSound, this) + */ + Ham_SC_UnUseSound, + + /** + * Description: - + * Forward params: function(this, idOther) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_RideMonster, this, idOther) + */ + Ham_SC_RideMonster, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_CheckAndApplyGenericAttacks, this) + */ + Ham_SC_CheckAndApplyGenericAttacks, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_CheckScared, this) + */ + Ham_SC_CheckScared, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_CheckCreatureDanger, this) + */ + Ham_SC_CheckCreatureDanger, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_CheckFallDamage, this) + */ + Ham_SC_CheckFallDamage, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_CheckRevival, this) + */ + Ham_SC_CheckRevival, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_MedicCallSound, this) + */ + Ham_SC_MedicCallSound, + + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_MedicCallSound, this) + */ + Ham_SC_Player_MenuInputPerformed, /** * Description: - * Forward params: function(this) - * Return type: Integer (boolean) - * Execute params: ExecuteHam(Ham_TS_CanUsedThroughWalls, this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_IsMenuInputDone, this) */ - Ham_TS_CanUsedThroughWalls, - - /** - * Description: Unsure - this was removed in TS 3.0 (and thus is deprecated). - * Forward params: function(this) - * Return type: Integer (I think...) - * Execute params: ExecuteHam(Ham_TS_RespawnWait, this); - */ - Ham_TS_RespawnWait, + Ham_SC_Player_IsMenuInputDone, /** - * Description: This is called on a map reset for most map based entities. - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_CS_Restart, this); - */ - Ham_CS_Restart, - - /** - * Description: Respawn function for players/bots only! Do not use this on non player/bot entities! - * Forward params: function(this); - * Return type: None. - * Execute params: ExecuteHam(Ham_CS_RoundRespawn, this); - */ - Ham_CS_RoundRespawn, - /** - * Description: Whether or not the player can drop the specified item. + * Description: - * Forward params: function(this) - * Return type: Integer - * Execute params: ExecuteHam(Ham_CS_Item_CanDrop, this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_SpecialSpawn, this) */ - Ham_CS_Item_CanDrop, - - /** - * Description: Gets the maximum speed for whenever a player has the item deployed. - * Forward params: function(this); - * Return type: Float, byrefed in execute. - * Execute params: ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output); - */ - Ham_CS_Item_GetMaxSpeed, + Ham_SC_Player_SpecialSpawn, /** - * Description: I assume this spawns players at the start of a new round. + * Description: - * Forward params: function(this) - * Return type: None. - * Execute Params: ExecuteHam(Ham_DOD_RoundRespawn, this); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Player_IsValidInfoEntity, this) */ - Ham_DOD_RoundRespawn, + Ham_SC_Player_IsValidInfoEntity, /** - * Description: I assume this spawns entities (like func_breakables) at the start of a new round. + * Description: - * Forward params: function(this) * Return type: None. - * Execute Params: ExecuteHam(Ham_DOD_RoundRespawnEnt, this); + * Execute params: ExecuteHam(Ham_SC_Player_LevelEnd, this) */ - Ham_DOD_RoundRespawnEnt, - + Ham_SC_Player_LevelEnd, + /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None, I think... - * Execute params: ExecuteHam(Ham_DOD_RoundStore, this); - */ - Ham_DOD_RoundStore, - - /** - * Description: Unsure. - * Forward params: function(this, someintegervalue) + * Description: - + * Forward params: function(this, voteType) * Return type: None. - * Execute params: ExecuteHam(Ham_DOD_AreaSetIndex, this, someintegervalue) + * Execute params: ExecuteHam(Ham_SC_Player_VoteStarted, this, voteType) */ - Ham_DOD_AreaSetIndex, - + Ham_SC_Player_VoteStarted, + /** - * Description: Unsure + * Description: - + * Forward params: function(this, voteType) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Player_CanStartNextVote, this, voteType) + */ + Ham_SC_Player_CanStartNextVote, + + /** + * Description: - + * Forward params: function(this, voteInput) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_Vote, this, voteInput) + */ + Ham_SC_Player_Vote, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Player_HasVoted, this) + */ + Ham_SC_Player_HasVoted, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_ResetVote, this) + */ + Ham_SC_Player_ResetVote, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_Player_LastVoteInput, this) + */ + Ham_SC_Player_LastVoteInput, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_InitVote, this) + */ + Ham_SC_Player_InitVote, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_SC_Player_StartNextVote, this) + */ + Ham_SC_Player_TimeToStartNextVote, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_ResetView, this) + */ + Ham_SC_Player_ResetView, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float. + * Execute params: ExecuteHam(Ham_SC_Player_GetLogFrequency, this) + */ + Ham_SC_Player_GetLogFrequency, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Player_LogPlayerStats, this) + */ + Ham_SC_Player_LogPlayerStats, + + /** + * Description: - + * Forward params: function(this, idPlayer, Float:time) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_DisableCollision, this, idPlayer, Float:time) + */ + Ham_SC_Player_DisableCollisionWithPlayer, + + /** + * Description: - + * Forward params: function(this, idPlayer, bool:testIntersection) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Player_EnableCollision, this, idPlayer, bool:testIntersection) + */ + Ham_SC_Player_EnableCollisionWithPlayer, + + /** + * Description: - * Forward params: function(this, idPlayer) - * Return type: None. - * Execute Params: ExecuteHam(Ham_DOD_AreaSendStatus, this, idPlayer); + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Player_CanTouchPlayer, this, idPlayer) */ - Ham_DOD_AreaSendStatus, - + Ham_SC_Player_CanTouchPlayer, + + /** - * Description: Unsure. + * Description: - * Forward params: function(this) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_DOD_GetState, this); + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Item_Materialize, this) */ - Ham_DOD_GetState, + Ham_SC_Item_Materialize, + + + /** + * Description: - + * Forward params: function(this, const Float:moving[3], const Float:standing[3], const Float:crouched[3]) + * Return type: Vector, byreffed in execute. + * Execute params: ExecuteHam(Ham_SC_Weapon_BulletAccuracy, this, const Float:moving[3], const Float:standing[3], const Float:crouched[3], Float:output[3]) + */ + Ham_SC_Weapon_BulletAccuracy, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_TertiaryAttack, this) + */ + Ham_SC_Weapon_TertiaryAttack, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_BurstSupplement, this) + */ + Ham_SC_Weapon_BurstSupplement, /** - * Description: Unsure. - * Forward params: function(this, idtarget) - * Return type: Integer. - * Execute Params: ExecuteHam(Ham_DOD_GetStateEnt, this, idtarget); + * Description: - + * Forward params: function(this, const alternative[] = "") + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_SC_Weapon_GetP_Model, this, const alternative[] = "", buffer[], size) */ - Ham_DOD_GetStateEnt, - + Ham_SC_Weapon_GetP_Model, + /** - * Description: Whether or not a player can drop this item. + * Description: - + * Forward params: function(this, const alternative[] = "") + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_SC_Weapon_GetW_Model, this, const alternative[] = "", buffer[], size) + */ + Ham_SC_Weapon_GetW_Model, + + /** + * Description: - + * Forward params: function(this, const alternative[] = "") + * Return type: String (string length returned and string byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_SC_Weapon_GetV_Model, this, const alternative[] = "", buffer[], size) + */ + Ham_SC_Weapon_GetV_Model, + + /** + * Description: - + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_PrecacheCustomMdl, this) + */ + Ham_SC_Weapon_PrecacheCustomModels, + + /** + * Description: - * Forward params: function(this) * Return type: Integer (boolean). - * Execute Params: ExecuteHam(Ham_DOD_Item_CanDrop, this); + * Execute params: ExecuteHam(Ham_SC_Weapon_IsMultiplayer, this) */ - Ham_DOD_Item_CanDrop, + Ham_SC_Weapon_IsMultiplayer, /** - * Description: Unsure. - * Forward params: function(this, iduser) + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_FRunfuncs, this) + */ + Ham_SC_Weapon_FRunfuncs, + + /** + * Description: - + * Forward params: function(this, fov) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_SetFOV, this, fov) + */ + Ham_SC_Weapon_SetFOV, + + /** + * Description: - + * Forward params: function(this) + * Return type: Integer (boolean). + * Execute params: ExecuteHam(Ham_SC_Weapon_FCanRun, this) + */ + Ham_SC_Weapon_FCanRun, + + /** + * Description: - + * Forward params: function(this, Float:frametime) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_CustomDecrement, this, Float:frametime) + */ + Ham_SC_Weapon_CustomDecrement, + + /** + * Description: - + * Forward params: function(this, const model[]) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_SetV_Model, this, const model[]) + */ + Ham_SC_Weapon_SetV_Model, + + /** + * Description: - + * Forward params: function(this, const model[]) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_SetP_Model, this, const model[]) + */ + Ham_SC_Weapon_SetP_Model, + + /** + * Description: - + * Forward params: function(this, skin) + * Return type: None. + * Execute params: ExecuteHam(Ham_SC_Weapon_ChangeWeaponSkin, this, skin) + */ + Ham_SC_Weapon_ChangeWeaponSkin, + + + /** + * LATE ADDITIONS (2013) + */ + + /** + * Description: Normally called whenever an entity dies. + * Forward params: function(this, idinflictor, idattacker, shouldgib) + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_Killed, this, idinflictor, idattacker, shouldgib); + */ + Ham_TFC_Killed, + + /** + * Description: Returns whether an entity is activated. + * Forward params: function(this, idActivator); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_IsTriggered, this, idActivator); + */ + Ham_TFC_IsTriggered, + + /** + * Description: Sends an animation event for the weapon. skiplocal is 1 if client is predicting weapon animations. + * Forward params: function(this, anim, skiplocal); + * Return type: None. + * Execute params: ExecuteHam(Ham_TFC_Weapon_SendWeaponAnim, this, anim, skiplocal); + */ + Ham_TFC_Weapon_SendWeaponAnim, + + /** + * Description: Gets next attack delay. + * Forward params: function(this, Float:delay) + * Return type: Float (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_TFC_Weapon_GetNextAttackDelay, this, Float:delay, Float:output); + */ + Ham_TFC_Weapon_GetNextAttackDelay, + + + /** + * Description: Usually called whenever an entity gets a form of a heal. + * Forward params: function(this, Float:health, damagebits, health_cap); * Return type: Integer. - * Execute params: ExecuteHam(Ham_TFC_EngineerUse, this, iduser) + * Execute params: ExecuteHam(Ham_SC_TakeHealth, this, Float:health, damagebits, health_cap); */ - Ham_TFC_EngineerUse, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_Finished, this); - */ - Ham_TFC_Finished, - - /** - * Description: Unsure. - * Forward params: function(this, entityid, Float:floata, Float:floatb) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_EmpExplode, this, entityid, Float:floata, Float:floatb) - */ - Ham_TFC_EmpExplode, + Ham_SC_TakeHealth, /** - * Description: Unsure. - * Forward params: function(this, Float:floata, Float:floatb) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_CalcEmpDmgRad, this, Float:floata, Float:floatb) - */ - Ham_TFC_CalcEmpDmgRad, - - /** - * Description: Unsure. - * Forward params: function(this, entityid) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_TakeEmpBlast, this, entityid); - */ - Ham_TFC_TakeEmpBlast, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_EmpRemove, this); - */ - Ham_TFC_EmpRemove, - - - /** - * Description: Unsure. - * Forward params: function(this, entityid, Float:floata) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_TakeConcussionBlast, this, entityid, Float:floata); - */ - Ham_TFC_TakeConcussionBlast, - - /** - * Description: Unsure. - * Forward params: function(this, entityid) - * Return type: None. - * Execute params: ExecuteHam(Ham_TFC_Concuss, this, entityid); - */ - Ham_TFC_Concuss, - - - /** - * Description: Unsure. - * Is only in ESF Open Beta. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_ESF_IsEnvModel, this); - */ - Ham_ESF_IsEnvModel, - - /** - * Description: Unsure. - * Is only in ESF Open Beta. - * Forward params: function(this, entityida, entityidb, Float:floata, Float:floatb, dmgbits) + * Description: Usually called whenever an entity gets a form of armor. + * Forward params: function(this, Float:armor, damagebits, armor_cap); * Return type: Integer. - * Execute params: ExecuteHam(Ham_ESF_TakeDamage2, this, entityida, entityidb, Float:floata, Float:floatb, dmgbits); + * Execute params: ExecuteHam(Ham_SC_TakeArmor, this, Float:armor, damagebits, armor_cap); */ - Ham_ESF_TakeDamage2, + Ham_SC_TakeArmor, /** - * Description: Returns how many points each entity is worth. - * Forward params: function(this) + * Description: Gives ammo to the entity. + * Forward params: function(this, amount, const name[], max, const bool:fromPlayer) * Return type: Integer. - * Execute params: ExecuteHam(Ham_NS_GetPointValue, this); + * Execute params: ExecuteHam(Ham_SC_GiveAmmo, this, amount, "type", max, fromPlayer); */ - Ham_NS_GetPointValue, - + Ham_SC_GiveAmmo, + /** - * Description: Unsure. Probably awards this with the killing of idvictim. - * Forward params: function(this, idvictim) - * Return type: None. - * Execute params: ExecuteHam(Ham_NS_AwardKill, this, idvictim); + * Description: Determines if we should ignore damage. + * Forward params: function(this, idattacker); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_CheckAttacker, this, idattacker); */ - Ham_NS_AwardKill, - + Ham_SC_CheckAttacker, + /** - * Description: Unsure, probably whenever an entity resets after a new round. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_NS_ResetEntity, this); + * Description: Determines if a player is connected. + * Forward params: function(this); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_SC_Player_IsConnected, this); */ - Ham_NS_ResetEntity, - - /** - * Description: Unsure. - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_NS_UpdateOnRemove, this) - */ - Ham_NS_UpdateOnRemove, + Ham_SC_Player_IsConnected, - /** Virtual functions added to TS in TS 3 */ - /** - * Description: Unsure. - * Forward params: function(this) + * Description: Sends an animation event for the weapon. skiplocal is 1 if client is predicting weapon animations. + * Forward params: function(this, anim, skiplocal); * Return type: None. - * Execute params: ExecuteHam(Ham_TS_GiveSlowMul, this) + * Execute params: ExecuteHam(Ham_DOD_Weapon_SendWeaponAnim, this, anim, skiplocal); */ - Ham_TS_GiveSlowMul, - + Ham_DOD_Weapon_SendWeaponAnim, + + /** - * Description: Unsure. The second paramater is actually a char. - * Forward params: function(this, Float:someval, someotherval) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_GoSlow, this, Float:someval, someotherval) - */ - Ham_TS_GoSlow, - - /** - * Description: Probably returns true if the user is in slow mo. - * Forward params: function(this) + * Description: - + * Forward params: function(this); * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_TS_InSlow, this) + * Execute params: ExecuteHam(Ham_CS_Item_IsWeapon, this); */ - Ham_TS_InSlow, - - /** - * Description: Returns true if the entity is an objective. - * Forward params: function(this) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_TS_IsObjective, this) + Ham_CS_Item_IsWeapon, + + + /** + * Description: Returns the id of the entity if its class is derived off of CBaseSquadTalkMonster, -1 otherwise. + * Forward params: function(this) + * Return type: Entity. + * Execute params: ExecuteHam(Ham_OPF_MySquadTalkMonsterPointer, this); + */ + Ham_OPF_MySquadTalkMonsterPointer, + + /** + * Description: - + * Forward params: function(this) + * Return type: Float (byref'd in ExecuteHam). + * Execute params: ExecuteHam(Ham_OPF_WeaponTimeBase, this); + */ + Ham_OPF_WeaponTimeBase, + + + /** + * Description: Called when the alternate attack of a weapon is triggered. + * Forward params: function(this) + * Return type: None. + * Execute params: ExecuteHam(Ham_TS_Weapon_AlternateAttack, this); */ - Ham_TS_IsObjective, - - /** - * Description: Unsure. - * Forward params: function(this, bool:someval) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_EnableObjective, this, bool:someval) - */ - Ham_TS_EnableObjective, - - /** - * Description: Probably called when the engine call to OnEntFreePrivateData is called (the entity destructor.) - * Forward params: function(this) - * Return type: None. - * Execute params: ExecuteHam(Ham_TS_OnEntFreePrivateData, this) - */ - Ham_TS_OnFreeEntPrivateData, - - /** - * Description: Probably called when the engine call to ShouldCollide is called. - * Forward params: function(this, otherEntity) - * Return type: Integer (boolean). - * Execute params: ExecuteHam(Ham_TS_ShouldCollide, this, otherEntity) - */ - Ham_TS_ShouldCollide, + Ham_TS_Weapon_AlternateAttack, /** - * DONT USE ME LOL + * Description: Gets item infos. + * Forward params: function(this, iteminfo_handle); + * Return type: Integer. + * Execute params: ExecuteHam(Ham_Item_GetItemInfo, this, iteminfo_handle); + * Use CreateHamItemInfo() to pass a new ItemInfo handle. */ - HAM_LAST_ENTRY_DONT_USE_ME_LOL -}; + Ham_Item_GetItemInfo, -enum HamError -{ - HAM_OK = 0, - - HAM_INVALID_FUNC, // The function is not valid - HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini - - HAM_ERR_END -}; + + /** + * DONT USE ME LOL + */ + HAM_LAST_ENTRY_DONT_USE_ME_LOL +}; + +enum HamError +{ + HAM_OK = 0, + + HAM_INVALID_FUNC, // The function is not valid + HAM_FUNC_NOT_CONFIGURED, // This function is not configured in hamdata.ini + + HAM_ERR_END +}; + +// To be used with [Get|Set]HamItemInfo. +// Ham prefix to avoid collision. :( +enum HamItemInfo +{ + Ham_ItemInfo_iSlot, + Ham_ItemInfo_iPosition, + Ham_ItemInfo_pszAmmo1, + Ham_ItemInfo_iMaxAmmo1, + Ham_ItemInfo_pszAmmo2, + Ham_ItemInfo_iMaxAmmo2, + Ham_ItemInfo_pszName, + Ham_ItemInfo_iMaxClip, + Ham_ItemInfo_iId, + Ham_ItemInfo_iFlags, + Ham_ItemInfo_iWeight +}; + diff --git a/plugins/include/hamsandwich.inc b/plugins/include/hamsandwich.inc index 0cb55cce..671a7680 100644 --- a/plugins/include/hamsandwich.inc +++ b/plugins/include/hamsandwich.inc @@ -1,382 +1,429 @@ +/* Ham Sandwich + * Copyright 2007-2014 + * By the AMX Mod X Development Team + * + * Ham Sandwich is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * Ham Sandwich is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Ham Sandwich; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * In addition, as a special exception, the author gives permission to + * link the code of Ham Sandwich with the Half-Life Game Engine ("HL + * Engine") and Modified Game Libraries ("MODs") developed by Valve, + * L.L.C ("Valve"). You must obey the GNU General Public License in all + * respects for all of the code used other than the HL Engine and MODs + * from Valve. If you modify this file, you may extend this exception + * to your version of the file, but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. + */ + +/** + * Ham Sandwich is a module that is used to hook and call virtual functions of + * entities. + * Virtual functions are mod-specific functions. This means that in order + * for this to work on a mod, it needs to be configured with the hamdata.ini + * file. + * Be very careful with parameter passing to these functions. + */ + +#if defined _hamsandwich_included + #endinput +#endif +#define _hamsandwich_included + +#include + +#if AMXX_VERSION_NUM >= 175 + #pragma reqlib hamsandwich + #if !defined AMXMODX_NOAUTOLOAD + #pragma loadlib hamsandwich + #endif +#else + #pragma library hamsandwich +#endif + +/** + * Hooks the virtual table for the specified entity class. + * An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt"); + * Look at the Ham enum for parameter lists. + * + * @param function The function to hook. + * @param EntityClass The entity classname to hook. + * @param callback The forward to call. + * @param post Whether or not to forward this in post. + * @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off. + */ +native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0); + +/** + * Hooks the virtual table for the specified entity's class. + * An example would be: RegisterHam(Ham_TakeDamage, id, "player_hurt"); + * Look at the Ham enum for parameter lists. + * Note: This will cause hooks for the entire internal class that the entity is + * not exclusively for the provided entity. + * + * @param function The function to hook. + * @param EntityId The entity classname to hook. + * @param callback The forward to call. + * @param post Whether or not to forward this in post. + * @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off. + */ +native HamHook:RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0); + + +/** + * Stops a ham forward from triggering. + * Use the return value from RegisterHam as the parameter here! + * + * @param fwd The forward to stop. + */ +native DisableHamForward(HamHook:fwd); + +/** + * Starts a ham forward back up. + * Use the return value from RegisterHam as the parameter here! + * + * @param fwd The forward to re-enable. + */ +native EnableHamForward(HamHook:fwd); + +/** + * Executes the virtual function on the entity. + * Look at the Ham enum for parameter lists. + * + * @param function The function to call. + * @param id The id of the entity to execute it on. + */ +native ExecuteHam(Ham:function, this, any:...); + +/** + * Executes the virtual function on the entity, this will trigger all hooks on that function. + * Be very careful about recursion! + * Look at the Ham enum for parameter lists. + * + * @param function The function to call. + * @param id The id of the entity to execute it on. + */ +native ExecuteHamB(Ham:function, this, any:...); + +/** + * Gets the return status of the current hook. + * This is useful to determine what return natives to use. + * + * @return The current status of the hook (such as HAM_SUPERCEDE). + */ +native GetHamReturnStatus(); + +/** + * Gets the return value of a hook for hooks that return integers or booleans. + * + * @param output The variable to store the value in. + */ +native GetHamReturnInteger(&output); + +/** + * Gets the return value of a hook for hooks that return float. + * + * @param output The variable to store the value in. + */ +native GetHamReturnFloat(&Float:output); + +/** + * Gets the return value of a hook for hooks that return Vectors. + * + * @param output The variable to store the value in. + */ +native GetHamReturnVector(Float:output[3]); + +/** + * Gets the return value of a hook for hooks that return entities. + * + * @param output The variable to store the value in. Will be -1 on null. + */ +native GetHamReturnEntity(&output); + +/** + * Gets the return value of a hook for hooks that return strings. + * + * @param output The buffer to store the string in. + * @param size The string size of the buffer. + */ +native GetHamReturnString(output[], size); + +/** + * Gets the original return value of a hook for hooks that return integers or booleans. + * + * @param output The variable to store the value in. + */ +native GetOrigHamReturnInteger(&output); + +/** + * Gets the original return value of a hook for hooks that return floats. + * + * @param output The variable to store the value in. + */ +native GetOrigHamReturnFloat(&Float:output); + +/** + * Gets the original return value of a hook for hooks that return Vectors. + * + * @param output The variable to store the value in. + */ +native GetOrigHamReturnVector(Float:output[3]); + +/** + * Gets the original return value of a hook for hooks that return entities. + * + * @param output The variable to store the value in. -1 on null. + */ +native GetOrigHamReturnEntity(&output); + +/** + * Gets the original return value of a hook for hooks that return strings. + * + * @param output The buffer to store the string in. + * @param size The size of the buffer. + */ +native GetOrigHamReturnString(output[], size); + + +/** + * Sets the return value of a hook that returns an integer or boolean. + * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. + * + * @param value The value to set the return to. + */ +native SetHamReturnInteger(value); + +/** + * Sets the return value of a hook that returns a float. + * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. + * + * @param value The value to set the return to. + */ +native SetHamReturnFloat(Float:value); + +/** + * Sets the return value of a hook that returns a Vector. + * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. + * + * @param value The value to set the return to. + */ +native SetHamReturnVector(const Float:value[3]); + +/** + * Sets the return value of a hook that returns an entity. Set to -1 for null. + * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. + * + * @param value The value to set the return to. + */ +native SetHamReturnEntity(value); + +/** + * Sets the return value of a hook that returns a string. + * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. + * + * @param value The value to set the return to. + */ +native SetHamReturnString(const value[]); + + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are integers. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param value The value to change it to. + */ +native SetHamParamInteger(which, value); + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are floats. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param value The value to change it to. + */ +native SetHamParamFloat(which, Float:value); + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are Vectors. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param value The value to change it to. + */ +native SetHamParamVector(which, const Float:value[3]); + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are entities. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param value The value to change it to. + */ +native SetHamParamEntity(which, value); + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are strings. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param ouput The value to change it to. + */ +native SetHamParamString(which, const output[]); + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are trace result handles. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param tr_handle The value to change it to. + */ +native SetHamParamTraceResult(which, tr_handle); + +/** + * Sets a parameter on the fly of the current hook. This has no effect in post hooks. + * Use this on parameters that are trace result handles. + * + * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". + * @param iteminfo_handle The value to change it to. + */ +native SetHamParamItemInfo(which, iteminfo_handle); + + +/** + * Gets a parameter on the fly of the current hook. + * Use this on parameters that are iteminfo result handles. + * + * @param iteminfo_handle Item info handle. + * @param type Item info type. See ItemInfo_ constants. + */ +native GetHamItemInfo(iteminfo_handle, ItemInfo:type, any:...); + +/** + * Sets a parameter on the fly of the current hook. + * Use this on parameters that are iteminfo result handles. + * + * @param iteminfo_handle Item info handle. + * @param type Item info type. See HamItemInfo_ constants. + */ +native SetHamItemInfo(iteminfo_handle, ItemInfo:type, any:...); + /** - * Ham Sandwich module include file. - * (c) 2007, The AMX Mod X Development Team + * Creates an ItemInfo handle. This value should never be altered. + * The handle can be used in Get/SetHamItemInfo. * - * - - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. + * NOTE: You must call FreeHamItemInfo() on every handle made with CreateHamItemInfo(). * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * In addition, as a special exception, the author gives permission to - * link the code of this program with the Half-Life Game Engine ("HL - * Engine") and Modified Game Libraries ("MODs") developed by Valve, - * L.L.C ("Valve"). You must obey the GNU General Public License in all - * respects for all of the code used other than the HL Engine and MODs - * from Valve. If you modify this file, you may extend this exception - * to your version of the file, but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. + * @return A new ItemInfo handle. */ +native CreateHamItemInfo(); -/** - * Ham Sandwich is a module that is used to hook and call virtual functions of - * entities. - * Virtual functions are mod-specific functions. This means that in order - * for this to work on a mod, it needs to be configured with the hamdata.ini - * file. - * Be very careful with parameter passing to these functions. - */ - -#if defined _hamsandwich_included - #endinput -#endif -#define _hamsandwich_included - -#include - -#if AMXX_VERSION_NUM >= 175 - #pragma reqlib hamsandwich - #if !defined AMXMODX_NOAUTOLOAD - #pragma loadlib hamsandwich - #endif -#else - #pragma library hamsandwich -#endif - -/** - * Hooks the virtual table for the specified entity class. - * An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt"); - * Look at the Ham enum for parameter lists. +/** + * Frees an ItemIndo handle created with CreateHamItemInfo(). Do not call + * this more than once per handle, or on handles not created through + * CreateHamItemInfo(). * - * @param function The function to hook. - * @param EntityClass The entity classname to hook. - * @param callback The forward to call. - * @param post Whether or not to forward this in post. - * @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off. + * @param itemInfo_handle ItemInfo handle created via CreateHamItemInfo(). + * @noreturn */ -native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0); - -/** - * Hooks the virtual table for the specified entity's class. - * An example would be: RegisterHam(Ham_TakeDamage, id, "player_hurt"); - * Look at the Ham enum for parameter lists. - * Note: This will cause hooks for the entire internal class that the entity is - * not exclusively for the provided entity. - * - * @param function The function to hook. - * @param EntityId The entity classname to hook. - * @param callback The forward to call. - * @param post Whether or not to forward this in post. - * @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off. - */ -native HamHook:RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0); - - -/** - * Stops a ham forward from triggering. - * Use the return value from RegisterHam as the parameter here! - * - * @param fwd The forward to stop. - */ -native DisableHamForward(HamHook:fwd); - -/** - * Starts a ham forward back up. - * Use the return value from RegisterHam as the parameter here! - * - * @param fwd The forward to re-enable. - */ -native EnableHamForward(HamHook:fwd); - -/** - * Executes the virtual function on the entity. - * Look at the Ham enum for parameter lists. - * - * @param function The function to call. - * @param id The id of the entity to execute it on. - */ -native ExecuteHam(Ham:function, this, any:...); - -/** - * Executes the virtual function on the entity, this will trigger all hooks on that function. - * Be very careful about recursion! - * Look at the Ham enum for parameter lists. - * - * @param function The function to call. - * @param id The id of the entity to execute it on. - */ -native ExecuteHamB(Ham:function, this, any:...); - -/** - * Gets the return status of the current hook. - * This is useful to determine what return natives to use. - * - * @return The current status of the hook (such as HAM_SUPERCEDE). - */ -native GetHamReturnStatus(); - -/** - * Gets the return value of a hook for hooks that return integers or booleans. - * - * @param output The variable to store the value in. - */ -native GetHamReturnInteger(&output); - -/** - * Gets the return value of a hook for hooks that return float. - * - * @param output The variable to store the value in. - */ -native GetHamReturnFloat(&Float:output); - -/** - * Gets the return value of a hook for hooks that return Vectors. - * - * @param output The variable to store the value in. - */ -native GetHamReturnVector(Float:output[3]); - -/** - * Gets the return value of a hook for hooks that return entities. - * - * @param output The variable to store the value in. Will be -1 on null. - */ -native GetHamReturnEntity(&output); - -/** - * Gets the return value of a hook for hooks that return strings. - * - * @param output The buffer to store the string in. - * @param size The string size of the buffer. - */ -native GetHamReturnString(output[], size); - -/** - * Gets the original return value of a hook for hooks that return integers or booleans. - * - * @param output The variable to store the value in. - */ -native GetOrigHamReturnInteger(&output); - -/** - * Gets the original return value of a hook for hooks that return floats. - * - * @param output The variable to store the value in. - */ -native GetOrigHamReturnFloat(&Float:output); - -/** - * Gets the original return value of a hook for hooks that return Vectors. - * - * @param output The variable to store the value in. - */ -native GetOrigHamReturnVector(Float:output[3]); - -/** - * Gets the original return value of a hook for hooks that return entities. - * - * @param output The variable to store the value in. -1 on null. - */ -native GetOrigHamReturnEntity(&output); - -/** - * Gets the original return value of a hook for hooks that return strings. - * - * @param output The buffer to store the string in. - * @param size The size of the buffer. - */ -native GetOrigHamReturnString(output[], size); - - -/** - * Sets the return value of a hook that returns an integer or boolean. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnInteger(value); - -/** - * Sets the return value of a hook that returns a float. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnFloat(Float:value); - -/** - * Sets the return value of a hook that returns a Vector. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnVector(const Float:value[3]); - -/** - * Sets the return value of a hook that returns an entity. Set to -1 for null. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnEntity(value); - -/** - * Sets the return value of a hook that returns a string. - * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE. - * - * @param value The value to set the return to. - */ -native SetHamReturnString(const value[]); - - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are integers. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamInteger(which, value); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are floats. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamFloat(which, Float:value); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are Vectors. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamVector(which, const Float:value[3]); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are entities. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamEntity(which, value); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are strings. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamString(which, const output[]); - -/** - * Sets a parameter on the fly of the current hook. This has no effect in post hooks. - * Use this on parameters that are trace result handles. - * - * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". - * @param value The value to change it to. - */ -native SetHamParamTraceResult(which, tr_handle); - - -/** - * Returns whether or not the function for the specified Ham is valid. - * Things that would make it invalid would be bounds (an older module version - * may not have all of the functions), and the function not being found in - * the mod's hamdata.ini file. - * - * @param function The function to look up. - * @return true if the function is valid, false otherwise. - */ -native bool:IsHamValid(Ham:function); - -/** - * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}. - * This requires the mod to have the pev and base fields set in hamdata.ini. - * Note this dereferences memory! Improper use of this will crash the server. - * This will return an index of the corresponding cbase field in private data. - * Returns -1 on a null entry. - * - * @param id The entity to examine the private data. - * @param offset The windows offset of the data. - * @param linuxdiff The linux difference of the data. - * @param macdiff The mac os x difference of the data. - * @return The index of the corresponding pdata field. -1 for none set. - */ -native get_pdata_cbase(id, offset, linuxdiff=5, macdiff=5); - -/** - * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}. - * This requires the mod to have the pev and base fields set in hamdata.ini. - * This will set the corresponding cbase field in private data with the index. - * Pass -1 to null the entry. - * - * @param id The entity to examine the private data. - * @param offset The windows offset of the data. - * @param value The index to store, -1 for invalid - * @param linuxdiff The linux difference of the data. - * @param macdiff The mac os x difference of the data. - */ -native set_pdata_cbase(id, offset, value, linuxdiff=5, macdiff=5); - -/** - * This is similar to the get_pdata_cbase, however it does not dereference memory. - * This is many times slower than get_pdata_cbase, and this should only be used - * for testing and finding of offsets, not actual release quality plugins. - * This will return an index of the corresponding cbase field in private data. - * Returns -1 on a null entry. -2 on an invalid entry. - * - * @param id Entry to examine the private data. - * @param offset The windows offset of the data. - * @param linuxdiff The linux difference of the data. - * @param macdiff The mac os x difference of the data. - * @return The index of the corresponding pdata field, -1 for null, -2 for invalid. - */ -native get_pdata_cbase_safe(id, offset, linuxdiff=5, macdiff=5); - - - - -// This is the callback from the module, this handles any fatal errors. -// This will in turn call the "HamFilter(Ham:id, HamError:err, const reason[])" public, if it exists. -// Return PLUGIN_HANDLED from within the HamFilter to stop the plugin from failing. -// Any other return value will fail the plugin. -// You do not need to have a HamFilter, if there is none, all fatal errors will fail the plugin. -// Do not modify this! -public __fatal_ham_error(Ham:id, HamError:err, const reason[]) -{ - - new func=get_func_id("HamFilter", -1); - new bool:fail=true; - - if (func != -1 && callfunc_begin_i(func, -1)==1) - { - callfunc_push_int(_:id); - callfunc_push_int(_:err); - callfunc_push_str(reason, false); - if (callfunc_end()==PLUGIN_HANDLED) - { - fail=false; - } - } - if (fail) - { - set_fail_state(reason); - } - -} +native FreeHamItemInfo(itemInfo_handle); + + +/** + * Returns whether or not the function for the specified Ham is valid. + * Things that would make it invalid would be bounds (an older module version + * may not have all of the functions), and the function not being found in + * the mod's hamdata.ini file. + * + * @param function The function to look up. + * @return true if the function is valid, false otherwise. + */ +native bool:IsHamValid(Ham:function); + +/** + * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}. + * This requires the mod to have the pev and base fields set in hamdata.ini. + * Note this dereferences memory! Improper use of this will crash the server. + * This will return an index of the corresponding cbase field in private data. + * Returns -1 on a null entry. + * + * @param id The entity to examine the private data. + * @param offset The windows offset of the data. + * @param linuxdiff The linux difference of the data. + * @param macdiff The mac os x difference of the data. + * @return The index of the corresponding pdata field. -1 for none set. + */ +native get_pdata_cbase(id, offset, linuxdiff=5, macdiff=5); + +/** + * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}. + * This requires the mod to have the pev and base fields set in hamdata.ini. + * This will set the corresponding cbase field in private data with the index. + * Pass -1 to null the entry. + * + * @param id The entity to examine the private data. + * @param offset The windows offset of the data. + * @param value The index to store, -1 for invalid + * @param linuxdiff The linux difference of the data. + * @param macdiff The mac os x difference of the data. + */ +native set_pdata_cbase(id, offset, value, linuxdiff=5, macdiff=5); + +/** + * This is similar to the get_pdata_cbase, however it does not dereference memory. + * This is many times slower than get_pdata_cbase, and this should only be used + * for testing and finding of offsets, not actual release quality plugins. + * This will return an index of the corresponding cbase field in private data. + * Returns -1 on a null entry. -2 on an invalid entry. + * + * @param id Entry to examine the private data. + * @param offset The windows offset of the data. + * @param linuxdiff The linux difference of the data. + * @param macdiff The mac os x difference of the data. + * @return The index of the corresponding pdata field, -1 for null, -2 for invalid. + */ +native get_pdata_cbase_safe(id, offset, linuxdiff=5, macdiff=5); + + + + +// This is the callback from the module, this handles any fatal errors. +// This will in turn call the "HamFilter(Ham:id, HamError:err, const reason[])" public, if it exists. +// Return PLUGIN_HANDLED from within the HamFilter to stop the plugin from failing. +// Any other return value will fail the plugin. +// You do not need to have a HamFilter, if there is none, all fatal errors will fail the plugin. +// Do not modify this! +public __fatal_ham_error(Ham:id, HamError:err, const reason[]) +{ + + new func=get_func_id("HamFilter", -1); + new bool:fail=true; + + if (func != -1 && callfunc_begin_i(func, -1)==1) + { + callfunc_push_int(_:id); + callfunc_push_int(_:err); + callfunc_push_str(reason, false); + if (callfunc_end()==PLUGIN_HANDLED) + { + fail=false; + } + } + if (fail) + { + set_fail_state(reason); + } + +}