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

Recurring credits on hosted cards do not refresh #712

Closed
josemgarcia opened this issue Sep 13, 2015 · 6 comments
Closed

Recurring credits on hosted cards do not refresh #712

josemgarcia opened this issue Sep 13, 2015 · 6 comments
Labels

Comments

@josemgarcia
Copy link

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

@JoelCFC25
Copy link
Collaborator

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.

@josemgarcia
Copy link
Author

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
#712 (comment).

@Balkmeister
Copy link

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.

@queueseven
Copy link
Collaborator

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.

@justinliew
Copy link
Contributor

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

@JoelCFC25
Copy link
Collaborator

Fixed at #840.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants