bool silent_yes()
{
- bool outcome;
+ bool outcome = false;
for (;;) {
char* reply = get_input();
exit(EXIT_SUCCESS);
// LCOV_EXCL_STOP
}
+ if (strlen(reply) == 0) {
+ free(reply);
+ rspeak(PLEASE_ANSWER);
+ continue;
+ }
char* firstword = (char*) xmalloc(strlen(reply) + 1);
sscanf(reply, "%s", firstword);
/* Print message X, wait for yes/no answer. If yes, print Y and return true;
* if no, print Z and return false. */
{
- bool outcome;
+ bool outcome = false;
for (;;) {
speak(question);
// LCOV_EXCL_STOP
}
+ if (strlen(reply) == 0) {
+ free(reply);
+ rspeak(PLEASE_ANSWER);
+ continue;
+ }
+
char* firstword = (char*) xmalloc(strlen(reply) + 1);
sscanf(reply, "%s", firstword);
from = game.fixed[object - NOBJECTS];
else
from = game.place[object];
- if (from != LOC_NOWHERE && from != CARRIED && !SPECIAL(from))
+ /* (ESR) Used to check for !SPECIAL(from). I *think* that was wrong... */
+ if (from != LOC_NOWHERE && from != CARRIED)
carry(object, from);
drop(object, where);
}