summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-08-29 19:09:27 -0400
committera1xd <[email protected]>2021-08-29 19:09:27 -0400
commit0b7bad55819d4a7ea9a8e3e4198acc35a8a7371a (patch)
tree3443a389ede73349f5caf402c095f2f54cadae7d /common
parentremove unused accel fields (diff)
downloadrawaccel-0b7bad55819d4a7ea9a8e3e4198acc35a8a7371a.tar.xz
rawaccel-0b7bad55819d4a7ea9a8e3e4198acc35a8a7371a.zip
add validation checks for jump mode
Diffstat (limited to 'common')
-rw-r--r--common/rawaccel-validate.hpp6
1 files changed, 6 insertions, 0 deletions
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 ||