Skip to content
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

Overheated projection modules on projected fits are applied twice to projectee #119

Closed
DarkFenX opened this issue Jun 4, 2014 · 5 comments

Comments

@DarkFenX
Copy link
Member

DarkFenX commented Jun 4, 2014

  1. Have a claw with SA-706 implant and quafe ultra
  2. Project scorpion with 8 t2 scanres-scripted rsbs onto it

Pyfa shows 9407 scanres, while actually ingame it is 7857

@blitzmann
Copy link
Collaborator

I'm actually getting 6510 on the claw with All V for both the Claw and Scorpion. Can you clarify?

@DarkFenX
Copy link
Member Author

Forgot to say that RSBs need to be heated. In this case pyfa shows 9407, while ingame i had other value.

@blitzmann
Copy link
Collaborator

Adding this:

if "projected" not in context:
    return

to the overloadSelfSensorModuleBonus fixes it for projected modules, however it (of course) breaks the overload effect for Sensor Boosters.

This tells me that this effect is being applied twice somewhere in the projection logic (:sigh:), once with a module context, another with a projected context, causing the inflated value.

Confirmed: putting a print statement in that effect file (and one in the recalc function):

===========recalc===========
('module',)
('projected', 'module')

whereas a normal overloaded projected remote sensor booster would only show:

===========recalc===========
('projected', 'module')

@blitzmann
Copy link
Collaborator

Actually, this seems to happen with any projected module that is overheated. Tested with unscripted overheated remote sensor damp which should decrease lockrange -23% giving a lock range (to otherwise module-less Claw) of 21.6km, but instead it shows 20.4km.

Also tested with Remote Shield Booster with similar results.

@blitzmann blitzmann changed the title Wrong scanres with RSBs applied Overheated projection modules on projected fits are applied twice to projectee Sep 29, 2014
@blitzmann
Copy link
Collaborator

Well this was a pain in the ass, but I seem to have figured it out.

for item in c:
    # Registering the item about to affect the fit allows us to track "Affected By" relations correctly
    if item is not None:
    self.register(item)
    item.calculateModifiedAttributes(self, runTime, False)
    if forceProjected is True:
        targetFit.register(item)
        item.calculateModifiedAttributes(targetFit, runTime, True)

Basically, when doing projected fits, pyfa calculates the modules effectiveness based on the projected fit's stats (so that ship bonuses and character skills are taken into effect)(this is the item.calculateModifiedAttributes(self, runTime, False) line). This runs both the overload effect as well as the normal effect.

Then it checks to see if we're dealing with projections (if forceProjected is True) and, if so, we calculate the module with it's new stats onto the fit we're projecting it onto. However, this runs through the exact same process: running overload and then normal effect. Running the overload effect on already-modified stats amplifies the stats accordingly.

My fix is to simply note when we are dealing with a projected module from a fit rather than a standalone projected module. This data is already available: forceProjected in Module.calculateModifiedAttributes() is set when we're dealing with fit-based projected. Check against this flag to skip the overload effect.

w9jds pushed a commit to w9jds/Pyfa that referenced this issue Aug 14, 2017
Enhancement: Adjust windows sizes based on font size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants