| 12-15-2007, 03:07 PM | #1 |
Hmm not sure that this question had been asked before, well... JASS://A function AddLifeA takes unit u, real ammount returns nothing call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+ammount) endfunction //B function AddLifeB takes unit u, real ammount returns nothing call SetWidgetLife(u,GetWidgetLife(u)+ammount) endfunction which is faster? if B, will there be any side effect on using the widget function like these? |
| 12-15-2007, 03:24 PM | #2 |
Widget is faster, but SetUnitState can be used for things like mana. So if it's life you want, then use Get/SetWidgetLife. It can also be used for doodads and destructable if I'm not mistaken, whereas SetUnitState cannot. |
| 12-15-2007, 03:41 PM | #3 |
B) idk destructs,items,units. unit extends widget. so for example class widget{ ... double hp; // health ... } class unit:widget { ... // unit only params ... } but well PipeDream is expert in such things ^^ |
| 12-15-2007, 03:41 PM | #4 |
There will be no side-effects SetWidgetLife is 100% safe. |
| 12-15-2007, 05:31 PM | #5 |
i see i see, thanks guys :) +rep +rep~ |
