summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-0/+1
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Add end.ccNicholas Feinberg2014-07-281-1/+1
|
* Create prompt.ccNicholas Feinberg2014-07-271-0/+1
|
* Theoretically improve ghost interestingness check.Neil Moore2014-07-261-1/+2
| | | | | It doesn't make a difference currently, but if ghost_init ever decides to set the attitude, this would be more correct.
* Don't mark friendly illusions/ghosts as interesing (#8817)Neil Moore2014-07-261-0/+1
|
* Fix whitespace.Neil Moore2014-07-181-2/+2
|
* Avoid another dead assignment (#8419)Neil Moore2014-07-181-9/+9
|
* Simplify and avoid a dead assignment (#8419)Neil Moore2014-07-181-9/+9
|
* Don't give portal messages after excursions (#2814)Neil Moore2014-07-151-2/+2
| | | | Also #5511, #6200, #8408, #8779, and #8790.
* Reformat.Neil Moore2014-07-051-8/+2
| | | | | Mostly by joining short lines in places where that would let us remove braces.
* The great mon-stuff migration.Shmuale Mark2014-06-221-1/+1
| | | | | | | | | A good deal of functions move to the two new files, mon-poly and mon-message. Of the others, some go to where they are used, some to mon-util, and a few are made member methods of monster. This probably breaks Xcode compilation, and I'm not able to test the changes I made to MSVC that will (hopefully) keep it working.
* Fix a warning.Neil Moore2014-06-081-1/+1
| | | | Making GHOST_LIMIT a size_t would be more intrusive than this cast.
* Make a few functions static.Neil Moore2014-06-081-3/+3
|
* Remove safe_file_writer (unused)Nicholas Feinberg2014-06-081-63/+0
|
* Add multi-ghost-file supportNicholas Feinberg2014-06-081-17/+148
| | | | | | | | Previously, only one .bones file (containing potentially multiple associated ghosts) could be stored per-floor. This adds support for storing multiple ghost files per-floor, solving issues where ghosts might be 'lost' otherwise.
* Function to open and lock new files only.Neil Moore2014-05-271-0/+24
| | | | Currently unused, but there are plans.
* Remove some unused parameters.Neil Moore2014-05-271-5/+3
|
* Don't die when encountering 0-byte ghost filesNicholas Feinberg2014-05-251-0/+1
|
* Cleanup lk_open()Nicholas Feinberg2014-05-251-5/+11
| | | | | Remove some redundant checks, add support for 'r+b', generally clean things up.
* Chance function(void) to function()reaverb2014-05-241-1/+1
|
* Revert "Add support for multiple bones files per-level."Neil Moore2014-05-131-125/+17
| | | | | | | | | | | | | | | | | | | It is full of race conditions and is leaving behind zero-byte files after apparent failures to rename the .tmp files left by safe_file_writer. Some of that could be fixed by having safe_file_writer fdopen the descriptor returned by mkstemp, but even then there's a race between opening and locking (and mkostemp, which could solve that, is specific to glibc). Also, we don't seed the libc RNG, which probably reduces the efficiency of mkstemp and makes the races more likely to trigger. This reverts commit a46b10507c9a1b72007ee48b71116a2005a1fe48. Bones generated to bones/ between that commit and this one will be ignored by subsequent games. If the feature is reenabled, we need some mechanism to clean out old zero-byte files without crashing.
* Actually use old bone files when we find them.Neil Moore2014-05-131-0/+3
|
* Don't print a debug message to the player on loading bones.Steve Melenchuk2014-05-121-1/+1
|
* Add support for multiple bones files per-level.Nicholas Feinberg2014-05-121-17/+122
| | | | | | | | | | | | | Previously, ghost files (.bones) were limited to one per level. This meant that if players died on a level that already had an associated .bones file (if e.g. the 1/3 'generate ghost' chance wasn't met), then their ghost would vanish entirely. This commit allows more than one .bones file to be stored for a given level, each holding one or more ghosts that will be generated together, as before. This may lead to an increase in ghost generation, depending on server dynamics; if this is problematic, the generation chance can be tweaked.
* Formatting fixes (add braces).Neil Moore2014-05-121-0/+6
| | | | This fixes all the instances caught by unbrace.
* Staticify several functions.Steve Melenchuk2014-05-081-5/+7
|
* Fix debug compilationreaverb2014-05-081-1/+1
|
* Factor out _place_player() from load_level()Nicholas Feinberg2014-05-081-26/+40
|
* Factor out _make_level() from load_level()Nicholas Feinberg2014-05-081-47/+62
|
* Pull out _leave_level() from load_level()Nicholas Feinberg2014-05-081-41/+70
|
* Let Xom occasionally give stealth or make noise upon entering a new levelChris Campbell2014-04-031-0/+4
| | | | | | Only rarely, and only upon entering a level for the first time. Randomly pick between providing a fairly long-duration stealth boost or making a loud noise.
* Close a colour tagChris Campbell2014-03-261-1/+1
|
* Include a link to character dump/morgue in exit game dialog.Pekka Lampila2014-02-051-4/+12
|
* Display a dialog on WebTiles after the game ends.Pekka Lampila2014-02-051-0/+3
| | | | | For players this is displayed in a case of a crash/error/unexpected end. For watchers the dialog is displayed regardless of how the game ended.
* Don't close portals upon picking up the Orb.Adam Borowski2014-01-151-28/+0
|
* Add missing branch entries before checking validity.Neil Moore2013-12-301-52/+0
| | | | Also, improve a comment (SamB).
* link_items() *before* tag_read_level_tiles() to avoid Lua crashes ...Samuel Bronson2013-12-301-1/+0
| | | | Hopefully this makes things at least a *little* better for Sky.
* Schedule DNGN_ENTER_PORTAL_VAULT for removal; other related fixes.Adam Borowski2013-12-191-3/+8
|
* Make portal entrances and exits proper features on their own.Adam Borowski2013-12-181-1/+5
| | | | | Overloading made it impossible to redefine them, assign colours, made it hard to do stuff on C++ side, and stank of elderberries.
* Simplify butchery handlingChris Campbell2013-12-061-11/+0
| | | | | | Butchery is always allowed except in a few forms (bat, wisp, fungus). Removes a lot of unnecessary/unused code for swapping weapons and removing equipment when butchering.
* Revert "Delay more prompt until level has finished loading."Adam Borowski2013-12-031-5/+3
| | | | | | | | | | | | | | | | | | | While the problem this commit attempts to fix is real, I'm afraid it causes more breakage: * it removes debug messages from map generation * especially, infinite loops become extremely hard to debug * loses output that overflows * has issues with force_more * portal vault announcements are lost For example, a level with both a Lab and an Ice Cave shows just: "There is an entrance to an ice cave on this level. Hurry and find it before the portal melts!" even though there's no overflow. The rest (the main "wave of frost" message and anything about the Lab) are gone. I'm afraid some other approach is needed. Perhaps forcing a screen draw? This reverts commit 8471a022e76bae39918ba6eaa1fbbab5c7ceb64f.
* Don't load ghosts if --seed is specified.Adam Borowski2013-12-011-0/+1
| | | | Kills the reproducibility.
* Delay more prompt until level has finished loading.Raphael Langella2013-11-301-3/+5
| | | | | | | | Getting a more prompt during level load results in a screen only partially updated and looking really bugged. It's especially bad since it happened during loading tutorial levels which is the very first thing many new player see. It also happened when entering a level with an announce portal. If there are more cases, I didn't test them.
* Don't try to replace Abyss, Pan entries on the orbrun.Neil Moore2013-11-291-0/+4
|
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-6/+4
| | | | | | | | | Also simplify quite a few cases. It turns out in >90% cases of non-literals the argument had .c_str(), which meant it was pointlessly malloc()ed and converted from and to std::string. I believe a sprintf is faster, so even the argument of miniscule speed-up doesn't apply.
* Remove sighup_save_and_exit().Adam Borowski2013-11-251-32/+0
| | | | | | | | | | As the comment said, every single use of this function was a save-corrupting bug. Too bad, there's one case left: on Unix, HUP will fclose(stdin), which can immediately fail due to fclose() using malloc (free() to be exact), and then it still relies on undefined behaviour which sometimes works only because ncurses does weird things behind our back.
* Fix missing Hell, Abyss and Pan entries as well.Adam Borowski2013-11-161-5/+12
|
* More formatting fixes for return (...);Neil Moore2013-11-151-5/+5
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-1/+1
|
* Don't allocate pointless iterators.Adam Borowski2013-11-151-1/+1
| | | | | map or set.count() can test the presence of a given key and return 0 or 1 outright.