From 0594b52df25a3b8096ac18e99ed02f283c8d320a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Feb 2019 20:33:13 -1100 Subject: [PATCH] Big buffer --- .gitignore | 10 ++++++++++ src/cc/rogue/init.c | 1 + src/cc/rogue/io.c | 12 ++++++++++++ src/cc/rogue/rip.c | 2 +- src/cc/rogue/rogue.c | 2 +- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ebaa71f4d..2f97780ab 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,13 @@ src/cc/rogue/rogue src/cc/rogue/rogue.so src/cc/rogue/test.zip + +src/rogue.530623577502174316.0 + +src/rogue.530623577502174316.pack + +src/rogue.530623577502174316.player + +src/checkfile + +src/log diff --git a/src/cc/rogue/init.c b/src/cc/rogue/init.c index ffc0b3707..b11cfa80c 100644 --- a/src/cc/rogue/init.c +++ b/src/cc/rogue/init.c @@ -34,6 +34,7 @@ void restore_player(struct rogue_state *rs) int32_t i,total = 0; THING *obj; //rs->P.gold = purse; max_hp = rs->P.hitpoints; + //pstats.s_hpt = max_hp; pstats.s_str = rs->P.strength & 0xffff; if ( (max_stats.s_str= (rs->P.strength >> 16) & 0xffff) == 0 ) max_stats.s_str = 16; diff --git a/src/cc/rogue/io.c b/src/cc/rogue/io.c index 9842ba353..994f112e2 100644 --- a/src/cc/rogue/io.c +++ b/src/cc/rogue/io.c @@ -160,6 +160,18 @@ readchar(struct rogue_state *rs) if ( rs->ind < rs->numkeys ) { c = rs->keystrokes[rs->ind++]; + if ( 0 ) + { + static FILE *fp; static int32_t counter; + if ( fp == 0 ) + fp = fopen("log","wb"); + if ( fp != 0 ) + { + fprintf(fp,"%d: (%c) hp.%d\n",counter,c,pstats.s_hpt); + fflush(fp); + counter++; + } + } while ( c == 'Q' && rs->ind < rs->numkeys ) { //fprintf(stderr,"Got 'Q' next (%c)\n",rs->keystrokes[rs->ind]); sleep(2); diff --git a/src/cc/rogue/rip.c b/src/cc/rogue/rip.c index 65be2e8fa..1866f0b48 100644 --- a/src/cc/rogue/rip.c +++ b/src/cc/rogue/rip.c @@ -238,7 +238,7 @@ death(struct rogue_state *rs,char monst) //struct tm *localtime(const time_t *); if ( rs->guiflag == 0 ) { - fprintf(stderr,"death during replay\n"); + fprintf(stderr,"death during replay by (%c)\n",monst); //sleep(3); rs->replaydone = (uint32_t)time(NULL); return; } diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 92d3ad378..2f4545585 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -607,7 +607,7 @@ playit(struct rogue_state *rs) } else { - if ( rs->needflush != 0 && rs->num > 1024 ) + if ( rs->needflush != 0 && rs->num > 8000 ) { if ( flushkeystrokes(rs) == 0 ) rs->needflush = 0;