Skip to content

Conversation

@Blixibon
Copy link
Member

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

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@Blixibon Blixibon merged commit 60bffb8 into mapbase-source:mapbase-mp-2025 Sep 20, 2025
4 checks passed
@Blixibon Blixibon deleted the mapbase/mp-2025/vscript-tf2-compat branch September 20, 2025 13:14
Copy link

@samisalreadytaken samisalreadytaken left a 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.

Comment on lines +116 to +117
"EntityQuality",
"AccountID",

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";

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 );

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.

Comment on lines +1197 to +1203
{_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("...")},

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

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.

2 participants