Simplified some booleans and if elses

This commit is contained in:
BB
2022-03-01 20:37:47 +01:00
parent 570b8caf78
commit 0eced1b9f2
10 changed files with 15 additions and 48 deletions
+1 -8
View File
@@ -20,14 +20,7 @@ export function determineCrimeSuccess(p: IPlayer, type: string): boolean {
dialogBoxCreate(`ERR: Unrecognized crime type: ${type} This is probably a bug please contact the developer`);
return false;
}
if (Math.random() <= chance) {
//Success
return true;
} else {
//Failure
return false;
}
return Math.random() <= chance;
}
export function findCrime(roughName: string): Crime | null {