- more thread guards to avoid crashes

This commit is contained in:
Mark Vejvoda
2010-06-11 03:17:38 +00:00
parent c6d83dc6bb
commit b40a9d58c4
4 changed files with 77 additions and 36 deletions

View File

@@ -63,13 +63,16 @@ public:
void clear() { memset(this, 0, sizeof(MouseState)); }
bool get(MouseButton b) const {
assert(b > 0 && b < mbCount);
return states[b];
if(b > 0 && b < mbCount) {
return states[b];
}
return false;
}
void set(MouseButton b, bool state) {
assert(b > 0 && b < mbCount);
states[b] = state;
if(b > 0 && b < mbCount) {
states[b] = state;
}
}
};