Fixed logic, documented it in notes and tests

This commit is contained in:
NHOrus 2017-07-02 17:50:42 +03:00
parent e91742e1b9
commit 29672a6447
4 changed files with 29 additions and 4 deletions

View file

@ -528,7 +528,9 @@ static int extinguish(token_t verb, int obj)
obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_LIT)
obj = URN;
if (obj == INTRANSITIVE)
if (obj == INTRANSITIVE ||
HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT &&
HERE(URN) && game.prop[URN] == URN_LIT)
return GO_UNKNOWN;
}
@ -739,7 +741,9 @@ static int light(token_t verb, token_t obj)
obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_DARK)
obj = URN;
if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
if (obj == INTRANSITIVE ||
HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0 &&
HERE(URN) && game.prop[URN] == URN_DARK)
return GO_UNKNOWN;
}