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

Allow RequestFrameCallback not require data param #1068

Merged

Conversation

FortyTwoFortyTwo
Copy link
Contributor

When i want to call RequestFrame without any data param, RequestFrameCallback still requires me to add pointless data param.

public void OnPluginStart()
{
	RequestFrame(OnFrame);
}

public void OnFrame(int pointless)	//pointless param
{
	//do something
}

I want to allow plugin to be compiled without needing data param, making it look bit more nicer when not passing any data.

public void OnPluginStart()
{
	RequestFrame(OnFrame);
}

public void OnFrame()	//param not needed as RequestFrame not passing any data
{
	//do something
}

@Headline
Copy link
Member

Headline commented Sep 2, 2019

What are you using request frame for that made you want to make this contribution?

@FortyTwoFortyTwo
Copy link
Contributor Author

One simple reason is when i have global variable(s) for stuffs around the code, I may need RequestFrame to reset, set or increase by 1 a frame later, without needing any extra params to set.

I could say same thing to timers, and typeset Timer already supports data param not required.

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

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

lgtm

@KyleSanderson
Copy link
Member

haha. The param is still there - it's just 0...

@KyleSanderson KyleSanderson merged commit 2075848 into alliedmodders:master Sep 2, 2019
@FortyTwoFortyTwo FortyTwoFortyTwo deleted the frame-dataparam branch September 2, 2019 21:05
BotoX pushed a commit to BotoX/sourcemod that referenced this pull request Sep 10, 2019
@FortyTwoFortyTwo FortyTwoFortyTwo restored the frame-dataparam branch September 19, 2019 18:31
@FortyTwoFortyTwo FortyTwoFortyTwo deleted the frame-dataparam branch October 19, 2019 12:18
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.

3 participants