mtgred / netrunner

http://www.jinteki.net
Other
888 stars 388 forks source link

Punitive Counterstrike when runner stole no agendas freezes the interface #550

Closed dtelad11 closed 9 years ago

dtelad11 commented 9 years ago

Played a game of Hayley versus Jinteki: PE. Jinteki player played Punitive Counterstrike (I have stolen no agendas the previous turn). He put 0c on the trace (total of 5), then I clicked "ok" to put 0c -- but the nothing happened, the Punitive Counterstrike interface remained on and we could not continue the game.

queueseven commented 9 years ago

From looking at the code, I guess [:register :stole-agenda] is nil when Punitive Counterstrike does the :meat damage. In the damage-count the + function then throws a null pointer exception.

While it's easy to change (-> n to (-> (if (nil? n) 0 n) in the damage-count function, I think PC should do simply nothing in the case [:register :stole-agenda] is < 0 or nil; otherwise, a scored The Cleaners would do 1 meat damage when in fact no agendas where stolen.

mtgred commented 9 years ago

Thanks for reporting the issue. It has been fixed and will be deployed with the next server update.

@queueseven It's indeed the problem.

JoelCFC25 commented 9 years ago

Fixed at https://github.com/mtgred/netrunner/commit/af39d728fac4908f13b9149a181e8656fffc3c2b.

queueseven commented 9 years ago

Actually, playing PC is legal when The Cleaners are scored and no agendas stolen: https://twitter.com/RukasuFox/status/634838036178710528

JoelCFC25 commented 9 years ago

He seems to have been convinced otherwise: https://twitter.com/ANR_RulesWiki/status/634854445235355648

queueseven commented 9 years ago

Good. Makes more sense this way.