| 832 | { |
| 833 | QiFunc_rand() : QiFunc(1, 2) {} |
| 834 | QiVar exec(const std::vector<QiVar>& args, QiScriptInterpreter* inter) const override |
| 835 | { |
| 836 | long long r = random((args[0].toInteger()), args.size() > 1 ? (args[1].toInteger()) : 0); |
| 837 | inter->setLocalValue(std::string("rand_last"), r); |
| 838 | return r; |
| 839 | } |
| 840 | static long long random(long long max, long long min = 0) |
| 841 | { |
| 842 | if (min > max) std::swap(min, max); |
nothing calls this directly
no test coverage detected