-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that modules fit on imported fits #512 #522 #538
Conversation
Hi, thanks for the pull request, will look into it tonight probably. But can you elaborate on the XML import bug that you mentioned? I wasn't aware there was an issue with it... |
Also, not sure if we need this bit for everything:
If we are making sure the module fits while we add it, then this should always return that the fit was fine, shouldn't it? The problem with this is that if someone imports a lot of fits at one (ie: from a backup), then this is going to recalculate all those fits, causing significant slowdown (untested, I can assume though =P). If there is a reason for it, sure, but I am unsure if this check would ever really do anything (this might be needed for t3 cruisers to check final module count? Unsure, really need tot est this later) |
The XML input bug: there was an uncaught exception at Line 497 in 4507495
encoding=None when trying to import from clipboard. I doubt many people try to import xml fits from clipboard, so I suspect that is why it hasn't come up before.
The code block: I used that block of code to stop multiple prop mods being set active in an import, isValidState doesn't check that by itself. |
Nice catch with the bug. I'm still hesitant with calculating the fit with every import however. I just think there is a smarter way to do it, we just gotta figure it out. Although, with my test database of 585 fits, it took 58 seconds to save vs 20 seconds without calculating them. It's not too bad (especially since it's only during large imports), but it's not great. We have
|
Actually, we might be able to look into using I actually need to go through and sort out the recalcs in a bunch of places. There are many times when we load a fit and it calculated it 3 times for some god awful reason. shrug |
Moved the |
The whole recalculation events are funky and there's no good way to do it right with what we have. The engine is a bit clunky right now. It would be good if we can do some introspection into the effect files to find out of a module affects a certain attribute, in which case we could then run that effect alone rather than the entire effect. Would be good for the Regardless, I've merged your changes and tweaked a bit - turns out we don't actually have to call recalc where you did as it's already called in the |
On import, modules will respect module quantity limits and hardpoints as well as activation limits.
Also minor bugfix to allow importing of XML loadouts via clipboard.
I only tested these with importing via clipboard, but they should work similarly for other styles. My test loadouts are here: https://gist.github.com/aacn500/e5ec75d4a2048506f4ae