Switch ForwardSys to use ICallable.
This removes a ton of tech debt and will improve Forward performance.
This commit is contained in:
@@ -53,7 +53,7 @@ public Action:Command_CreatePrivateForward(args)
|
||||
delete g_PrivateFwd;
|
||||
}
|
||||
|
||||
g_PrivateFwd = CreateForward(ET_Hook, Param_Cell, Param_String, Param_VarArgs);
|
||||
g_PrivateFwd = CreateForward(ET_Hook, Param_Cell, Param_String);
|
||||
|
||||
if (g_PrivateFwd == null)
|
||||
{
|
||||
@@ -134,13 +134,7 @@ public Action:Command_ExecPrivateForward(args)
|
||||
|
||||
Call_StartForward(g_PrivateFwd);
|
||||
Call_PushCell(24);
|
||||
Call_PushString("I am a format string: %d %d %d %d %d %d");
|
||||
Call_PushCell(0);
|
||||
Call_PushCell(1);
|
||||
Call_PushCell(2);
|
||||
Call_PushCell(3);
|
||||
Call_PushCell(4);
|
||||
Call_PushCell(5);
|
||||
Call_PushString("I am a string");
|
||||
err = Call_Finish(ret);
|
||||
|
||||
PrintToServer("Call to private forward completed");
|
||||
|
||||
@@ -9,7 +9,7 @@ public Plugin:myinfo =
|
||||
url = "http://www.sourcemod.net/"
|
||||
};
|
||||
|
||||
public Action:OnPrivateForward(num, const String:format[], ...)
|
||||
public Action:OnPrivateForward(num, const String:format[])
|
||||
{
|
||||
decl String:buffer[128];
|
||||
|
||||
@@ -17,8 +17,7 @@ public Action:OnPrivateForward(num, const String:format[], ...)
|
||||
|
||||
PrintToServer("num = %d (expected: %d)", num, 24);
|
||||
|
||||
VFormat(buffer, sizeof(buffer), format, 3);
|
||||
PrintToServer("buffer = \"%s\" (expected: \"%s\")", buffer, "I am a format string: 0 1 2 3 4 5");
|
||||
PrintToServer("buffer = \"%s\" (expected: \"%s\")", buffer, "I am a string");
|
||||
|
||||
PrintToServer("End private forward #2");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user