🐛 avert infinite loop when prod_id not assigned (#539)

Without ptr being reassigned in the case of a 0 prod_id, the app would get into an infinite loop on launch, before opening- this should resolve it 😊
This commit is contained in:
Ceshion 2020-09-21 17:48:46 -04:00 committed by GitHub
parent 4b30d51b8c
commit aec0e1d2a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,8 +141,11 @@ namespace BetterJoyForCemu {
}
ushort prod_id = thirdParty == null ? enumerate.product_id : TypeToProdId(thirdParty.type);
if (prod_id == 0)
continue; // controller was not assigned a type
if (prod_id == 0) {
ptr = enumerate.next; // controller was not assigned a type, but advance ptr anyway
continue;
}
if (validController && !ControllerAlreadyAdded(enumerate.path)) {
switch (prod_id) {
case product_l: