Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

playerPawn vs playerPawn.Value, etc #412

Closed
WeirdPhrog opened this issue Apr 12, 2024 · 6 comments
Closed

playerPawn vs playerPawn.Value, etc #412

WeirdPhrog opened this issue Apr 12, 2024 · 6 comments
Labels
needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity

Comments

@WeirdPhrog
Copy link

What's the difference between playerPawn and playerPawn.Value? weapon and weapon.Value? etc. What should I work with and when? What should I check for null and IsValid? Where can I read about this?

@github-actions github-actions bot added the untriaged New issue has not been triaged label Apr 12, 2024
@Yarukon
Copy link
Contributor

Yarukon commented Apr 13, 2024

  1. e.g. playerPawn is the handler of the entity, playerPawn.Value is the actual entity
  2. playerPawn.Value after check valid
  3. whenever you wanna change value or use function on the entity, check with != null && IsValid (not 100% accurate)
  4. docs.cssharp.dev

@WeirdPhrog
Copy link
Author

Should I also check handler of the entity for valid?

@roflmuffin
Copy link
Owner

When you access .Value or .Get() on a handle, it will return null if its invalid, so you only need to check for null after accessing the value.

@roflmuffin roflmuffin added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 26, 2024
Copy link

This issue has been marked needs-author-action and may be missing some important information.

@github-actions github-actions bot removed the untriaged New issue has not been triaged label Jul 26, 2024
Copy link

This issue has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

Copy link

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity
Projects
None yet
Development

No branches or pull requests

3 participants