2019-05-01, 04:54 PM
(2019-05-01, 10:09 AM)Y_Less Wrote:(2019-04-27, 09:53 AM)mr_sacrimoni Wrote:(2019-04-27, 06:43 AM)Y_Less Wrote: `pinfo:id` must be an integer, rather than a float, but you are adding a float to it. ?That's the problem - you can only add an integer to a float if the result is also a float.
ID is a numerical representation of memory place inside of an enum.
For example if I have an enum:
PHP Code:enum pInfo {
? ?ID, (0)
? ?Admin, (1)
? ?Level, (2)
? ?Float:Health (3)
};
pInfo:3 would hit Health, making it a float?
That's not how enums work. ?There's no run-time tag representation, so the VM doesn't know that `pinfo:3` is a float, nor does it know that `id` will be `3` and thus to use float operations. ?`Health` has tag `Float`, so if you explicitly use exactly that constant, the tags will work. ?Anything else and the tag information is lost.
I am aware of that, but the logic stands. Could I just cast 'pinfo:3' to float avoiding the warning that way?