mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-24 12:26:26 -05:00
input_common/input_mapping: Simplify UUID validity checks
Makes the checks a little more intuitive to read and doesn't construct an extra UUID instance
This commit is contained in:
parent
0849be094e
commit
187c9d7e33
1 changed files with 3 additions and 3 deletions
|
@ -56,7 +56,7 @@ void MappingFactory::StopMapping() {
|
|||
void MappingFactory::RegisterButton(const MappingData& data) {
|
||||
Common::ParamPackage new_input;
|
||||
new_input.Set("engine", data.engine);
|
||||
if (data.pad.guid != Common::UUID{}) {
|
||||
if (data.pad.guid.IsValid()) {
|
||||
new_input.Set("guid", data.pad.guid.Format());
|
||||
}
|
||||
new_input.Set("port", static_cast<int>(data.pad.port));
|
||||
|
@ -92,7 +92,7 @@ void MappingFactory::RegisterButton(const MappingData& data) {
|
|||
void MappingFactory::RegisterStick(const MappingData& data) {
|
||||
Common::ParamPackage new_input;
|
||||
new_input.Set("engine", data.engine);
|
||||
if (data.pad.guid != Common::UUID{}) {
|
||||
if (data.pad.guid.IsValid()) {
|
||||
new_input.Set("guid", data.pad.guid.Format());
|
||||
}
|
||||
new_input.Set("port", static_cast<int>(data.pad.port));
|
||||
|
@ -137,7 +137,7 @@ void MappingFactory::RegisterStick(const MappingData& data) {
|
|||
void MappingFactory::RegisterMotion(const MappingData& data) {
|
||||
Common::ParamPackage new_input;
|
||||
new_input.Set("engine", data.engine);
|
||||
if (data.pad.guid != Common::UUID{}) {
|
||||
if (data.pad.guid.IsValid()) {
|
||||
new_input.Set("guid", data.pad.guid.Format());
|
||||
}
|
||||
new_input.Set("port", static_cast<int>(data.pad.port));
|
||||
|
|
Loading…
Reference in a new issue