netrunner icon indicating copy to clipboard operation
netrunner copied to clipboard

Recurring credits on hosted cards do not refresh

Open josemgarcia opened this issue 11 years ago • 6 comments

When programs that have recurring credits (e.g. Paricia) are installed hosted in another program (e.g. Scherezade or Leprechaun), the recurring credits are not refreshed when the turn begins.

I think it may also happen in other cases, so it may be actually worth to take into account for solving #362

josemgarcia avatar Sep 13 '15 22:09 josemgarcia

I've tested this both on the live server and in my dev environment and can't reproduce it so far. I tried a Scrubber hosted on Off-Campus Apartment and Paricia hosted on a Leprechaun--in both cases if credits had been taken on a previous turn from them, they refreshed to the correct amount at the start of the next Runner turn.

JoelCFC25 avatar Sep 14 '15 14:09 JoelCFC25

I was having the issue in two consecutive games with Scherezade, and I believe it was only when hosting the program after installing it, that is installing normally and then hosting on Scherezade.

José M. García El 14/9/2015 4:33 p. m., "Joel Koepp" [email protected] escribió:

I've tested this both on the live server and in my dev environment and can't reproduce it so far. I tried a Scrubber hosted on Off-Campus Apartment and Paricia hosted on a Leprechaun--in both cases if credits had been taken on a previous turn from them, they refreshed to the correct amount at the start of the next Runner turn.

— Reply to this email directly or view it on GitHub https://github.com/mtgred/netrunner/issues/712#issuecomment-140099908.

josemgarcia avatar Sep 14 '15 22:09 josemgarcia

I also have seen this issue with Sahasrara installed on scherezade. The first one does not refresh but when i installed a second that one refreshed.

Balkmeister avatar Sep 15 '15 07:09 Balkmeister

The issue is the following (just from reading the source code):

The host function removes all events from a card, does the hosting mumbo jumbo, and calls:

(when-let [events (:events (card-def target))]
    (when installed
         (register-events state side events c)))

to re-register the events of the card. The problem is that the recurring credit reloading is also triggered with an event, but the event isn't in the card definition (from card-def), but is created on-the-fly in card-init.

When installing a card, after the host function is called in runner-install, card-init is called, so recurring credits work if a card is directly installed onto a host.

I think instead of re-registering the events, host should maybe also call card-init with resolve = false.

queueseven avatar Sep 15 '15 07:09 queueseven

I might be able to take this on, having been working with recurring credits.

justinliew avatar Oct 23 '15 16:10 justinliew

Fixed at #840.

JoelCFC25 avatar Nov 18 '15 14:11 JoelCFC25