SphereCommunity
Sphere 56d - function isbit - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Sphere 56d - function isbit (/Thread-Sphere-56d-function-isbit)



Sphere 56d - function isbit - Indiaret - 03-06-2019 02:01 AM

Hi,

probably I found the bug in sphere 56d. Any idea why this don't work in sphere 56d ? It works fine in 56c . Any changes or its bug in 56d (or my mistake) ?

Code:
[function testIsbit]
local.test2=<hval dam_physical>
local.typeDmg=<getResist <local.test2>>
sysmessage Type of dmgs: <local.typeDmg> and test: <local.test2>

[function getResist]
local.is_god=<isbit <argv(0)>,0>
if (<local.is_god>)
local.is_god=1
endif
local.is_physical=<isbit <argv(0)>,1>
if (<local.is_physical>)
local.is_physical=1
endif
local.is_magical=<isbit <argv(0)>,2>
if (<local.is_magical>)
local.is_magical=1
endif
local.Flags=<eval <local.is_god>+<local.is_physical>+<local.is_magical>>
return <local.Flags>

It returns in sysmessage (0.56d):
Type of dmgs: 0 and test: 02

It returns in sysmessage (0.56c):
Type of dmgs: 01 and test: 02
Thanks


RE: Sphere 56d - function isbit - Coruja - 03-10-2019 05:09 PM

confirmed, the function ISBIT is not working correctly (it's always using 0 on second args)

but anyway I already fixed it, try update to latest sphere build to check if it's working fine now


RE: Sphere 56d - function isbit - Indiaret - 03-10-2019 10:00 PM

Tried. Looks it works correctly.

Good job, thanks for fix Wink