Skip to content

Add "DispatchKeyValueInt" stock#1764

Merged
asherkin merged 3 commits intoalliedmodders:masterfrom
Psykotikism:patch-1
May 6, 2022
Merged

Add "DispatchKeyValueInt" stock#1764
asherkin merged 3 commits intoalliedmodders:masterfrom
Psykotikism:patch-1

Conversation

@Psykotikism
Copy link
Contributor

Closes #1761

@Mart-User
Copy link
Contributor

Thank you! I hope it merges.

@Wend4r
Copy link
Contributor

Wend4r commented May 6, 2022

I suggest adding 2 more stock functions by Vector and float as in the games code

bool CBaseEntity::KeyValue( const char *szKeyName, float flValue ) 
{
	char	string[256];

	Q_snprintf(string,sizeof(string), "%f", flValue );

	return KeyValue( szKeyName, string );
}

bool CBaseEntity::KeyValue( const char *szKeyName, int nValue ) 
{
	char	string[256];

	Q_snprintf(string,sizeof(string), "%d", nValue );

	return KeyValue( szKeyName, string );
}

bool CBaseEntity::KeyValue( const char *szKeyName, const Vector &vecValue ) 
{
	char	string[256];

	Q_snprintf(string,sizeof(string), "%f %f %f", vecValue.x, vecValue.y, vecValue.z );

	return KeyValue( szKeyName, string );
}

Copy link
Member

@asherkin asherkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@asherkin asherkin merged commit 7a3d4e7 into alliedmodders:master May 6, 2022
@Psykotikism Psykotikism deleted the patch-1 branch May 6, 2022 17:10
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.

Feature Request: DispatchKeyValueInt

4 participants