28.07.2013, 17:19
Quote:
That's probably because "stat" is a variable so can represent any part of the enum at all. Imagine the case where you have multiple tags in the enum - suddenly your simple "if" becomes far more complex determining what the tag of the dynamically selected slot is and calling the correct comparison function for the given tag. Not only is this very hard but offset tags are not stored in the compiled amx. The fact that all of your enum slots are Float: is just a special case that COULD be detected but isn't.
This is actually made entirely impossible to resolve by the fact that you can have multiple names for the same enum slot, each with different tags (like a "union" in C). In that case, which tag should be used when dynamically selecting a slot as you are? Better to just have a default unless told otherwise as you do. |
What do you mean by this:
Quote:
This is actually made entirely impossible to resolve by the fact that you can have multiple names for the same enum slot, |
Do you mean this?
pawn Код:
enum E_PLAYER_STATS // Percentages (between 0 - 100)
{
pStat_something = 0,
Float:pStat_somethingElse = 0
};
Okay, so what's my best course of action to get around this, apart from storing the types of variables in an array?