NexiusTailer / Nex-AC

Anticheat system
https://pawn.wiki/index.php?/topic/27641-nex-ac/
GNU Lesser General Public License v3.0
213 stars 156 forks source link

[Resolved] Tag mismatch warnings (expected tag "bool", but found none) #243

Closed rt-2 closed 2 years ago

rt-2 commented 2 years ago

Hi, When I use AddStaticVehicleEx it gives me this warning:

C:\Users\rt-2\Desktop\SAARP\SAMP\pawno\include\nex-ac.inc(2080) : warning 213: tag mismatch: expected tag "bool", but found none ("_")

this is the code that triggers the warning, if I remove this particular function from that line, the warning disappear:

new vehicleid = AddStaticVehicleEx(strval(vehid), floatstr(pos_x), floatstr(pos_y), floatstr(pos_z), floatstr(pos_angle), strval(color1), strval(color2), -1, addsiren);

Thank you, rt-2

EDIT: Solution is to ignore the warning, this is still stable because bitwise, bool will act the same as int.

NexiusTailer commented 2 years ago

'addsiren' is an int in default sa-mp includes too, but if you use latest YSI (or any other libraries, idk exactly what else behaves the same for now) - you'll see such warnings. Regarding the problem itself, most likely such scripts also hooks some natives and modify their arguments in accordance with how it is possible now declared in the modified samp includes, thereby creating these compilation problems.

So, there is nothing I could do about it if we say in the context of the fact that anticheat still primarily supports standard (canonical) samp includes, and not modified ones. I think this is a problem with YSI and all similar scripts, which are increasingly starting to have problems with the default compiler/includes over time, although they fully supported them before.

NexiusTailer commented 2 years ago

UPD: Current y_iterate have exactly what I've mentioned, here. Probably you use that?

rt-2 commented 2 years ago

UPD: Current y_iterate have exactly what I've mentioned, here. Probably you use that?

So basically I should set addsiren to a bool instead of int simply?

NexiusTailer commented 2 years ago

This should be changed to int in y_iterate to be a real solution (at least when default includes detected). Otherwise there still can be warnings on anticheat's hook of AddStaticVehicleEx.

rt-2 commented 2 years ago

Should we go around the problem and detect when YSI is included for kind of a solution even if not perfect?

NexiusTailer commented 2 years ago

The problem in that not just YSI can use such custom tags for those params in its hooks and it's pretty predictable in this way in the future, if it would be necessary to do exclusionary checks for a bunch of scripts that might be included with such style too.

The real solution to the problem is a return (and making sure that it does not break in the future by testing) support for default samp includes in libraries such as y_iterate and similar, thereby they will stop creating such problems ever again.

rt-2 commented 2 years ago

Anyway Im guessing for int and bool, true and false will just be the same bit-wise than the int 1/0 so we can ignore this and assume everything is stable? Thank you

NexiusTailer commented 2 years ago

Yeah, this continues to be stable as well as it continues to be stable with const-correctness warnings from the new compiler/includes. The only problem is the presence of these warnings and the fact that the user has to see them if he use YSI or modified samp includes.

rt-2 commented 2 years ago

Ok thank you.