diff --git a/player_input.cpp b/player_input.cpp index fb9ba9c..f9cbc79 100644 --- a/player_input.cpp +++ b/player_input.cpp @@ -71,24 +71,21 @@ gd::Vector2 PlayerInput::get_last_mouse_motion() { return PlayerInput::lastMouseMotion; } -void PlayerInput::_enter_tree() { - GDGAMEONLY(); +void PlayerInput::_enter_tree() { GDGAMEONLY(); if(!PlayerInput::primaryExists) { this->isPrimary = true; PlayerInput::primaryExists = true; } } -void PlayerInput::_exit_tree() { - GDGAMEONLY(); +void PlayerInput::_exit_tree() { GDGAMEONLY(); if(this->isPrimary) { this->isPrimary = false; PlayerInput::primaryExists = false; } } -void PlayerInput::_unhandled_input(gd::Ref const &event) { - GDGAMEONLY(); +void PlayerInput::_unhandled_input(gd::Ref const &event) { GDGAMEONLY(); if(this->isPrimary && event->is_class("InputEventMouseMotion")) PlayerInput::lastMouseMotion = gd::Object::cast_to(*event)->get_relative(); for(Listener& listener: this->listeners) {