24.04.2012, 17:46
Also, y_hooks only works on callbacks.
Basically, the "ALS" system detects whether a function has been redefined by another library so that you can chain systems written by different people. There is no reason why "_ALS_" as a prefix is better than any other, there just needs to be a single consistent one so that different libraries are compatible. So by that measure "_ALS_" is better than any other NOW because it is already in use.
If you did "#undef CreateVehicle" and it hadn't already been overridden, you would be trying to undefine a native, which can't be done. On the other hand, if you did "'#define CreateVehicle" and it has already been overridden you would get a redefinition warning. This method detects both (relatively) gracefully.
Basically, the "ALS" system detects whether a function has been redefined by another library so that you can chain systems written by different people. There is no reason why "_ALS_" as a prefix is better than any other, there just needs to be a single consistent one so that different libraries are compatible. So by that measure "_ALS_" is better than any other NOW because it is already in use.
If you did "#undef CreateVehicle" and it hadn't already been overridden, you would be trying to undefine a native, which can't be done. On the other hand, if you did "'#define CreateVehicle" and it has already been overridden you would get a redefinition warning. This method detects both (relatively) gracefully.