Skip to content

Allow RequestFrameCallback not require data param#1068

Merged
KyleSanderson merged 1 commit intoalliedmodders:masterfrom
FortyTwoFortyTwo:frame-dataparam
Sep 2, 2019
Merged

Allow RequestFrameCallback not require data param#1068
KyleSanderson merged 1 commit intoalliedmodders:masterfrom
FortyTwoFortyTwo:frame-dataparam

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