Skip to content

Commit

Permalink
Fix child robot privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed May 3, 2024
1 parent db920df commit 5491cf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/swarm-engine/Swarm/Game/Step/Const.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ execConst runChildProg c vs s k = do
checkRequirements parentInventory childInventory childDevices cmd subject fixI = do
currentContext <- use $ robotContext . defReqs
em <- use $ landscape . terrainAndEntities . entityMap
creative <- use creativeMode
privileged <- isPrivilegedBot
let -- Note that _capCtx must be empty: at least at the
-- moment, definitions are only allowed at the top level,
-- so there can't be any inside the argument to build.
Expand Down Expand Up @@ -1542,7 +1542,7 @@ execConst runChildProg c vs s k = do
-- already has.
missingChildInv = reqInv `E.difference` childInventory

if creative
if privileged
then
return
( -- In creative mode, just equip ALL the devices
Expand Down
3 changes: 1 addition & 2 deletions test/integration/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ import Swarm.Util.Yaml (decodeFileEitherE)
import System.FilePath.Posix (splitDirectories)
import System.Timeout (timeout)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.ExpectedFailure (expectFailBecause)
import Test.Tasty.HUnit (Assertion, assertBool, assertEqual, assertFailure, testCase)
import Witch (into)

Expand Down Expand Up @@ -309,7 +308,7 @@ testScenarioSolutions rs ui =
, testSolution Default "Testing/201-require/201-require-entities-def"
, testSolution Default "Testing/201-require/533-reprogram-simple"
, testSolution Default "Testing/201-require/533-reprogram"
, expectFailBecause "Fix #1664" $ testSolution Default "Testing/201-require/1664-require-system-robot-children"
, testSolution Default "Testing/201-require/1664-require-system-robot-children"
]
, testSolution Default "Testing/479-atomic-race"
, testSolution (Sec 5) "Testing/479-atomic"
Expand Down

0 comments on commit 5491cf1

Please sign in to comment.