From ec97c69a03b20542a1fcd8db2f63ed0ccfadc868 Mon Sep 17 00:00:00 2001 From: DTB Date: Sat, 25 Nov 2023 11:17:06 -0700 Subject: [PATCH] now segfaults --- rogue/spec_hit.c | 8 ++++---- rogue/use.c | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/rogue/spec_hit.c b/rogue/spec_hit.c index bb99af9..114829f 100644 --- a/rogue/spec_hit.c +++ b/rogue/spec_hit.c @@ -44,6 +44,8 @@ * */ +#include /* rand(3) */ + #include "random.h" #include "rogue.h" @@ -442,9 +444,7 @@ drain_life(void) if (n != 1) { if ((rogue.str_current > 3) && (!sustain_strength)) { rogue.str_current--; - if (coin_toss()) { - rogue.str_max--; - } + rogue.str_max -= rand() & 1; } } print_stats((STAT_STRENGTH | STAT_HP)); @@ -475,7 +475,7 @@ flame_broil(object *monster) { short row, col, dir; - if ((!mon_sees(monster, rogue.row, rogue.col)) || coin_toss()) { + if ((!mon_sees(monster, rogue.row, rogue.col)) || (rand() & 1)) { return(0); } row = rogue.row - monster->row; diff --git a/rogue/use.c b/rogue/use.c index 52966fa..0dd3fc1 100644 --- a/rogue/use.c +++ b/rogue/use.c @@ -212,11 +212,10 @@ read_scroll(void) name_of(rogue.weapon), ((rogue.weapon->quantity <= 1) ? "s" : ""), get_ench_color()); - if (coin_toss()) { + if(rand() & 1) rogue.weapon->hit_enchant++; - } else { + else rogue.weapon->d_enchant++; - } } rogue.weapon->is_cursed = 0; } else {