From 0b7bad55819d4a7ea9a8e3e4198acc35a8a7371a Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sun, 29 Aug 2021 19:09:27 -0400 Subject: add validation checks for jump mode --- common/rawaccel-validate.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common') diff --git a/common/rawaccel-validate.hpp b/common/rawaccel-validate.hpp index e9d1120..e776298 100644 --- a/common/rawaccel-validate.hpp +++ b/common/rawaccel-validate.hpp @@ -82,10 +82,16 @@ namespace rawaccel { if (args.offset < 0) { error("offset can not be negative"); } + else if (args.mode == accel_mode::jump && args.offset == 0) { + error("offset can not be 0"); + } if (args.cap < 0) { error("cap"" must not be negative"); } + else if (args.mode == accel_mode::jump && args.cap == 0) { + error("cap can not be 0"); + } if (args.growth_rate <= 0 || args.decay_rate <= 0 || -- cgit v1.2.3