Viikuna
No Marlo no game.
- Reaction score
- 265
Well, the code I posted probably tells how to use readonly. Just use readonly keyword and make sure that you only try to set those values inside struct.
Also, I noticed you added out of bounds checks for those appearance members, which is good.
You should probably do it like this though:
So you can for example incerease green and blue by 10000 without bugging. This can be useful for undoing all vertex color changes that make unit more red by decereasing those.
edit.Oh yea, it kinda ruins this hook thingy, damn.
Also, I noticed you added out of bounds checks for those appearance members, which is good.
You should probably do it like this though:
JASS:
local real red2
set .red=.red+addred // we leave .red unaffected by bounds check
set red2=.red
if red2 < 0 then // red2 is .red, but with bounds checked,
set red2=0 // so it can be used for vertex color change
else
if red2>522 then
set red2=522
endif
endif
call SetUniVertexColor(.unit,red2,// etc..
endif
So you can for example incerease green and blue by 10000 without bugging. This can be useful for undoing all vertex color changes that make unit more red by decereasing those.
edit.Oh yea, it kinda ruins this hook thingy, damn.