summaryrefslogtreecommitdiffstats
path: root/battlestar
Commit message (Collapse)AuthorAgeFilesLines
...
* Make functions local to parse.c static.jsm2000-09-242-9/+10
|
* Give a better message for trying to eat things it doesn't make sensejsm2000-09-241-7/+11
| | | | | | to eat. For something eatable, check first whether you're holding it, then whether you have a knife, then whether you're stuffed (gives better message for "eat coconuts" when you don't have any). From OpenBSD.
* Clean up fly.c by making local variables and functions static andjsm2000-09-242-23/+23
| | | removing abs() macro.
* Prevent CUMBER from going negative; avoid division by zero if it isjsm2000-09-242-7/+14
| | | zero.
* Attempt to disambiguate BODY for kicking. Avoid crashing or nonsensejsm2000-09-241-30/+55
| | | messages on "kick door" and "kick man". From OpenBSD.
* Allow for bathing goddess in love(); give better message for a loverjsm2000-09-231-13/+24
| | | that isn't present and for certain choices of lover. From OpenBSD.
* Allow for the bathing goddess in ravage(). From OpenBSD.jsm2000-09-231-4/+8
|
* Use a lookup table to identify whether objects are plural or singular,jsm2000-09-235-26/+41
| | | | instead of testing the final character against 's' in each place. Avoids oddities about "pot of jewels" and "compass".
* Don't say "Kicked." of an object not present; give sensible messages.jsm2000-09-221-3/+7
| | | From OpenBSD.
* Check for an object being taken not being there before checking forjsm2000-09-221-5/+5
| | | | whether it is too heavy or too bulky; gives a better message for "take viper" with the viper not present.
* Give appropriate messages (rather than saying nothing) if an verb isjsm2000-09-221-2/+48
| | | used with "all" and nothing relevant is present. From OpenBSD.
* Remove all adjectives in parse(), since they are nowhere used. Fixesjsm2000-09-226-28/+33
| | | | crash on "carry old all" shown up by fuzz testing. Patch from Paul Janzen <pjanzen@foatdi.harvard.edu>.
* Give an appropriate error on "kill all" rather than a crash orjsm2000-09-221-3/+4
| | | nonsense message. From OpenBSD.
* Various improvements to parsing in battlestar, mostly from OpenBSD.jsm2000-09-217-24/+99
| | | | | | | | | | | | | | | | | | | | Define a constant WORDLEN. Always use this constant and NWORD where appropriate. Use NWORD - 1 in battlestar.c to avoid off-by-one error. Increment wordnumber after the INVEN verb to allow it to be followed by a comma and other actions. Avoid overflowing elements of the words array if input words are too long. Parse "," as AND except when followed by a verb, to allow such constructions as "take foo, bar, and baz". Trim AND AND which may occur from the ", and" in such a list. Avoid crashes from EVERYTHING in the wrong place by moving it to the start of OBJECT AND EVERYTHING and NOUNS AND EVERYTHING sequences, and trimming EVERYTHING AND EVERYTHING.
* Don't try to wear anything that isn't OBJECT or NOUNS. Don't try tojsm2000-09-211-3/+6
| | | | | | wear DOOR or anything without a short description. Fixes crashes on "wear knfo" (bug reported by Peter Maydell <pmaydell@chiark.greenend.org.uk>), "wear wear", "wear kick", "wear door" and "wear goddess". Partly from OpenBSD.
* If no hand-to-hand weapons are available, try using the laser to killjsm2000-09-211-5/+31
| | | in murder(). From OpenBSD.
* die() on EOF; based on OpenBSD.jsm2000-09-211-2/+4
|
* From OpenBSD: in kiss(), "take" the bathing goddess if required, andjsm2000-09-211-30/+39
| | | give a better error message if the person to kiss is not present.
* Add missing initialisers (avoid gcc -W warnings) and comments givingjsm2000-09-182-556/+1106
| | | room numbers.
* Clean up formatting; partly from OpenBSD.jsm2000-09-177-240/+209
|
* Patches from OpenBSD: add verbs "open"/"unlock" (essentially a no-op),jsm2000-09-176-12/+85
| | | | | and "verbose"/"brief" (in verbose mode, always show long room descriptions), and synonyms "papaya" for "papayas" and "coconut" for "coconuts".
* Based on OpenBSD: spelling, punctuation, grammar and line lengthjsm2000-09-103-27/+32
| | | | adjustments, and support for '=' in room descriptions meaning a literal '-'.
* Wording, punctuation and line length improvements. Also adjust testjsm2000-09-107-26/+26
| | | | for killing nonsensical things to fix crash with "kill door". From OpenBSD.
* Make spacing nicer and add explicit NULL initializers.jsm2000-09-091-167/+167
|
* Store copy of username with strdup rather than using a fixed lengthjsm2000-09-093-19/+23
| | | buffer. Also make initialization functions and arrays static.
* Put prototypes in alphabetical order.jsm2000-09-091-7/+7
|
* Spelling and punctuation corrections or improvements from OpenBSD.jsm2000-09-086-28/+28
|
* Make code clearer; add a macro ROOMDESC for the number of times a roomjsm2000-09-083-10/+17
| | | | should be visited for the short description only to be used, and don't increment beenthere[position] beyond this value. From OpenBSD.
* Manpage improvements based on OpenBSD.jsm2000-09-081-7/+27
|
* Rename move() to moveplayer() to avoid clashing with libcurses.mycroft2000-07-234-20/+20
|
* Use setgid(), not setregid().mycroft2000-05-081-3/+3
|
* Use err(1, NULL) and warn(NULL) for `out of memory' error messages.jsm2000-01-091-5/+5
|
* Fix -Wsign-compare warnings.jsm1999-09-182-6/+6
|
* Use strncpy() rather than strcpy() with fixed size buffer.jsm1999-09-181-3/+3
|
* Add missing initialisers.jsm1999-09-182-6/+6
|
* Add FALLTHROUGH comment.jsm1999-09-181-2/+3
|
* Give sensible error message in a shouldn't happen case.jsm1999-09-181-3/+3
|
* Declare variables in extern.h as extern, and add non-externjsm1999-09-142-42/+78
| | | declarations to globals.c.
* Use time() instead of gettimeofday().jsm1999-09-142-10/+7
|
* Fix uses of names of library functions for other purposes.jsm1999-09-133-9/+9
|
* A couple more checks for file descriptor < 3 missed earlier.jsm1999-09-131-2/+4
|
* Add `__noreturn__' and `__unused__' attributes where appropriate tojsm1999-09-082-7/+7
| | | | | | | | | | | | the games. This merges in all such remaining changes from the Linux port of the NetBSD games, except in hunt (where substantial changes from OpenBSD need to be looked at). Most noreturn attributes were previously added in bin/6144, with some others that were missed then in bin/8082. Previous `unused' attributes were covered in bin/6557, bin/8058 and other PRs (all these PRs have already been handled and closed).
* This patch improves the handling of save files in battlestar(6), byhubertf1999-07-286-44/+119
| | | | | | | | | | allowing the user to choose the name of the save file and specify it on the command line when restoring. It also eliminates a buffer overrun in determining the path to the save file, and any particular arbitrary limit on the name length. In the name of a tidier home directory, the default name is changed from "Bstar" to ".Bstar". Patch supplied in PR 8085 by Joseph Myers <jsm28@cam.ac.uk> Minor modification (s/startup/filename/ in initialize()) by me.
* Drop setgid privileges early. Derived from OpenBSD and sent in as PR 5970hubertf1999-07-213-13/+25
| | | by Joseph Myers <jsm28@cam.ac.uk>.
* From PR 7987 by Joseph Myers <jsm28@cam.ac.uk>:hubertf1999-07-146-26/+26
| | | | More battlestar(6) spelling and punctuation fixes for battlestar(6). These ones come from OpenBSD.
* initscr() returns a pointer, compare return value with NULL and notsimonb1999-04-181-3/+3
| | | | an int. Compatible with other versions of curses.
* Fix object recognition, per PR 6048 by Joseph S. Myers <jsm28@cam.ac.uk>.hubertf1999-03-251-2/+32
|
* Const poisoning, per PR 6660 by Joseph Myers <jsm28@cam.ac.uk>hubertf1999-02-1012-69/+69
|
* mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>)hubertf1998-09-131-4/+4
|
* add sanity checks when saving/restoring games (PR#6138 by Joseph Myers ↵hubertf1998-09-131-4/+10
| | | | <jsm28@cam.ac.uk>)