ho-dev / HattrickOrganizer

Assistant for Hattrick online football manager
https://ho-dev.github.io/HattrickOrganizer/
GNU Lesser General Public License v3.0
195 stars 79 forks source link

[eBUG] Training is only applied to subbed-off players #431

Closed dominiquelee closed 4 years ago

dominiquelee commented 4 years ago

On 2.100, on a fresh account with only a few HRFs: image My training looks like this, where 10 players should have been impacted: image 3 full trainings (only to those that played on Wedsneday a 120-minute game and were subbed-off at 90' (657739486)) and 3 osmosis (all 3 played both matches).

This might be related to #278 and #306

PS: XP is similar.

github-actions[bot] commented 4 years ago

Hey, thanks for opening your first issue! 🙂 \nBe sure to check out the wiki and the HT forum for support.

wsbrenk commented 4 years ago

520 could be the fix concerning experience failure

wsbrenk commented 4 years ago

tried to reproduce with v3.0:

on 6.5.2020 my team had a penalty shot out in a friendly match and Wilbert Pander entered in minute 90 for Pit Drexler.

Situation in HO before training is: wpbeforetraining

situation on 8.5 (after training) is:

wpaftertraining

in this case pander got training.

wsbrenk commented 4 years ago

@dominiquelee could you try to verify if this is still an issue in v3. are the training effects OK if you run a recalc of the subskills?

wsbrenk commented 4 years ago

zusammen

many things were happening in minute 90 - maybe this might be a problem!?!?

dominiquelee commented 4 years ago

I won't be able to test it until this week-end, but if you want to do it, here are the relevant hrf: 9059-2020-03-25.zip

wsbrenk commented 4 years ago

@dominiquelee thank you, your files were helpful

but the hrf file do not contain the match information which are necessary to examine the training effect. if you could upload your db folder, i could do further tests.

wsbrenk commented 4 years ago

522 did some changes on minutes calculation concerning subskills

wsbrenk commented 4 years ago

@akasolace found this in MatchStatistics.getMatchEndMinute

... MatchEventID me = MatchEventID.fromMatchEventID(hls.get(i).getiMatchEventID()); if (me == MatchEventID.MATCH_FINISHED){endMinute = hls.get(i).getMinute();} else if ((me == MatchEventID.RED_CARD_2ND_WARNING_NASTY_PLAY || me == MatchEventID.RED_CARD_2ND_WARNING_CHEATING || me == MatchEventID.RED_CARD_WITHOUT_WARNING || me == MatchEventID.MODERATELY_INJURED_LEAVES_FIELD || me == MatchEventID.BADLY_INJURED_LEAVES_FIELD || me == MatchEventID.INJURED_AND_NO_REPLACEMENT_EXISTED || me == MatchEventID.INJURED_AFTER_FOUL_AND_EXITS) && hls.get(i).getSpielerID() == spielerId) {endMinute = hls.get(i).getMinute();}} return endMinute;

you are the expert on MatchEvents. do you think that there could be some changes that hurts this minute calculation? I would suggest a method near to MatchEvent called isPlayerLeaveMatchEvent or something like this.

wsbrenk commented 4 years ago

as first approach i added INJURED_AFTER_FOUL_AND_NO_REPLACEMENT_EXISTED

wsbrenk commented 4 years ago

next are KEEPER_INJURED_FIELD_PLAYER_HAS_TO_TAKE_HIS_PLACE and INJURED_PLAYER_REPLACED i hope these events will make a entry in the list of substitutions and next question is: isn't that the same with _LEAVES_FIELD event and only the events _NO_REPLACEMENT_EXISTED and card events should be handled as NONE substitution events?

wsbrenk commented 4 years ago

isInjured() || isRedCard() will do the job?!

dominiquelee commented 4 years ago

Sorry for the delay, here's the db: db_singleUser-2020-6-11.zip

wsbrenk commented 4 years ago

@dominiquelee thanks a lot - i found a bug. I have to check whether this is responsible for your ticket.