Skip to content

Commit

Permalink
Add fakeExtraParameter to streamer function hooks.
Browse files Browse the repository at this point in the history
If any old code had been adapted to account for the extra parameter in the streamer, this code would give an error since there was no longer four parameters.  Make the fourth optional to cover that case.
  • Loading branch information
Y-Less committed Jul 7, 2023
1 parent f7d6fed commit 0e40af3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions YSI_Extra/y_inline_streamer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ Optional plugins:
// Push a fake extra parameter.
native bool:BAD_Streamer_HasIntData(STREAMER_TYPE:type, STREAMER_ALL_TAGS:id, data, fakeExtraParameter = 0) = Streamer_HasIntData;

stock bool:YSI_Streamer_HasIntData(STREAMER_TYPE:type, STREAMER_ALL_TAGS:id, data)
stock bool:YSI_Streamer_HasIntData(STREAMER_TYPE:type, STREAMER_ALL_TAGS:id, data, fakeExtraParameter = 0)
{
#pragma unused fakeExtraParameter
// This isn't a compile-time constant, so we can't use `#if`.
if (Streamer_IncludeFileVersion > 0x295)
{
Expand All @@ -125,8 +126,9 @@ Optional plugins:
// Push a fake extra parameter.
native bool:BAD_Streamer_RemoveIntData(STREAMER_TYPE:type, STREAMER_ALL_TAGS:id, data, fakeExtraParameter = 0) = Streamer_RemoveIntData;

stock bool:YSI_Streamer_RemoveIntData(STREAMER_TYPE:type, STREAMER_ALL_TAGS:id, data)
stock bool:YSI_Streamer_RemoveIntData(STREAMER_TYPE:type, STREAMER_ALL_TAGS:id, data, fakeExtraParameter = 0)
{
#pragma unused fakeExtraParameter
// This isn't a compile-time constant, so we can't use `#if`.
if (Streamer_IncludeFileVersion > 0x295)
{
Expand Down

0 comments on commit 0e40af3

Please sign in to comment.