fix bug where selecting the same layout for a shipyard discarded the current progress and buffers
This commit is contained in:
@@ -15,8 +15,23 @@ struct PlacedModule
|
||||
Rotation rotation;
|
||||
};
|
||||
|
||||
inline bool operator==(const PlacedModule& a, const PlacedModule& b)
|
||||
{
|
||||
return a.moduleId == b.moduleId && a.position == b.position && a.rotation == b.rotation;
|
||||
}
|
||||
|
||||
// The complete module configuration for a shipyard's current ship (REQ-MOD-CONFIG).
|
||||
struct ShipLayoutConfig
|
||||
{
|
||||
std::vector<PlacedModule> placedModules;
|
||||
};
|
||||
|
||||
// Deliberately order-sensitive: two layouts holding the same modules in a different
|
||||
// vector order compare unequal. This only decides whether applying a layout is a no-op
|
||||
// (REQ-MAT-INPUT-BUFFER), so the conservative answer is the safe one -- reporting a
|
||||
// change that is not one costs a buffer reset, reporting no change when there is one
|
||||
// would leave the shipyard stale.
|
||||
inline bool operator==(const ShipLayoutConfig& a, const ShipLayoutConfig& b)
|
||||
{
|
||||
return a.placedModules == b.placedModules;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user