```code
if (me->HasUnitState(UNIT_STATE_CASTING))
    return;
```
missing here