Skip to content

refactor: use SourceMod 1.12 methodmaps - #3

Merged
Rushaway merged 2 commits into
masterfrom
feat/methodmaps
Oct 27, 2026
Merged

Rushaway merged 2 commits into
masterfrom
feat/methodmaps

Conversation

@Rushaway

@Rushaway Rushaway commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace legacy natives with their SourceMod 1.12 methodmap equivalents:
    • GameData (new GameData(), .GetOffset()/.GetAddress()/.GetKeyValue())
  • Retype the affected handles and callback parameters (Handle -> ConVar, Event, Menu, KeyValues, ...)
  • The gamedata handle is now loaded once, freed after use, and the plugin fails cleanly if the gamedata file is missing. version used to be SOURCEMOD_VERSION; it is now an explicit "1.0.1" so it can be bumped.
  • Add #pragma newdecls required and convert the remaining old-style syntax (new/decl, String:/Float: tags, untyped functions and parameters, Tag: casts) to new-style declarations

Why

Methodmaps are the API SourceMod documents and maintains; the procedural natives only remain for backward compatibility. The typed handles also let the compiler catch handle misuse. No behaviour change is intended.

Test plan

  • Compiles with spcomp 1.12.0.7255 using the same dependencies as CI (no errors, no new warnings)
  • CI build passes
  • Smoke-test the plugin on a test server

🤖 Generated with Claude Code

Rushaway and others added 2 commits October 21, 2026 05:05
- Replace legacy natives with their SourceMod 1.12 methodmap equivalents:
  - `GameData` (`new GameData()`, `.GetOffset()`/`.GetAddress()`/`.GetKeyValue()`)
- Retype the affected handles and callback parameters (`Handle` -> `ConVar`, `Event`, `Menu`, `KeyValues`, ...)
- The gamedata handle is now loaded once, freed after use, and the plugin fails cleanly if the gamedata file is missing. `version` used to be `SOURCEMOD_VERSION`; it is now an explicit `"1.0.1"` so it can be bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add `#pragma newdecls required` and convert the remaining old-style syntax (`new`/`decl`, `String:`/`Float:` tags, untyped functions and parameters, `Tag:` casts) to new-style declarations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rushaway
Rushaway merged commit 0be4beb into master Oct 27, 2026
@Rushaway
Rushaway deleted the feat/methodmaps branch October 27, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant