Permalink
Commits on Feb 17, 2016
  1. Fix compiling on Windows

    tung committed Feb 17, 2016
    Windows doesn't have S_IRGRP or S_IROTH open() flags for obvious
    reasons.
    
    Fixes #97 on GitHub.
  2. Bump version to 0.6.0 (final)

    tung committed Feb 17, 2016
    I haven't worked on DynaHack in months and it's unlikely I'll do any
    significant work on it again, so I may as well put out what I have now
    for the sake of offline players.
  3. Update readme and changelog for upcoming final release

    tung committed Feb 17, 2016
    This time there'll be a readme and changelog shipped with the binary
    releases that players can consult!
Commits on Feb 15, 2016
  1. Fix warning raised by CMake 3.0

    tung committed Feb 15, 2016
    "CMP0026: Disallow use of the LOCATION target property."
    
    Apparently you're supposed to use $<TARGET_FILE:whatever> instead.  This
    should still work with older CMake versions; generator expressions look
    like they've been around for a while if the docs are to be believed.
  2. Remove verbose flag during *.lev file generation

    tung committed Feb 15, 2016
    This reduces build spam.
Commits on Oct 12, 2015
  1. NH4: Don't repair shop damage when restoring, or reverse its order

    tung committed Oct 12, 2015
    daniel_t strikes again, this time thinking it was a good idea for
    shopkeepers to repair damage to their shops WHILE RESTORING A SAVE FILE.
    Unsuprisingly, this led to a segfault when `newsym()` was called for the
    post-repaired map square. -_-
    
    Also fix shop damage linked lists from being reversed during restores.
    
    Based on NetHack 4 commit e8cb04eca089eb20a37cde229cfc81085f2326a4 (Save
    desync fix: shop damage).
Commits on Sep 14, 2015
  1. New command line option -V to set var data 'playground' directory

    tung committed Sep 14, 2015
    The directory set by -V should exist ahead of time; the game does not
    attempt to create it.
    
    If -V is omitted, variable data is read from and written to the same
    data location as before, i.e. the dir -H customizes.
  2. Force the cursor to be visible after quitting the game

    tung committed Sep 14, 2015
    Because for some reason the code that was *supposed* to do this fails to
    work when DynaHack is launched by dgamelaunch.
    
    Solution: Ignore ncurses completely and send CSI [ ? 2 5 h manually when
    the UI is closing.
Commits on Sep 13, 2015
  1. Prevent infinite looping for disconnected player input

    tung committed Sep 13, 2015
    Not sure why the hangup signal handler isn't doing this, but kerio has
    run into 100% CPU DynaHack processes on nethack.xd.cm, so it clearly
    wasn't doing its job.
    
    Get rid of the vestiges of the 'blink' option while we're at it, since
    the solution to this issue needs it totally gone in order to work.
Commits on Sep 12, 2015
  1. Ranger quest: Fix lighting and switch out throne for altar (dNetHack)

    tung committed Sep 12, 2015
    Based on dNAO commit 0299bd5642f6bbcdc327b4c060689f7b17f335da (Ranger
    revision: Fix lighting and switch out throne for altar).
Commits on Sep 11, 2015
  1. lev_comp: Show error when map height exceeds temp buffer size

    tung committed Sep 11, 2015
    Before, it would just segfault.  Now, it shows an informative message,
    then segfaults, which still isn't great but is better than nothing.
    
    Incidentally, I hit this when porting the new Ranger quest map from
    dNetHack, since it has # comments within the MAP-ENDMAP segment that
    would cause the map reader to freak out; I moved them outside for the
    port.
  2. Replace Ranger quest goal iron bars with secret door

    tung committed Sep 11, 2015
    In dNetHack, iron bars can be negotiated with a wand of striking or
    force bolt.  In DynaHack (and UnNetHack), you would need a potion of
    acid instead, so replace iron bars blocking the alcove of trees with an
    (obvious) locked secret door that mimics the stairs down on the Ranger
    quest home level.
  3. Redesign Ranger quest goal level with water and trees (dNetHack)

    tung committed Sep 11, 2015
    Based on dNAO commit 68b0289fbf2048d8322913d198f1c40f76c0d792 (Revise
    quest goal level).
  4. Cloak of protection prevents 80% of item destruction

    tung committed Sep 11, 2015
    This applies to both the player and monsters.  This should make cloaks
    of protection a little less lame.
  5. Fire, cold and shock immunity prevent item destruction

    tung committed Sep 11, 2015
    Fire immunity prevents destruction of potions, scrolls and spellbooks.
    
    Cold immunity prevents destruction of potions.
    
    Shock immunity prevents destruction of wands.
    
    This also extends to monster resistances and polymorph forms.
    Generally, a player in their normal form will need external equipment to
    grant these immunities, making equipment choices more interesting than
    just nullifying damage.
  6. Verify light sources to prevent unloadable save files

    tung committed Sep 11, 2015
    The following properties are checked for all monster and object light
    sources:
    
     * non-null ID
     * range is within [1, MAX_RADIUS)
     * if an object light, lamplit is true for the object
     * if a monster light, emits_light() returns true for it
     * light source is on the right level (the level of the object/monster
       if it's a local light source, or the player's current level
       otherwise).
    
    Now DynaHack will spit out funny warnings and correct itself when it
    detects these anomalies, instead of silently rendering the save file
    unloadable and requiring a save rewind.
  7. Fix extremely wrong timer transfer logic by daniel_t (NetHack 4)

    tung committed Sep 11, 2015
    Daniel Thaler strikes again, and from 2011 no less!  A lot of the timer
    logic relies on level timer chains being in ascending order; Daniel
    Thaler wrote code that broke this assumption, probably subtly breaking
    other assumptions in the process.  Perhaps this was causing objects and
    timers to detach and make DynaHack save files unloadable?  Who knows.
    
    Based on NetHack 4 commit c7fecc48b282e4770f9fb973a0f3404854b72f2d
    (Ensure that timeout order is preserved.  Fixes more timer desyncs.)
  8. Verify object timers to prevent unloadable save files

    tung committed Sep 11, 2015
    Every single action, this checks for:
    
     * object timers with null objects
     * object timers attached to objects that aren't supposed to be timed
     * object timers on the wrong level
     * timers of any kind occurring in non-ascending order
    
    Each of these issues is fixed automatically, albeit with an appropriate
    warning.  I wonder how often these things are occurring in the wild?
Commits on Sep 10, 2015
  1. Delete light sources attached to monsters unconditionally

    tung committed Sep 10, 2015
    A rogue light source attached to a baby leviathan (with an empty
    inventory) was causing 1441760970_Masamune.nhgame on nethack.xd.cm to
    become unloadable when the baby leviathan was killed.  Exactly *why* it
    had that light source is unknown, but this commit should at least stop
    save files with this anomaly from becoming unloadable by clearing light
    sources for monsters, even if the game doesn't think that the monster
    *should* emit light.
  2. Make 90% of Nymph level spawns nymphs and leprechauns

    tung committed Sep 10, 2015
    Normal monster generation on the Nymph level now has a 90% chance of
    creating a nymph or leprechaun instead, with equal odds of either.
    
    Sneak through the level to reach the Town!  It's now possible to do this
    without creating an Elbereth train track.
  3. Remove traps from Nymph level

    tung committed Sep 10, 2015
    Seriously, I enter the Nymph level with an elven cloak on for stealth,
    put a towel over my eyes to use my telepathy, and not five turns later
    nymphs are stepping on squeaky board traps and half of the nymphs are
    already awake.  Let's make this a little more fair.
  4. Nymphs always generate asleep (was 80%)

    tung committed Sep 10, 2015
    ... as long as you aren't carrying the Amulet of Yendor.
  5. Calculate sensible values for skill training > 100%

    tung committed Sep 10, 2015
    Now, if a basic skill is listed with "150%" training, it means that it
    can be advanced to skilled and is 50% of the way to being advanced to
    expert, instead of whatever the hell it meant before.
    
    This also caps the percentages shown for skill training, so no more 567%
    training next to frequently used skills.
Commits on Sep 9, 2015
  1. Show cost to enhance a skill before advancing it

    tung committed Sep 9, 2015
    e.g. "Enhance knife to Basic for 1 slot (2 slots left)? [yn] (n)"
    
    Just another small step to showing players information they deserve but
    is hidden by NetHack for no good reason.
  2. More hallucinated monsters (silly golems)

    tung committed Sep 9, 2015
    Based on UnNetHack commit 5946e40 (More
    hallucinated monsters (silly golems)).
  3. Remove ring destruction from shock damage

    tung committed Sep 9, 2015
    Here's the list of object types that get destroyed from elemental
    damage:
    
     * fire - scrolls, potions, spellbooks
     * cold - potions
     * shock - wands, rings (now gone)
    
    Scrolls and potions only need to be in open inventory for a turn to be
    used, assuming the player has a bag.  Spellbooks don't need to be
    carried at all.  Rings, however, need to be worn over time for their
    passive benefits, making them very prone to item destruction.  Worse,
    ring effects are often a major part of a player's strategy, which makes
    losing rings very annoying.  Finally, long ago, dragon breaths in
    DynaHack were changed to be no longer reflectable, so shock damage from
    blue dragons is now inevitable in a game that runs long enough.  This
    combination of "unavoidable, annoying and inevitable" is the reason for
    this change.
    
    This change also includes shock damage sources like the chest trap, so
    no more tedious ring unequipping before opening (potentially trapped)
    chests.
  4. Show skill caps in `#enhance` menu, e.g. "long sword [basic / expert]"

    tung committed Sep 9, 2015
    This has been on my TODO list for way too long...
  5. Remove disintegrators

    tung committed Sep 9, 2015
    The exact effect of this removes disintegrators from standard monster
    generation.
    
    The `G_NOGEN` flag combined with a fix I did several years ago to
    prevent random chromatic dragon spawns also means that disintegrators
    won't appear on special levels that ask for a random 'R' class monster
    either.
    
    Together, this means that disintegrators effectively no longer exist,
    unless you're loading a save file where disintegrators already exist.
Commits on Sep 3, 2015
  1. Tweak save-recovery.md

    tung committed Sep 3, 2015
  2. New doc: how to rewind a save file that won't load

    tung committed Sep 3, 2015
    Can be found under `doc/save-recovery.md`.
  3. Treat improperly-truncated saves like crashed ones

    tung committed Sep 3, 2015
    ... instead of trying and failing to load/restore them.
    
    Previously, trying to load such a save would first treat it like a
    normal save file, and try to load the game normally, which would fail,
    then try to restore the game by replaying the logged commands, which
    would fail, then try to restore the game by compiling all the logged
    save diffs, which would fail, then finally just abort the process
    entirely.
    
    Now, treating improperly-truncated save files like crashed saves instead
    detects the truncation early, and gives a message: "Failed to load the
    save. Do you wish to delete the file? [yn] (n)"  If the file is not
    deleted it can be rewinded manually to recover it.
  4. Place limits on "%s" in `scanf()` when reading save headers

    tung committed Sep 3, 2015
    This prevents unbounded reads happening in `scanf()` family functions
    that could potentially buffer overflow local stack buffers, leading to
    potential stack smashing.
    
    This was inspired by, but does NOT solve, an issue where improperly
    rewinding a game by truncating lines at the end of the save log but
    forgetting to update the save header leads to *actual* stack smashing.
    Still, better safe than sorry.
Commits on Sep 2, 2015