oscar-broman / samp-weapon-config

A more consistent and responsive damage system with many new features
Apache License 2.0
92 stars 84 forks source link

Include and open.mp complicate #277

Closed PazzOnee closed 2 weeks ago

PazzOnee commented 11 months ago

include

#if defined _INC_y_va
#if defined _INC_open_mp
stock WC_PlayerTextDrawSetString(playerid, PlayerText:text, const string[], OPEN_MP_TAGS:...)
#else
stock WC_PlayerTextDrawSetString(playerid, PlayerText:text, WC_CONST string[], GLOBAL_TAG_TYPES:...)
#endif
#else
stock WC_PlayerTextDrawSetString(playerid, PlayerText:text, WC_CONST string[])
#endif
{
    if (playerid < 0 || playerid >= MAX_PLAYERS) return 0;
    if (_:text < 0 || text >= PlayerText:MAX_PLAYER_TEXT_DRAWS || s_InternalPlayerTextDraw[playerid][text]) return 0;
    #if defined _INC_y_va
        return PlayerTextDrawSetString(playerid, text, string, ___(3));
    #else
        return PlayerTextDrawSetString(playerid, text, string);
    #endif
}

With this checks, and if you dont use YSI (y_va), func will be stock WC_PlayerTextDrawSetString(playerid, PlayerText:text, WC_CONST string[]), if you didn't use y_va, but you have included open.mp, function should be WC_PlayerTextDrawSetString(playerid, PlayerText:text, const string[], OPEN_MP_TAGS:...), but no

NexiusTailer commented 5 months ago

if you didn't use y_va, but you have included open.mp, function should be WC_PlayerTextDrawSetString(playerid, PlayerText:text, const string[], OPEN_MP_TAGS:...)

So what's the point to be with OPEN_MP_TAGS:... part, if it won't be used anyhow below? If you didn't include y_va but being on omp libs, you cannot pass non-fixed number of arguments to the other hooks of this function. Current checks are ok and shouldn't be changed in this matter.