Repository navigation
docs: overhaul Pawn include documentation - #395
Open
Nord1cWarr1or wants to merge 9 commits into
Open
Nord1cWarr1or wants to merge 9 commits into
Nord1cWarr1or wants to merge 9 commits into
Conversation
…ion layers Full read-only audit of include doc-comments against ReHLDS/ReGameDLL sources, followed by approved fixes. reapi_engine.inc / reapi_engine_const.inc (engine layer, 235 checks): - add missing Return type for RH_GetEntityInit / RH_SV_CheckUserInfo - fix factual errors: get_ucmd (usercmd handle, not entity), get_key_value_buffer (returns cell count), rh_get_client_connect_time (@error instead of soft 0), Is/ResetModifiedMessageData (MsgIndex -> MsgMsgId, "-1" argument rules), net_remote_address setter marked as not implemented (mutate the address via set_netadr) - new SND_EMIT2_USE_ORIGIN define; ~20 typo/copy-paste doc fixes (lenght, metchan, mvar params, message_const.inc reference, etc.) cssdk_const.inc (constant parity vs vendored cssdk + ReGameDLL/ReHLDS, 983 checks): - renames: ITDB_* -> ITBD_*, SHIELDREN_* -> SHIELDGREN_* (match C++) - DMG_EXPLOSION alias next to DMG_GRENADE (ReGameDLL name of the bit) - new constants: BLOOD_COLOR_DARKRED, ITEM_FLAG_EXHAUST_SECONDARYAMMO/ ITEM_FLAG_CUSTOM, PLAYER_PREVENT_DDUCK, DHF_*/DHM_* hint flags, ThrowDirection, sbar_data, PlayerIdShowHealth/PlayerIdField, WeaponInfiniteAmmoMode, AmmoType, RewardAccount, PaybackForBadThing (all verified against ReGameDLL) - comment fixes: PFLAG_DUCKING, DEAD_RESPAWNABLE, WeaponState weapon list, FEV_RELIABLE tail, "light" section header reapi_gamedll_const.inc: add missing Return type lines (RG_RoundEnd, RG_HandleMenu_ChooseTeam, RG_CBasePlayer_TakeHealth, RG_CBasePlayer_SetClientUserInfoName, RG_CBasePlayer_Observer_IsValidTarget with ATYPE_CLASSPTR note, RG_CBasePlayer_HasRestrictItem), KickBack full weapon list and up_max param name, m_pVIP/m_pVIPQueue relabeled to class CBasePlayer *, m_iIgnoreGlobalChat typed IgnoreChatMsg. reapi_reunion.inc: split constants into new reapi_reunion_const.inc (client_auth_type, reu_authkey_kind, AuthIdType) and document new natives (REU_GetAuthKeyKind, REU_SetConnectTime, REU_GetSerializedId). natives_common.cpp: sync get_key_value_buffer docs with .inc, swap mixed-up amx_Get/amx_SetBodygroup doc blocks natives_misc.cpp: fix "independant ... with via" typo
…meDLL/ReHLDS
Second batch of the cssdk_const expansion (CS-applicability filter
applied: HL-only relics like EF_NIGHTVISION/SNIPERLASER/FIBERCAMERA
are intentionally NOT added - neither fork ever sets those bits).
New constants:
- user-message payloads: BOMB_FLAG_*, STATUSICON_*, HUD_PRINT*
(HUD_PRINTRADIO has no AMXX print_* analog), STATUS_NIGHTVISION_*,
ITEM_STATUS_*
- ScreenFade flags: FFADE_IN/OUT/MODULATE/STAYOUT/LONGFADE
- CHAN_BOT (ReHLDS bot chatter channel)
- SCENARIO_BLOCK_* (mp_round_infinite flags "a".."k")
- menus: ChooseTeamMenuSlot, VGUIMenuSlot, BuyItemMenuSlot
- weapon bitfield masks: WEAPON_SUIT, WEAPON_ALLWEAPONS
- view cone: VIEW_FIELD_FULL/WIDE/NARROW/ULTRA_NARROW
- misc: IN_ACTIVE composite, NUM_BLENDING, ANIM_SWIM_1/2,
ANIM_FIRST_DEATH_SEQUENCE, WEAPON_ACTIVITY_VOLUME, DEFAULT_FOV,
CS_KILLS_FOR_DOMINATION, KNIFE_BODYHIT/WALLHIT_VOLUME
- point additions: MAX_AMMO_SLOTS, MAX_ITEMS, NUM_HITGROUPS,
ITBD_END, SF_GAMECOUNTSET_FIREONCE, SF_GAME_PZONE_ONLY_ALIVE,
SF_PLAYEREQUIP_REMOVEWEAPONS, SF_GUNTARGET_START_ON,
SF_SPARK_TOOGLE/IF_OFF ("TOOGLE" preserved from C++)
All values verified against ReGameDLL/ReHLDS headers; no name
collisions with amxmodx/core or reapi includes (word-boundary sweep).
Expansion batch: port the big constant enums that plugins could not use before (values verified 1:1 against ReGameDLL weapontype.h, gamerules.h, weapons.h): - AutoBuyClassType (15 autobuy bits) - ItemCostType / AmmoCostType / WeaponCostType (item, ammo and weapon default prices; AmmoCostType grenade entries reference ItemCostType values, as in C++) - ClipGiveDefault (28, KNIFE entry kept commented as in C++) - ClipSizeType (24 clip sizes) - WeightWeapon (29 weights) - MaxAmmoType (10 base + 4 ReGameDLL custom grenade/C4 caps) - SATCHELCODE (grenade satchel use codes) - DefuserAllocation (mp_defuser_allocation modes) Word-boundary collision sweep vs amxmodx core and reapi includes: clean.
Port the util.h group operation codes (placed next to the VIEW_FIELD_* block, mirroring source order). Values verified against ReGameDLL regamedll/dlls/util.h:36-37; resurrected from an old local commit (65e855d). No name collisions with amxmodx core or reapi includes (word-boundary sweep).
- remove SATCHELCODE enum: HL satchel-charge relic, UseSatchelCharges is NOXREF and never called in CS paths (violates the CS-applicability filter) - move KNIFE_BODYHIT_VOLUME/KNIFE_WALLHIT_VOLUME out of the m_iWeaponFlash block into the m_iWeaponVolume block where they belong: both are m_iWeaponVolume values set by wpn_knife.cpp (body hit = 128, wall hit = int(flVol * 512))
… contract - HC_BYPASS: document void-only behavior (on returning hookchains it acts like HC_CONTINUE) - GetHookChainReturn: maxlen is required for ATYPE_STRING, not optional; clarify @return - SetHookChainArg: remove phantom maxlen param, add missing @PARAM type, clarify post behavior (later post forwards still see the changed argument) - add missing @return blocks: DisableHookChain, SetHookChainReturn (+@error: strict AType check, ATYPE_TRACE unsupported), get_viewent - reapi_rechecker.inc: declare QueryFileHook tag enum (INVALID_QUERYFILE_HOOK), document hash=-1 semantics (RES_TYPE_EXISTS with -1 becomes RES_TYPE_HASH_ANY), fix ResourceType comment grammar
4 tasks done
Documents existing VTC behavior: soundFilePath is relative to the game directory and must be a valid PCM WAV file (8 or 16 bit). The broadcast receiver note and the block natives documentation live in the module PR (feat/vtc-api31-block-natives).
Nord1cWarr1or
force-pushed
the
docs/include-docs-overhaul
branch
from
September 14, 2026 10:21
7186360 to
21a9c07
Compare
Mirrors the implicit zeroed sbar state (no target under the crosshair) so Pawn plugins can compare the target type against a named constant instead of a magic 0. Note: upstream ReGameDLL (player.h) defines only SBAR_TARGETTYPE_TEAMMATE/ENEMY/HOSTAGE; the zero state is unnamed there, so 0 is taken from the zero-initialized newSBarState behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🖤
Purpose
The Pawn includes had drifted from the C++ they document: wrong return types and parameter names, misspelled constants (
ITDB_*should beITBD_*perbasemonster.h), whole constant families missing. This PR is a full documentation pass over the include layer, plus a CS-filtered expansion ofcssdk_const.incand a Reunion constants split.No module behavior is changed — the only C++ edits are doc comments in
natives_*.cpp. Existing enum members are not shifted anywhere, so old compiled plugins are unaffected, with two intentional renames noted below.Approach
1. Engine layer (
reapi_engine.inc,reapi_engine_const.inc)Return type:forRH_GetEntityInitandRH_SV_CheckUserInfoget_ucmd(usercmd handle, not entity),get_key_value_buffer(returns cell count),rh_get_client_connect_time(@errorinstead of a soft 0),Is/ResetModifiedMessageData(MsgIndex→MsgMsgId,-1argument rules),net_remote_addresssetter marked not implemented (mutate viaset_netadr)SND_EMIT2_USE_ORIGINdefine; ~20 typo/copy-paste doc fixes (lenght, metchan, mvar params,message_const.increference, etc.)2.
cssdk_const.inc— rework and expansionRenames (breaking for out-of-tree plugins that used the old spellings; in-tree usage checked — none):
ITDB_*→ITBD_*(plusNERVE_GAS/DROWN_RECOVER/SLOW_BURN/SLOW_FREEZEunderscores) — per C++basemonster.hSHIELDREN_*→SHIELDGREN_*— per real game code (wpn_shared/)Alias (non-breaking):
DMG_EXPLOSIONadded next toDMG_GRENADE(the ReGameDLL name of the bit).New constants — each verified against ReGameDLL/ReHLDS headers and checked for in-game consumers; the name-collision sweep vs amxmodx core and reapi includes is clean:
ITEM_FLAG_EXHAUST_SECONDARYAMMO,ITEM_FLAG_CUSTOMPLAYER_PREVENT_DDUCK,IN_ACTIVE,ThrowDirection,PlayerIdShowHealth,PlayerIdFieldRewardAccount,PaybackForBadThing,SCENARIO_BLOCK_*,DefuserAllocation,CS_KILLS_FOR_DOMINATIONWeaponInfiniteAmmoMode,AmmoType(numbering follows C++, differs from AMXXCsAmmoType),WeaponCostType,ItemCostType,AmmoCostType,ClipGiveDefault,ClipSizeType,WeightWeapon,MaxAmmoType,AutoBuyClassType,WEAPON_SUIT,WEAPON_ALLWEAPONS,WEAPON_ACTIVITY_VOLUME,KNIFE_BODYHIT/WALLHIT_VOLUMEBOMB_FLAG_*,STATUSICON_*,HUD_PRINT*,STATUS_NIGHTVISION_*,ITEM_STATUS_*,FFADE_*,SBAR_*,DHF_*/DHM_*NUM_HITGROUPS; time-based damage:ITBD_ENDBLOOD_COLOR_DARKRED,GROUP_OP_AND/NAND,VIEW_FIELD_*,CHAN_BOT,MAX_AMMO_SLOTS,MAX_ITEMS,DEFAULT_FOV,NUM_BLENDING,ANIM_SWIM_1/2,ANIM_FIRST_DEATH_SEQUENCE,SF_GAMECOUNTSET_FIREONCE,SF_GAME_PZONE_ONLY_ALIVE,SF_PLAYEREQUIP_REMOVEWEAPONS,SF_GUNTARGET_START_ON,SF_SPARK_TOOGLE/IF_OFF("TOOGLE" preserved from C++)Deliberately not added: HL-only relics that CS never sets —
EF_NIGHTVISION/SNIPERLASER/FIBERCAMERAandSATCHELCODEhave zero consumers in either fork. Keeps the file CS-applicable. Comment fixes:PFLAG_DUCKING("not"),DEAD_RESPAWNABLE,WeaponStateweapon list,FEV_RELIABLEtail,lightsection header.3.
reapi_gamedll_const.incReturn type:lines:RG_RoundEnd,RG_HandleMenu_ChooseTeam,RG_CBasePlayer_TakeHealth,RG_CBasePlayer_SetClientUserInfoName,RG_CBasePlayer_Observer_IsValidTarget(withATYPE_CLASSPTRnote),RG_CBasePlayer_HasRestrictItemKickBack: full weapon list +up_maxparam name fix;m_pVIP/m_pVIPQueuerelabeled toclass CBasePlayer *;m_iIgnoreGlobalChattypedIgnoreChatMsg4. Reunion API split — constants moved to the new
reapi_reunion_const.inc(client_auth_type,reu_authkey_kind,AuthIdType); documentedREU_GetAuthKeyKind,REU_SetConnectTime,REU_GetSerializedId.5.
reapi.inc/reapi_rechecker.inc— hookchain native documentation corrected;RegisterQueryFilecontract documented.6. C++ doc sync —
natives_common.cpp:get_key_value_bufferdoc synced with the.inc, mixed-upamx_GetBodygroup/amx_SetBodygroupdoc blocks swapped;natives_misc.cpp: "independant ... with via" typo.Open Questions and Pre-Merge TODOs
.inc↔member_list.h↔member_list.cppmapping stays in sync.Learning
Audit method: 235 engine-layer checks and 983 cssdk-constant checks against the ReHLDS/ReGameDLL sources, plus a global reverse sweep of ~95 constant families.
PLAYER_PREVENT_DDUCKsupersedes #392 (the same single constant, added here with the fullPLAYER_*iuser3 context). The renames are the only breaking part — affected plugins need a two-line rename. Module bug fixes follow separately in #390; the VTC API 3.1 work is #396.See also: #392, #390, #396