Skip to content

Conversation

@agasking1337
Copy link
Contributor

Introduces the ChangeSubclass method to both the CBaseModelEntity interface and its implementation. This method allows changing the subclass by accepting an item definition index.

Description

Introduce a dedicated ChangeSubclass(ushort itemDefinitionIndex) method (and interface entry) that just forwards to AcceptInput("ChangeSubclass", itemDefinitionIndex.ToString()). This gives callers a clearer and type‑safe way to change an item’s subclass without manually invoking AcceptInput.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement
  • Build/CI improvement

Related Issues

Fixes #(issue number)
Closes #(issue number)
Related to #(issue number)

Changes Made

  • Native changes (C++)
  • Managed Changes (C#)
  • API additions/modifications
  • Memory management improvements
  • Network handling changes
  • SDK updates
  • Build system changes

Detailed Changes

List the specific changes made:

Testing

Yes

Test Environment

Windows 11

  • OS: (e.g., Windows 11, Ubuntu 22.04)
  • Game: (e.g., Counter-Strike 2)
    cs2

Test Cases

Describe the test cases you've run:

  1. Granting player weapons like baionet knife

Breaking Changes

List any breaking changes and migration steps:

Performance Impact

  • No performance impact
  • Positive performance impact
  • Negative performance impact (explain below)
  • Performance impact unknown

Details:

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots/Videos (if applicable)

Add screenshots or videos demonstrating the changes:

Additional Notes

Any additional information, context, or notes for reviewers:


For Maintainers

  • Code review completed
  • Tests pass
  • Ready to merge

Introduces the ChangeSubclass method to both the CBaseModelEntity interface and its implementation. This method allows changing the subclass by accepting an item definition index.
@skuzzis
Copy link
Member

skuzzis commented Nov 23, 2025

Thanks for the PR <3

@skuzzis skuzzis changed the base branch from master to beta November 23, 2025 20:17
@skuzzis skuzzis merged commit 5421428 into swiftly-solution:beta Nov 23, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in SwiftlyS2 - Roadmap Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants