From: Eric S. Raymond Date: Tue, 19 Sep 2006 08:28:19 +0000 (+0000) Subject: Fix two minor bugs, one in the shove code and one in debugme(). X-Git-Tag: 2.0~236 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=b3d872bf30cc6b7e4a0b88f0580c2f5e35ccaf2d;p=super-star-trek.git Fix two minor bugs, one in the shove code and one in debugme(). --- diff --git a/TODO b/TODO index 57dd604..5d5eebc 100644 --- a/TODO +++ b/TODO @@ -1,73 +1,5 @@ Super Star Trek TO-DO list -Bugs: - ------------------------------------------------------------------------------ - Short-range scan - 1 2 3 4 5 6 7 8 9 10 - 1 E . . . . . . . . . Stardate 3800.9, Time Left 6.14 - 2 . . . . . . . . . C Condition RED, 0 DAMAGES - 3 . @ . * . . . . . . Position 1 - 3 , 1 - 1 - 4 . . . . . . . . . . Life Support ACTIVE - 5 . . . . . . . . . . Warp Factor 5.0 - 6 . . . . . . . . . . Energy 3871.68 - 7 . . . . * . . . . . Torpedoes 10 - 8 . . . . . . . . . . Shields UP, 92% 2294.3 units - 9 . . . . . . R . . . Klingons Left 8 -10 . . . . . . * . . . Major system Capella IV (Kohath) - - -COMMAND> phot 2 -Target sector for torpedo number 1- 2 10 -Target sector for torpedo number 2- 2 10 - -***Commander at Sector 2 - 10 damaged-- displaced by blast to Sector 3 - 10 - - -***Commander at Sector 2 - 10 destroyed. -=== ATTACK! - -***TORPEDO INCOMING From Unknown?? at Sector 3 - 10 - -Torpedo missed. ------------------------------------------------------------------------------ - -Here's the log that reproduces it - ------------------------------------------------------------------------------ -seed 1158606492 -sr -phasers -auto -391 -sensors -planets -lr -chart -probe -y -n -a -1 8 -shields up -sr -m a 10 10 - -chart -m a 1 3 1 1 - -n -chart -sr -phot 2 -2 10 -2 10 ------------------------------------------------------------------------------ - -The bug is the 'Unknown??' in the incoming-torpedo message. What -happened here is that the Commander launched a torp just before being -killed. The torpedo knows its origin but not who fired it. - Short-term items: * Adjust the sst.spec wrt the build system changes diff --git a/src/battle.c b/src/battle.c index 2977e6b..22cc136 100644 --- a/src/battle.c +++ b/src/battle.c @@ -423,10 +423,8 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int i, int setwnd(message_window); } if (shoved) { - coord w; - w.x = jx; w.y = jy; - game.quad[jx][jy]=iquad; game.quad[w.x][w.y]=IHDOT; + game.quad[jx][jy]=iquad; prout(_(" displaced by blast to %s "), cramlc(sector, w)); for_local_enemies(ll) game.kdist[ll] = game.kavgd[ll] = sqrt(square(game.sector.x-game.ks[ll].x)+square(game.sector.y-game.ks[ll].y)); diff --git a/src/sst.c b/src/sst.c index 7fbbfc2..021e3d9 100644 --- a/src/sst.c +++ b/src/sst.c @@ -909,20 +909,23 @@ void debugme(void) chew(); proutn("In quadrant- "); key = scan(); - if (key != IHREAL) { - prout("Event %d canceled, no y coordinate.", i); - unschedule(i); - continue; + /* IHEOL says to leave coordinates as they are */ + if (key != IHEOL) { + if (key != IHREAL) { + prout("Event %d canceled, no x coordinate.", i); + unschedule(i); + continue; + } + w.x = (int)aaitem; + key = scan(); + if (key != IHREAL) { + prout("Event %d canceled, no y coordinate.", i); + unschedule(i); + continue; + } + w.y = (int)aaitem; + ev->quadrant = w; } - w.y = (int)aaitem; - key = scan(); - if (key != IHREAL) { - prout("Event %d canceled, no x coordinate.", i); - unschedule(i); - continue; - } - w.x = (int)aaitem; - ev->quadrant = w; } } }