A layer index used to be cast straight to size_t and handed to ScriptConsole, whose range check then swallowed a negative one whole: the bar simply never appeared and the script had no way to find out. Checked here instead, so the mistake is reported at the call that made it.
| 46 | // bar simply never appeared and the script had no way to find out. Checked |
| 47 | // here instead, so the mistake is reported at the call that made it. |
| 48 | size_t layerArg(const ScriptArgs& args) |
| 49 | { |
| 50 | return (size_t)args.numInRange(0, 0, (int)ScriptConsole::MAX_LAYERS - 1); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | void ckpt_progress_begin(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs) |
no test coverage detected