Please note that while ACTION_RANDOMWALK uses a value of 42, it should be 43.
Check the actions.2da and it is 43.
Therefore, rather than use this constant value, you should check against the plain integer of 43 if you need to test if a creature’s action is currently a random walk after using ActionRandomWalk.
NB: It does not appear that you can simply alter the actions.2ds, as debug of a creature with the action still returns 43.