make hacking not abortable by NPCs

This commit is contained in:
nek0 2018-09-01 18:27:18 +02:00
parent 6c54aabc94
commit 8d2aba5f7b

View file

@ -187,21 +187,24 @@ instance ObjectAction ObjType ObjState where
}
return e
objectTransition ObjComputer "hack" pa ent = do
[e] <- efor (anEnt ent) $ do
let nstat = AnimState
(AnimId "computer" "off" N)
0
0
ost <- query objStateTime
return unchanged
{ anim = Set nstat
, objState = Set "off"
, objPlayerActivated = Unset
, objStateTime = Unset
, objSolved = if pa then Set (ost < 0) else Keep
}
return e
objectTransition ObjComputer "hack" pa ent =
if pa
then do
[e] <- efor (anEnt ent) $ do
let nstat = AnimState
(AnimId "computer" "off" N)
0
0
ost <- query objStateTime
return unchanged
{ anim = Set nstat
, objState = Set "off"
, objPlayerActivated = Unset
, objStateTime = Unset
, objSolved = if pa then Set (ost < 0) else Keep
}
return e
else return unchanged
objectTransition _ _ _ _ = return unchanged