summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input/inputactionoperators.cpp6
-rw-r--r--src/input/inputactionoperators.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/input/inputactionoperators.cpp b/src/input/inputactionoperators.cpp
index a2c0eb496..ef0c48d69 100644
--- a/src/input/inputactionoperators.cpp
+++ b/src/input/inputactionoperators.cpp
@@ -26,6 +26,12 @@ InputActionT operator+(InputActionT action, const int& i)
return action;
}
+InputActionT operator+(InputActionT action, const unsigned int& i)
+{
+ action = static_cast<InputActionT>(static_cast<unsigned int>(action) + i);
+ return action;
+}
+
int operator-(const InputActionT &action1, const InputActionT &action2)
{
return static_cast<int>(action1) - static_cast<int>(action2);
diff --git a/src/input/inputactionoperators.h b/src/input/inputactionoperators.h
index 2a5244c46..a01c75bf8 100644
--- a/src/input/inputactionoperators.h
+++ b/src/input/inputactionoperators.h
@@ -26,6 +26,7 @@
#include "enums/input/inputaction.h"
InputActionT operator+(InputActionT action, const int& i);
+InputActionT operator+(InputActionT action, const unsigned int& i);
int operator-(const InputActionT &action1, const InputActionT &action2);
#endif // INPUT_INPUTACTIONOPERATORS_H