Skip to content

SM 1.11 void function should return value if we compare them (without calling). #402

@TheByKotik

Description

@TheByKotik

If you try do something like it you receive: error 209: function "DoNothing" should return a value.
I'm thinking problem in line 10 (if ( s_fnCallback != DoNothing )).

#pragma newdecls required
#pragma semicolon 1

typedef Type = function void (const bool bSuccessful);
stock static Type s_fnCallback;

public void OnPluginStart ()
{
	bool bSuccessful;
	if ( s_fnCallback != DoNothing )
	{
		Call_StartFunction( null, s_fnCallback );
		Call_PushCell( bSuccessful );
		Call_Finish();
		s_fnCallback = DoNothing;
	}
}

stock static void DoNothing (const bool bSuccessful) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions