@ -119,7 +119,6 @@ local function testRecordStore(store, storeName, skipPairs)
end)
testing.expectEqual(status,true,storeName)
end
localfunctiontestRecordStores()
@ -269,7 +268,7 @@ local function testCommitCrime()
testing.expectEqual(I.Crimes==nil,false,'Crimes interface should be available in global contexts')
-- Reset crime level to have a clean slate
types.Player.setCrimeLevel(player,0)
types.Player.setCrimeLevel(player,0)
testing.expectEqual(I.Crimes.commitCrime(player,{type=types.Player.OFFENSE_TYPE.Theft,victim=player,arg=100}).wasCrimeSeen,false,"Running the crime with the player as the victim should not result in a seen crime")
testing.expectEqual(I.Crimes.commitCrime(player,{type=types.Player.OFFENSE_TYPE.Theft,arg=50}).wasCrimeSeen,false,"Running the crime with no victim and a type shouldn't raise errors")
testing.expectEqual(I.Crimes.commitCrime(player,{type=types.Player.OFFENSE_TYPE.Murder}).wasCrimeSeen,false,"Running a murder crime should work even without a victim")
@ -280,11 +279,17 @@ local function testCommitCrime()
coroutine.yield()
-- Reset crime level for testing with a valid victim
types.Player.setCrimeLevel(player,0)
types.Player.setCrimeLevel(player,0)
testing.expectEqual(I.Crimes.commitCrime(player,{victim=victim,type=types.Player.OFFENSE_TYPE.Theft,arg=50}).wasCrimeSeen,true,"Running a crime with a valid victim should notify them when the player is not sneaking, even if it's not explicitly passed in")
testing.expectEqual(types.Player.getCrimeLevel(player),0,"Crime level should not change if the victim's alarm value is low and there's no other witnesses")