@@ -453,7 +453,12 @@ namespace Loader
453
453
if ((addon->MD5 .empty () || addon->MD5 != md5) || std::filesystem::exists (updatePath))
454
454
{
455
455
UpdateSwapAddon (addon->Path );
456
- QueueAddon (ELoaderAction::Reload, addon->Path );
456
+
457
+ // only reload if it already is loadedw
458
+ if (addon->State == EAddonState::Loaded)
459
+ {
460
+ QueueAddon (ELoaderAction::Reload, addon->Path );
461
+ }
457
462
}
458
463
}
459
464
@@ -704,7 +709,7 @@ namespace Loader
704
709
std::filesystem::path tmpPath = aPath.string ();
705
710
std::thread ([tmpPath, addon, locked, shouldLoad, onlyInitialLaunch]()
706
711
{
707
- Sleep ( 5000 ) ;
712
+ bool lShouldLoad = shouldLoad ;
708
713
if (UpdateAddon (tmpPath, addon->Definitions ->Signature , addon->Definitions ->Name ,
709
714
addon->Definitions ->Version , addon->Definitions ->Provider ,
710
715
addon->Definitions ->UpdateLink != nullptr ? addon->Definitions ->UpdateLink : " " ))
@@ -714,6 +719,7 @@ namespace Loader
714
719
{
715
720
// reset state, because it updated
716
721
addon->IsDisabledUntilUpdate = false ;
722
+ lShouldLoad = true ;
717
723
718
724
// mutex because we're async/threading
719
725
{
@@ -723,19 +729,22 @@ namespace Loader
723
729
}
724
730
725
731
/* only call reload if it wasn't unloaded */
726
- if (!onlyInitialLaunch )
732
+ if (lShouldLoad )
727
733
{
728
- QueueAddon (ELoaderAction::Reload, tmpPath);
729
- }
730
- else
731
- {
732
- std::string msg = addon->Definitions ->Name ;
733
- msg.append (" " );
734
- msg.append (Language.Translate (" ((000079))" ));
735
- GUI::Alerts::Notify (msg.c_str ());
734
+ if (!onlyInitialLaunch)
735
+ {
736
+ QueueAddon (ELoaderAction::Reload, tmpPath);
737
+ }
738
+ else
739
+ {
740
+ std::string msg = addon->Definitions ->Name ;
741
+ msg.append (" " );
742
+ msg.append (Language.Translate (" ((000079))" ));
743
+ GUI::Alerts::Notify (msg.c_str ());
744
+ }
736
745
}
737
746
}
738
- else if (locked && shouldLoad && !addon->IsDisabledUntilUpdate ) // if addon is locked and not DUU
747
+ else if (locked && lShouldLoad && !addon->IsDisabledUntilUpdate ) // if addon is locked and not DUU
739
748
{
740
749
// the lock state is checked because if it will be locked it means it was unloaded, prior to checking for an update
741
750
0 commit comments