Reduce gotos & labels
This commit is contained in:
parent
86e75219e3
commit
d2424771e3
1 changed files with 20 additions and 18 deletions
10
actions2.c
10
actions2.c
|
@ -140,7 +140,7 @@ L9028: game.prop[VASE]=2;
|
|||
|
||||
int attack(FILE *input, long obj, long verb) {
|
||||
I=ATDWRF(game.loc);
|
||||
if (obj != 0) goto L9124;
|
||||
if (obj == 0) {
|
||||
if (I > 0)obj=DWARF;
|
||||
if (HERE(SNAKE))obj=obj*NOBJECTS+SNAKE;
|
||||
if (AT(DRAGON) && game.prop[DRAGON] == 0)obj=obj*NOBJECTS+DRAGON;
|
||||
|
@ -148,7 +148,7 @@ int attack(FILE *input, long obj, long verb) {
|
|||
if (AT(OGRE))obj=obj*NOBJECTS+OGRE;
|
||||
if (HERE(BEAR) && game.prop[BEAR] == 0)obj=obj*NOBJECTS+BEAR;
|
||||
if (obj > NOBJECTS) return(8000);
|
||||
if (obj != 0) goto L9124;
|
||||
if (obj == 0) {
|
||||
/* Can't attack bird or machine by throwing axe. */
|
||||
if (HERE(BIRD) && verb != THROW)obj=BIRD;
|
||||
if (HERE(VEND) && verb != THROW)obj=obj*NOBJECTS+VEND;
|
||||
|
@ -156,14 +156,16 @@ int attack(FILE *input, long obj, long verb) {
|
|||
* no harm done. */
|
||||
if (HERE(CLAM) || HERE(OYSTER))obj=NOBJECTS*obj+CLAM;
|
||||
if (obj > NOBJECTS) return(8000);
|
||||
L9124: if (obj == BIRD) {
|
||||
}
|
||||
}
|
||||
if (obj == BIRD) {
|
||||
SPK=137;
|
||||
if (game.closed) return(2011);
|
||||
DSTROY(BIRD);
|
||||
game.prop[BIRD]=0;
|
||||
SPK=45;
|
||||
}
|
||||
L9125: if (obj == VEND) {
|
||||
if (obj == VEND) {
|
||||
PSPEAK(VEND,game.prop[VEND]+2);
|
||||
game.prop[VEND]=3-game.prop[VEND];
|
||||
return(2012);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue