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

@FortyTwoFortyTwo FortyTwoFortyTwo commented Sep 2, 2019

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

@FortyTwoFortyTwo FortyTwoFortyTwo commented Sep 2, 2019

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

lgtm

@KyleSanderson
Copy link
Member

@KyleSanderson KyleSanderson commented Sep 2, 2019

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

@KyleSanderson KyleSanderson merged commit 2075848 into alliedmodders:master Sep 2, 2019
2 checks passed
@FortyTwoFortyTwo FortyTwoFortyTwo deleted the frame-dataparam branch Sep 2, 2019
BotoX pushed a commit to BotoX/sourcemod that referenced this issue Sep 10, 2019
@FortyTwoFortyTwo FortyTwoFortyTwo restored the frame-dataparam branch Sep 19, 2019
@FortyTwoFortyTwo FortyTwoFortyTwo deleted the frame-dataparam branch Oct 19, 2019
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.

None yet

3 participants