Project

General

Profile

Bug #1193

AddonLoader fails to load >1 KSPAddons with once=true and the same start scene parameter

Added by Majiir over 11 years ago. Updated almost 11 years ago.

Status:
Duplicate
Severity:
Normal
Assignee:
-
Category:
Plugins/Add-Ons
Target version:
-
Start date:
08/07/2013
% Done:

100%

Version:
Platform:
Any
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

If multiple KSPAddons have the same start scene parameter and have set the "once" parameter to true, only the first addon seen will load, and the others will silently fail. This causes mods which use once=true to conflict.

The issue is caused by the way AddonLoader tracks already-once-loaded addons. It adds a KSPAddon to a list, and it checks that list whenever it's loading a new KSPAddon, but KSPAddon does not override Equals, so it defaults to Attribute.Equals which performs a value type comparison. This means that any addon with the same start scene and "once" parameter will be considered equal, and the loader will skip it.

To reproduce: Create two classes tagged with KSPAddons with the same start scene and once=true. Only one addon will load, while the other silently fails.

To fix: Change AddonLoader's internal List<KSPAddon> to List<Type> and store the type of each addon class as it's run.

I've also written about this issue here: http://forum.kerbalspaceprogram.com/showthread.php/45107-KSPAddon-bug-causes-mod-incompatibilities

History

#1 Updated by Majiir over 11 years ago

  • Status changed from New to Duplicate
  • % Done changed from 0 to 100

Whoops. Duplicate of #1176.

#2 Updated by m4v almost 11 years ago

#1176 seems to not exist?

Also available in: Atom PDF