pull-hook: no-op on double add

If we receive an %add poke for a resource we are already pulling, no-op
instead of crashing. This should prevent crashes upon repulling a
resource after a breach of the host.
This commit is contained in:
Liam Fitzgerald 2020-08-17 12:47:40 +10:00
parent 516423b853
commit f658d99c76

View File

@ -225,7 +225,8 @@
++ add
|= [=ship =resource]
~| resource
?< (~(has by tracking) resource)
?: (~(has by tracking) resource)
[~ state]
=. tracking
(~(put by tracking) resource ship)
:_ state