-
Notifications
You must be signed in to change notification settings - Fork 159
[TF2] Add various missing functions from TF2 SDK #476
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
[TF2] Add various missing functions from TF2 SDK #476
Conversation
samisalreadytaken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do GetPropInfo and GetTable even exist, what are the end users going to do with internal representation of types, offsets and flags? What they return are completely static, what's the use case?
Anyway, GetTable can be reimplemented some other time by copying the debug dump code.
| "EntityQuality", | ||
| "AccountID", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be within #ifdef TF so that other games don't unnecessarily check for them.
And I'm wondering, why are these partial lookups? Why not just m_iEntityQuality, m_iAccountID and strcmp == 0?
| if ( V_stristr( szProp, s_pszBannedNetProps[ i ] ) != NULL) | ||
| { | ||
| // Replace any banned properties with a dummy string. | ||
| szProp = "Y6WP5EH4I45F2LMKSDY2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What even is the point of this? Looks like a convoluted way to return null. Just return null
|
|
||
| bool GetPropBoolArray( HSCRIPT hEnt, const char *szProp, int index ) | ||
| { | ||
| return (bool)GetPropIntArray( hEnt, szProp, index ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should return GetPropIntArray == 1. In netpropmanager.cpp, it returns false for invalid props, which would return true here. They also check int size but I don't think that's necessary.
| {_SC("Forward"), Forward, 1, _SC("...")}, | ||
| {_SC("Left"), Left, 1, _SC("...")}, | ||
| {_SC("Up"), Up, 1, _SC("...")}, | ||
| {_SC("Pitch"), Pitch, 1, _SC("...")}, | ||
| {_SC("Yaw"), Yaw, 1, _SC("...")}, | ||
| {_SC("Roll"), Roll, 1, _SC("...")}, | ||
| {_SC("ToQuat"), ToQuat, 1, _SC("...")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They all should have _SC(".") for a single parameter
This PR adds various functions found to be missing from Mapbase VScript while testing maps created for TF2. Some of these functions are either stubs or may otherwise require further consideration in the future.
@samisalreadytaken Heads up that some of these changes touch your code, mostly the net prop manager. I may go ahead and merge this to get a minimum viable product, but you may have input on how to more thoroughly implement these changes.
PR Checklist
developbranch OR targets another branch with a specific goal in mind