Tagged enums
Hey, got some problems with this one:
Code:
Trying to create a skills API, it all works pretty well but for some reason the enums go wrong. Code:
With this usage: ARP_GetUserSkill(id, Lockpicking) ARP_SetUserSkill(id, Lockpicking, ...) The "lockpicking" is 2. I don't know why, it should be 0, but then the data saved in database are wrong and things (it saves in Herbalism). Not only that, the funny thing is that it loads data the same weird way: Code:
Not only it reads data the same wrong way (it reads Herbalism [which is third or something] into lockpicking), it also works as it should, but simply the enum is somehow wrongly organised. I've been trying to find the mistake I made for a long time till now but couldn't think of anything, I have never had these problems with enums before. |
Re: Tagged enums
Can't really find anything wrong.
What's "myskill" printing? Have you tried debugging (logging) the values when sending to see if anything bogus is going on? EDIT: How does the table structure look by the way? |
Re: Tagged enums
myskill prints like:
0: 1 1: 1 2: 7 // this should be 0 instead of 2, as 2 is herbalism and 0 is lockpicking 3: 1 ... the table structure is in the same order as the enum is, but the first column is authid authid lockpicking mining herbalism ... Yeah I tried debugprinting the values in the native call and it's 2 again, instead of 0. Can't really think of anything wrong there... |
Re: Tagged enums
Anyone can see what may be wrong?
|
Re: Tagged enums
add:
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 14:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.