IllusionMods / IllusionModdingAPI

Modding API for games made by Illusion (PHAPI / KKAPI / ECAPI / AIAPI / HS2API / KKSAPI)
https://www.patreon.com/ManlyMarco
GNU Lesser General Public License v3.0
260 stars 44 forks source link

Reorder GameApi.GetCurrentHeroine code to work with some edge cases #58

Closed IDontHaveIdea closed 2 years ago

IDontHaveIdea commented 2 years ago

Hi,

GetCurrentHeroine() almost always fail to get the correct heroine when the heroine ask for sex and/or when the player start interaction with the heroine when she is masturbating.

The changes are:

  1. Try first to see if an H scene is active and get heroine using HFlag extension this takes care when heroine ask for sex.
  2. When checking with GetADVScene() first check if advScene.nowScene is a TalkScene this takes care of the masturbation case.

Any other case behaves the same returning the correct heroine when there was one currently in focus.

While debugging I always checked what every method result was.

PS: Noted that also fails if the girl start talk with player.