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 ++ add
|= [=ship =resource] |= [=ship =resource]
~| resource ~| resource
?< (~(has by tracking) resource) ?: (~(has by tracking) resource)
[~ state]
=. tracking =. tracking
(~(put by tracking) resource ship) (~(put by tracking) resource ship)
:_ state :_ state