]> granicus.if.org Git - nethack/log
nethack
2 years agoTiny chance of breaking iron bars with war hammer
Pasi Kallinen [Thu, 26 Jan 2023 16:21:50 +0000 (18:21 +0200)]
Tiny chance of breaking iron bars with war hammer

Also add some different sounds to hitting the iron bars,
and make it noisy.

2 years agoFix: use-after-free in dog_eat()
Michael Meyer [Wed, 25 Jan 2023 20:11:14 +0000 (15:11 -0500)]
Fix: use-after-free in dog_eat()

I think moving the m_consume_obj call (which will free the eaten item)
further down should fix this without causing any really wacky message
sequencing issues, but if maintaining the exact order is important
obj->unpaid and its price could be cached before the free instead.

2 years agofix warning
nhmall [Thu, 26 Jan 2023 05:49:11 +0000 (00:49 -0500)]
fix warning

In file included from makedefs.c:180:
./../src/mdlib.c:92:12: warning: unused function 'count_and_validate_soundlibopts' [-Wunused-function]
static int count_and_validate_soundlibopts(void);
           ^
1 warning generated.

Function definition is in the #ifndef MAKEDEFS_C section, so move the prototype there too.

2 years agolist which soundlib support is compiled in
nhmall [Thu, 26 Jan 2023 05:45:32 +0000 (00:45 -0500)]
list which soundlib support is compiled in

2 years agotranscription error
nhmall [Thu, 26 Jan 2023 04:10:51 +0000 (23:10 -0500)]
transcription error

2 years agosmooth use of soundlib(s) in Makefile.nmake
nhmall [Thu, 26 Jan 2023 04:05:36 +0000 (23:05 -0500)]
smooth use of soundlib(s) in Makefile.nmake

Related: also add a preprocesor #if defined(SND_LIB_WINDSOUND) around the
assign_soundlib() call in sys/windows/windmain.c

2 years agoFix potential warning in music.c
nhmall [Wed, 25 Jan 2023 20:21:30 +0000 (15:21 -0500)]
Fix potential warning in music.c

I saw this included in PR966, but it has nothing to do with the
use-after-free that the pull request is meant to fix. It should
get applied independently of that pull request.

2 years agoadd a sounds.c comment in two places
nhmall [Wed, 25 Jan 2023 20:14:27 +0000 (15:14 -0500)]
add a sounds.c comment in two places

2 years agoGive gremlin the property it stole, if possible
Pasi Kallinen [Wed, 25 Jan 2023 19:52:05 +0000 (21:52 +0200)]
Give gremlin the property it stole, if possible

2 years agomore Soundeffects fiddling
nhmall [Wed, 25 Jan 2023 19:23:22 +0000 (14:23 -0500)]
more Soundeffects fiddling

2 years agosound shell script permissions
PatR [Wed, 25 Jan 2023 19:14:44 +0000 (11:14 -0800)]
sound shell script permissions

2 years agoadd missing entries to visual studio files.props
nhmall [Wed, 25 Jan 2023 14:41:20 +0000 (09:41 -0500)]
add missing entries to visual studio files.props

2 years agocron Files update
nhmall [Wed, 25 Jan 2023 13:23:10 +0000 (08:23 -0500)]
cron Files update

2 years agoSplit pet ranged attack into separate function
Pasi Kallinen [Wed, 25 Jan 2023 09:27:14 +0000 (11:27 +0200)]
Split pet ranged attack into separate function

2 years agoHellfill: Add an angel to the cage
Pasi Kallinen [Wed, 25 Jan 2023 08:04:56 +0000 (10:04 +0200)]
Hellfill: Add an angel to the cage

2 years agoadd missing Magic_Flute files
nhmall [Wed, 25 Jan 2023 06:16:08 +0000 (01:16 -0500)]
add missing Magic_Flute files

2 years agoMerge branch 'fix-makefile' of https://github.com/argrath/NetHack into NetHack-3.7
nhmall [Tue, 24 Jan 2023 19:44:16 +0000 (14:44 -0500)]
Merge branch 'fix-makefile' of https://github.com/argrath/NetHack into NetHack-3.7

2 years agosubstitute non-ASCII chararacters in Makefile.nmake
SHIRAKATA Kentaro [Tue, 24 Jan 2023 16:26:03 +0000 (01:26 +0900)]
substitute non-ASCII chararacters in Makefile.nmake

2 years agoGiants occasionally have a weapon
Pasi Kallinen [Tue, 24 Jan 2023 18:54:39 +0000 (20:54 +0200)]
Giants occasionally have a weapon

2 years agoadd a few missing Soundeffects to apply.c
nhmall [Tue, 24 Jan 2023 18:36:33 +0000 (13:36 -0500)]
add a few missing Soundeffects to apply.c

2 years agosome macsound instrument play refinements
nhmall [Tue, 24 Jan 2023 18:02:29 +0000 (13:02 -0500)]
some macsound instrument play refinements

Also some better core placement of some of the Hero_playnotes calls.

2 years agoHellfill: Caged monster
Pasi Kallinen [Tue, 24 Jan 2023 16:06:16 +0000 (18:06 +0200)]
Hellfill: Caged monster

2 years agoRename variable from tmp to dmg
Pasi Kallinen [Tue, 24 Jan 2023 15:02:13 +0000 (17:02 +0200)]
Rename variable from tmp to dmg

2 years agoSplit hmon_hitmon into multiple functions
Pasi Kallinen [Tue, 24 Jan 2023 13:23:28 +0000 (15:23 +0200)]
Split hmon_hitmon into multiple functions

hmon_hitmon was the biggest function by far; this makes it far more
manageable.

There should be no change in functionality, and although I didn't
test every case, this was just moving chunks of code and changing
variable names until compiler did not complain anymore.

2 years agosome mkmaze.c reformatting
PatR [Tue, 24 Jan 2023 08:22:23 +0000 (00:22 -0800)]
some mkmaze.c reformatting

2 years agofix sounds warning
PatR [Tue, 24 Jan 2023 08:17:25 +0000 (00:17 -0800)]
fix sounds warning

Avoid a warning issued when 'nosound' is the only entry in the array
of sound libraries.  Also, panic() if soundlib index is out of bounds.

2 years agofix misplaced parenthesis in end.c
PatR [Tue, 24 Jan 2023 07:45:19 +0000 (23:45 -0800)]
fix misplaced parenthesis in end.c

2 years agoLua doc bits
Pasi Kallinen [Tue, 24 Jan 2023 07:37:32 +0000 (09:37 +0200)]
Lua doc bits

2 years agoGehennom tweaks: replace some walls with iron bars
Pasi Kallinen [Tue, 24 Jan 2023 07:00:43 +0000 (09:00 +0200)]
Gehennom tweaks: replace some walls with iron bars

2 years agoGehennom tweaks: replace some walls with boulders
Pasi Kallinen [Tue, 24 Jan 2023 06:34:27 +0000 (08:34 +0200)]
Gehennom tweaks: replace some walls with boulders

2 years agoremove a multi-line debug/dev comment
nhmall [Tue, 24 Jan 2023 05:45:45 +0000 (00:45 -0500)]
remove a multi-line debug/dev comment

2 years agoMerge branch 'fix-hacklib' of https://github.com/argrath/NetHack into NetHack-3.7
nhmall [Tue, 24 Jan 2023 05:39:10 +0000 (00:39 -0500)]
Merge branch 'fix-hacklib' of https://github.com/argrath/NetHack into NetHack-3.7

2 years agoThis is cron-daily v1-May-8-2022. 000files updated: Files
nhw_cron [Tue, 24 Jan 2023 05:24:09 +0000 (00:24 -0500)]
This is cron-daily v1-May-8-2022.  000files updated: Files

2 years agoissue with an added comment
nhmall [Tue, 24 Jan 2023 05:25:09 +0000 (00:25 -0500)]
issue with an added comment

2 years agoMerge branch 'macsound' into NetHack-3.7
nhmall [Tue, 24 Jan 2023 04:52:07 +0000 (23:52 -0500)]
Merge branch 'macsound' into NetHack-3.7

2 years agotake initial stab at macsound interface
nhmall [Tue, 24 Jan 2023 04:50:43 +0000 (23:50 -0500)]
take initial stab at macsound interface

Use macOS AppKit framework routines for a first cut at a
macsound soundlib interface.

Requires WANT_MACSOUND=1 on build.

Nothing has been done to move the stock sounds into the resources
of a bundle, so after building, if you want to try the stock sounds
out:
cp sound/wav/*.wav ~/Library/Sounds

Because the NSSound macOS routines always do the search, supposedly
the following locations are searched in this order:
   1. the application’s main bundle
   2. ~/Library/Sounds
   3. /Library/Sounds
   4. /Network/Library/Sounds
   5. /System/Library/Sounds

Although not specifically implemented as of yet, it may be pretty
close to being able to put soundeffects wav files (by se_ name)
into ~/Library/Sounds working for the SND_SOUNDEFFECTS_AUTOMAP feature.

Feedback is welcome. Contributions for improving it are even more
welcome.

The new soundlib supporting file is named
sound/macsound/macsound.m since it's got objective C in it.

Known bugs and glitches:

The Hero_playnotes on a set of 5 notes goes too fast, so there
needs to be a slight delay added between the note of a multi-note
play.

2 years agoAvoid casting time_t to int
SHIRAKATA Kentaro [Mon, 23 Jan 2023 07:34:24 +0000 (16:34 +0900)]
Avoid casting time_t to int

As time_t may not fit int, cast -1 to time_t instead.

2 years agoEating garlic makes some monsters flee
Pasi Kallinen [Tue, 24 Jan 2023 04:17:17 +0000 (06:17 +0200)]
Eating garlic makes some monsters flee

2 years agoreimplement pull request #944 - grave contents
PatR [Mon, 23 Jan 2023 19:38:15 +0000 (11:38 -0800)]
reimplement pull request #944 - grave contents

Pull request from entrez:  if bones left dead hero's corpse on top
of a new grave, don't find a corpse or summon a zombie when digging
the grave up.  It also removed the chance that a ghoul might be
summoned when engraving on a headstone, switching to zombie or mummy
instead.

Rather than adopting the pull request, this retains summoning a
ghoul via engraving and adds the possibly of doing so when kicking
a headstone.  Having a ghoul prowl around the grave is independent
of whether there is a corpse or zombie inside the grave.  To achieve
this, another flag in 'struct rm' is needed; the single bit for
'disturbed' isn't sufficient.  The bigger 'flags' field wasn't in
use for graves so commandeer that for new 'emptygrave'.  'disturbed'
still uses the 'horizontal' bit in order to have engraving and/or
kicking summon at most one ghoul.

Closes #944

2 years agoAdd triple nesting theme room
Pasi Kallinen [Mon, 23 Jan 2023 17:56:22 +0000 (19:56 +0200)]
Add triple nesting theme room

2 years agoFix ancient subroom location bug
Pasi Kallinen [Mon, 23 Jan 2023 17:41:29 +0000 (19:41 +0200)]
Fix ancient subroom location bug

Randomly placed subrooms were never generated touching
the right or bottom walls of the parent room.

This bug has been present since at least 3.1.0

2 years agocomment out sample.c inclusion in Makefile.nmake
nhmall [Mon, 23 Jan 2023 12:42:06 +0000 (07:42 -0500)]
comment out sample.c inclusion in Makefile.nmake

Makefile.nmake

A sample file that was tested for compilability was left in
the Makefile. Harmless if you have the sample.c in the right
place on your machine. Fatal to the build if you do not.

Resolves #961

2 years agoIncrement editlevel
Pasi Kallinen [Mon, 23 Jan 2023 06:05:22 +0000 (08:05 +0200)]
Increment editlevel

Commit 0f257ec538242d (nhlua.c static analyzer fix) changed
a variable from long to unsigned, but the var is also saved
to the save file, so broke save compat.

2 years agoplace the sound_exit_nhsound() calls
nhmall [Mon, 23 Jan 2023 00:02:37 +0000 (19:02 -0500)]
place the sound_exit_nhsound() calls

2 years agoupdate NetHackW.vcxproj
nhmall [Sun, 22 Jan 2023 23:39:55 +0000 (18:39 -0500)]
update NetHackW.vcxproj

Still trying to resolve CI build failure.

2 years agoMakefile.mingw32 had not been tested
nhmall [Sun, 22 Jan 2023 22:26:03 +0000 (17:26 -0500)]
Makefile.mingw32 had not been tested

Try to resolve CI build failure

2 years agoupdate vs project
nhmall [Sun, 22 Jan 2023 22:20:19 +0000 (17:20 -0500)]
update vs project

2 years agofollow-up for today's sound interface changes
nhmall [Sun, 22 Jan 2023 21:44:48 +0000 (16:44 -0500)]
follow-up for today's sound interface changes

2 years agoadd Qt paperdoll 'todo' comment
PatR [Sun, 22 Jan 2023 20:35:54 +0000 (12:35 -0800)]
add Qt paperdoll 'todo' comment

Add a comment to qt_inv.cpp, plus a couple of reformatting bits in
cmd.c and invent.c.

2 years agostore wav files in text format in the repository
nhmall [Sun, 22 Jan 2023 19:52:44 +0000 (14:52 -0500)]
store wav files in text format in the repository

uu2wav.cmd to decode them all on Windows
uu2wav.sh to decode them all on Unix

2 years agofix hardcoded relative paths in rc file
nhmall [Sun, 22 Jan 2023 19:15:11 +0000 (14:15 -0500)]
fix hardcoded relative paths in rc file

Having a hardcoded relative path worked okay with the nmake Makefile
build but cause problems on a visual studio build. The CI caught that
right away.

Remove the relative paths, and add additional include directories for
the resouce compiler to search in the Makefile and in visual studio.

2 years agomake a small change to sound interface
nhmall [Sun, 22 Jan 2023 18:49:38 +0000 (13:49 -0500)]
make a small change to sound interface

add a const

2 years agofurther utilize sound interface - part 2
nhmall [Sun, 22 Jan 2023 18:29:44 +0000 (13:29 -0500)]
further utilize sound interface - part 2

Expand windsound to support SNDCAP_USERSOUNDS (existing),
SNDCAP_SOUNDEFFECTS, SNDCAP_HEROMUSIC.

Place a small number of wav files into sound/wav that are considered
more specific to some game stuff in the core, namely: playing
instruments by the hero, squeaky board traps. The intention is that
those ones can be integrated into the game without requiring user
file deposits or mappings. Building soundlib support for sound/windsound
searches for them as resources, so they should "just work."

No actual instrument playback is available in the base sound/windsound
soundlib implementation (yet, at least), so it works around that in
a cheap way by using the note-variant wav sounds to concoct the
notes. There are better ways of doing music generation than that,
of course, but this will do in the early going. Any other soundlib
port (such as Qt) can probably easily do the exact same thing. If it
can play USER_SOUNDS, it can almost certainly use the
sound/wav/se_squeak*.wav and sound/wav/sound_*.wav files for
SND_HEROMUSIC and squeaky board sounds soundeffects.

A few of the se_ sounds in sound/wav are free yet licensed, and
there is a file called attributions.txt to meticulously attempt
to comply with the two license variations involved.

SND_SOUNDEFFECTS_AUTOMAP

If SND_SOUNDEFFECTS_AUTOMAP is defined, and a SND_LIB_ interface
that supports SNDPROC_SOUNDEFFECTS is also defined to integrate
soundlib support, the following gets added:

  o If sounddir is defined (existing longstanding feature that's
    been used with USER_SOUNDS for many, many years) any wav file
    present in SOUNDDIR with a name that matches one of the defined
    sound effects in include/sndproc.h will get played each time
    that soundeffect comes up. So, just drop appropriate wav files
    into sounddir and rename it to match.

    No tedious config file entries are required to get soundeffects.

    [ The only config file change required is to
      set SOUNDDIR to point to your directory with the wav files.
      Note: SOUNDDIR only works in your config file if NetHack
      was built with USER_SOUNDS defined. ]

    This is new so there may certainly be some bugs in here.
    Please kindly report them if you encounter any.

    For those that don't read C very well, these are the file names
    that should trigger the SOUNDEFFECTS_AUTOMAP, assuming it is working.

        se_faint_splashing.wav
        se_crackling_of_hellfire.wav
        se_heart_beat.wav
        se_typing_noise.wav
        se_hollow_sound.wav
        se_rustling_paper.wav
        se_crushing_sound.wav
        se_splash.wav
        se_chains_rattling_gears_turning.wav
        se_smashing_and_crushing.wav
        se_gears_turning_chains_rattling.wav
        se_loud_splash.wav
        se_lound_crash.wav
        se_crashing_rock.wav
        se_sizzling.wav
        se_crashing_boulder.wav
        se_boulder_drop.wav
        se_item_tumble_downwards.wav
        se_drain_noises.wav
        se_ring_in_drain.wav
        se_groans_and_moans.wav
        se_scratching.wav
        se_glass_shattering.wav
        se_egg_cracking.wav
        se_gushing_sound.wav
        se_glass_crashing.wav
        se_egg_splatting.wav
        se_sinister_laughter.wav
        se_blast.wav
        se_stone_breaking.wav
        se_stone_crumbling.wav
        se_snakes_hissing.wav
        se_loud_pop.wav
        se_clanking_pipe.wav
        se_sewer_song.wav
        se_monster_behind_boulder.wav
        se_wailing_of_the_banshee.wav
        se_swoosh.wav
        se_explosion.wav
        se_crashing_sound.wav
        se_someone_summoning.wav
        se_rushing_wind_noise.wav
        se_splat_from_engulf.wav
        se_faint_sloshing.wav
        se_crunching_sound.wav
        se_slurping_sound.wav
        se_masticating_sound.wav
        se_distant_thunder.wav
        se_applause.wav
        se_shrill_whistle.wav
        se_someone_yells.wav
        se_door_unlock_and_open.wav
        se_door_open.wav
        se_door_crash_open.wav
        se_dry_throat_rattle.wav
        se_cough.wav
        se_angry_snakes.wav
        se_zap_then_explosion.wav
        se_zap.wav
        se_horn_being_played.wav
        se_mon_chugging_potion.wav
        se_bugle_playing_reveille.wav
        se_crash_through_floor.wav
        se_thump.wav
        se_scream.wav
        se_tumbler_click.wav
        se_gear_turn.wav
        se_divine_music.wav
        se_thunderclap.wav
        se_sad_wailing.wav
        se_maniacal_laughter.wav
        se_rumbling_of_earth.wav
        se_clanging_sound.wav
        se_mutter_imprecations.wav
        se_mutter_incantation.wav
        se_angry_voice.wav
        se_sceptor_pounding.wav
        se_courtly_conversation.wav
        se_low_buzzing.wav
        se_angry_drone.wav
        se_bees.wav
        se_someone_searching.wav
        se_guards_footsteps.wav
        se_faint_chime.wav
        se_loud_click.wav
        se_soft_click.wav
        se_squeak.wav
        se_squeak_C.wav
        se_squeak_D_flat.wav
        se_squeak_D.wav
        se_squeak_E_flat.wav
        se_squeak_E.wav
        se_squeak_F.wav
        se_squeak_F_sharp.wav
        se_squeak_G.wav
        se_squeak_G_sharp.wav
        se_squeak_A.wav
        se_squeak_B_flat.wav
        se_squeak_B.wav
        se_someone_bowling.wav
        se_rumbling.wav
        se_loud_crash.wav
        se_deafening_roar_atmospheric.wav
        se_low_hum.wav
        se_laughter.wav
        se_cockatrice_hiss.wav
        se_chant.wav
        se_cracking_sound.wav
        se_ripping_sound.wav
        se_thud.wav
        se_clank.wav
        se_crumbling_sound.wav
        se_soft_crackling.wav
        se_crackling.wav
        se_sharp_crack.wav
        se_wall_of_force.wav
        se_alarm.wav
        se_kick_door_it_shatters.wav
        se_kick_door_it_crashes_open.wav
        se_bubble_rising.wav
        se_bolt_of_lightning.wav
        se_board_squeak.wav
        se_board_squeaks_loudly.wav
        se_boing.wav
        se_crashed_ceiling.wav
        se_clash.wav
        se_crash_door.wav
        se_crash.wav
        se_crash_throne_destroyed.wav
        se_crash_something_broke.wav
        se_kadoom_boulder_falls_in.wav
        se_klunk_pipe.wav
        se_kerplunk_boulder_gone.wav
        se_klunk.wav
        se_klick.wav
        se_kaboom_door_explodes.wav
        se_kaboom_boom_boom.wav
        se_kaablamm_of_mine.wav
        se_kaboom.wav
        se_splat_egg.wav
        se_destroy_web.wav
        se_iron_ball_dragging_you.wav
        se_iron_ball_hits_you.wav
        se_lid_slams_open_falls_shut.wav
        se_chain_shatters.wav
        se_furious_bubbling.wav
        se_air_crackles.wav
        se_potion_crash_and_break.wav
        se_hiss.wav
        se_growl.wav
        se_canine_bark.wav
        se_canine_growl.wav
        se_canine_whine.wav
        se_canine_yip.wav
        se_canine_howl.wav
        se_feline_yowl.wav
        se_feline_meow.wav
        se_feline_purr.wav
        se_feline_yip.wav
        se_feline_mew.wav
        se_roar.wav
        se_snarl.wav
        se_buzz.wav
        se_squeek.wav
        se_squawk.wav
        se_squeal.wav
        se_screech.wav
        se_equine_neigh.wav
        se_equine_whinny.wav
        se_equine_whicker.wav
        se_bovine_moo.wav
        se_bovine_bellow.wav
        se_wail.wav
        se_groan.wav
        se_grunt.wav
        se_gurgle.wav
        se_elephant_trumpet.wav
        se_snake_rattle.wav
        se_hallu_growl.wav

This needs further testing. At the moment only windsound has
this.

If nobody else looks into it for Qt, I'll take a look in a
few days.

2 years agoHellfill: Random temples to Moloch
Pasi Kallinen [Sun, 22 Jan 2023 18:07:38 +0000 (20:07 +0200)]
Hellfill: Random temples to Moloch

2 years agoIntelligent peacefuls avoid digging shop or temple walls
Pasi Kallinen [Sun, 22 Jan 2023 11:21:50 +0000 (13:21 +0200)]
Intelligent peacefuls avoid digging shop or temple walls

2 years agoHigher chance of demon gating in Gehennom
Pasi Kallinen [Sun, 22 Jan 2023 11:03:10 +0000 (13:03 +0200)]
Higher chance of demon gating in Gehennom

2 years agofit git issue #960 - out-of-bounds array access
PatR [Sun, 22 Jan 2023 09:43:20 +0000 (01:43 -0800)]
fit git issue #960 - out-of-bounds array access

Issue reported by argrath:  if getoptstr() executed its loop to
find the latest phase that set a role/race/gender/alignment option
value, the first iteration of the loop would use an index that's
out of bounds.

The code in question is wrong but happens to not be used, so the
out of bounds access doesn't occur.  Fix the value for the first
iteration in case the offending code eventually gets used.

Fixes #960

2 years agofeedback bit
PatR [Sat, 21 Jan 2023 19:24:52 +0000 (11:24 -0800)]
feedback bit

Handle the candle vs underwater message that just had its punctation
fixed slightly differently.

2 years agopull request #953 - map updating when underwater
PatR [Sat, 21 Jan 2023 19:13:35 +0000 (11:13 -0800)]
pull request #953 - map updating when underwater

Pull request from entrez:  moving while underwater didn't always
update the map properly if hero got more than one move during a turn.

Closes #953

2 years agoFix: underwater vision update frequency
Michael Meyer [Thu, 5 Jan 2023 18:27:39 +0000 (13:27 -0500)]
Fix: underwater vision update frequency

Underwater vision was updated only once per turn, so if the hero had
more than one move per turn it could cause some spots to be left behind
on the map.  For example, after moving around underwater while very fast
for a while:

            }
          }}}
          }}}}
       }  }}@}
      }    }}}

Not only does the radius of vision appear to "smear" temporarily, but if
the hero moves fast enough, isolated spots can be left entirely behind
(since the normal underwater vision update only clears nearby spots, not
the entire map).  Both these effects are visible in the example above.

The fix in this commit is to update the frequency of underwater vision
updates to "once-per-time-taken" rather than "once-per-turn", so that it
updates with every move.  I'm not sure if it needs to happen more
frequently than that (i.e. in the "once-per-input" section) but I might
be overlooking something.

Also add missing punctuation to the message for applying a lamp
underwater.

2 years agoWrong order of params
Pasi Kallinen [Sat, 21 Jan 2023 15:15:38 +0000 (17:15 +0200)]
Wrong order of params

2 years agoHit and wake sleeping monster makes it growl
Pasi Kallinen [Sat, 21 Jan 2023 14:52:17 +0000 (16:52 +0200)]
Hit and wake sleeping monster makes it growl

Unless you kill the monster with one hit, it'll wake up
cranky and make noise - waking up other sleeping monsters.

This was a bit tricky with all the message sequencing; I tested
all the hit/throw/fire/zap combos I could think of, and it took
a while to get things looking right.

2 years agoend.c bit - unnecessary 'else'
PatR [Sat, 21 Jan 2023 09:56:07 +0000 (01:56 -0800)]
end.c bit - unnecessary 'else'

2 years agosplitobj() never returns Null
PatR [Sat, 21 Jan 2023 09:53:59 +0000 (01:53 -0800)]
splitobj() never returns Null

While deliberately omitting something unrelated from the
'analyzer vs eat.c' commit, I accidentally left this out too.

2 years agoanalyzer vs eat.c
PatR [Sat, 21 Jan 2023 09:52:04 +0000 (01:52 -0800)]
analyzer vs eat.c

scan-build from llvm-14 (clang) doesn't complain about bite() or
maybe_finished_meal() so this is unlikely to fix those.  But this
does fix one bogus complaint it has for doeat().  Testing whether
the result from touchfood() is Null was fooling it into thinking
that that was a possibility when it's not.

Also, use plain 1 and 0 instead of TRUE and FALSE when assigning
to the victual bit-fields.  The analyzer doesn't care but the type
was mismatched due to the cast to (boolean) hidden in their macro
definitions.

2 years agoUnify monster-consumes-object
Pasi Kallinen [Sat, 21 Jan 2023 08:05:44 +0000 (10:05 +0200)]
Unify monster-consumes-object

This code was in three different places; pet eating,
monster eating metal, and monster eating other objects.

Other than very minor changes (eg. rustproofing completely
protects pets from bad effects, rustproof items are no longer
giving apport, and monsters eating corpses are healed), it
should behave the same as before... But I haven't exhaustively
gone through every iteration.

2 years agofix misplaced brace; also relocate Soundeffect()
nhmall [Sat, 21 Jan 2023 01:51:31 +0000 (20:51 -0500)]
fix misplaced brace; also relocate Soundeffect()

The brace added to dokick was misplaced - it should have included
the You_hear() as well.

The puts the code back the way it was, and relocates the Soundeffect().
The Soundeffect should play whether the hero is Blind or not, and the
Soundeffect() macro already includes a Deaf guard.

2 years agoplace a comment to identify the unreachable code
nhmall [Sat, 21 Jan 2023 01:41:03 +0000 (20:41 -0500)]
place a comment to identify the unreachable code

2 years agore-suppress the three warnings that reappeared
nhmall [Sat, 21 Jan 2023 01:32:36 +0000 (20:32 -0500)]
re-suppress the three warnings that reappeared

src/nhlua.c(1118) : warning C4702: unreachable code
src/nhlua.c(1045) : warning C4702: unreachable code
src/nhlua.c(1107) : warning C4702: unreachable code

2 years agonew static analyzer fix - nhlua.c
PatR [Sat, 21 Jan 2023 01:18:27 +0000 (17:18 -0800)]
new static analyzer fix - nhlua.c

Cope with get_nh_lua_variable() possibly returning Null.

Either or both of the DISABLE_WARNING_UNREACHABLE_CODE and
RESTORE_WARNING_UNREACHABLE_CODE in the vicinity looked misplaced so
I took them out.  They may need to be added back in.

2 years agoresolve 5 analyzer warnings if no SND_LIB_* define
nhmall [Fri, 20 Jan 2023 22:32:55 +0000 (17:32 -0500)]
resolve 5 analyzer warnings if no SND_LIB_* define

2 years agoSet SNDCAP_USERSOUNDS bit in windsound interface
nhmall [Fri, 20 Jan 2023 19:50:06 +0000 (14:50 -0500)]
Set SNDCAP_USERSOUNDS bit in windsound interface

2 years agowhitespace cleanup on files just modified
nhmall [Fri, 20 Jan 2023 19:28:33 +0000 (14:28 -0500)]
whitespace cleanup on files just modified

2 years agoadd soundeffects hooks to core
nhmall [Fri, 20 Jan 2023 19:18:48 +0000 (14:18 -0500)]
add soundeffects hooks to core

Insert the calls to trigger a number of potential soundeffects
into the core.

If no additional soundlib support is integrated into the
build, then the Soundeffect macro (sndprocs.h) expands to nothing:

[#define Soundeffect(seid, vol)
]

If, however, at least one additional soundlib support is integrated
into the build, then the Soundeffect macro gets defined as this
in sndprocs.h:

[#define Soundeffect(seid, vol) \
    do {                                                              \
        if (!Deaf && soundprocs.sound_soundeffect                     \
            && ((soundprocs.sndcap & SNDCAP_SOUNDEFFECTS) != 0))      \
            (*soundprocs.sound_soundeffect)(emptystr, (seid), (vol)); \
    } while(0)
]

That macro definition checks for the hero not being Deaf; it checks
to ensure that the active soundlib interface has a non-null
sound_soundeffect() function pointer; and it checks to ensure
that the active soundlib interface has declared that it supports
soundeffects by setting the SNDCAP_SOUNDEFFECTS bit in its sndcap
entry. That just means that the interface routines are prepared to
accept and deal with the calls from the core, whether or not it
actually produces the desired soundeffect.

2 years agoPoly into fire elemental, eat flammable items
Pasi Kallinen [Fri, 20 Jan 2023 16:56:01 +0000 (18:56 +0200)]
Poly into fire elemental, eat flammable items

2 years agoRandom sink effect: noxious gas cloud
Pasi Kallinen [Fri, 20 Jan 2023 15:35:14 +0000 (17:35 +0200)]
Random sink effect: noxious gas cloud

2 years agoFix mouse menu movement
Pasi Kallinen [Fri, 20 Jan 2023 12:35:30 +0000 (14:35 +0200)]
Fix mouse menu movement

When using mouse to move to a location next to the hero,
the test_move result was reversed, causing the click to fall
in to the travel case instead of normal movement.

2 years agoAdd hell_tweaks to Orcus' level
Pasi Kallinen [Fri, 20 Jan 2023 12:08:34 +0000 (14:08 +0200)]
Add hell_tweaks to Orcus' level

2 years agoguard call
nhmall [Fri, 20 Jan 2023 10:19:06 +0000 (05:19 -0500)]
guard call

2 years agoupdate visual studio dirs.props with new directory
nhmall [Fri, 20 Jan 2023 01:09:39 +0000 (20:09 -0500)]
update visual studio dirs.props with new directory

2 years agomingw32 bit
nhmall [Fri, 20 Jan 2023 01:03:45 +0000 (20:03 -0500)]
mingw32 bit

2 years agoanother update to visual studio project files
nhmall [Fri, 20 Jan 2023 00:48:55 +0000 (19:48 -0500)]
another update to visual studio project files

2 years agoupdate visual studio project files
nhmall [Fri, 20 Jan 2023 00:44:25 +0000 (19:44 -0500)]
update visual studio project files

2 years agoThis is cron-daily v1-May-8-2022. 000files updated: Files
nhw_cron [Fri, 20 Jan 2023 00:24:08 +0000 (19:24 -0500)]
This is cron-daily v1-May-8-2022.  000files updated: Files

2 years agofollow-up for windows build based on CI results
nhmall [Fri, 20 Jan 2023 00:26:23 +0000 (19:26 -0500)]
follow-up for windows build based on CI results

2 years agoremove obsolete file sys/windows/ntsound.c
nhmall [Fri, 20 Jan 2023 00:13:55 +0000 (19:13 -0500)]
remove obsolete file sys/windows/ntsound.c

2 years agoadd an interface for sound libraries
nhmall [Thu, 19 Jan 2023 23:51:42 +0000 (18:51 -0500)]
add an interface for sound libraries

Groundwork for a more versatile interface for using
sound libraries. A lot of sound libraries work across
multiple platforms.

The current NetHack sound stuff is quite limited.

Binaries can have a variety of window ports linked into
them, and it makes sense to have something similar for
sound.

This tries to set things up in a more soundlib-centric way,
rather than inserting things in a platform-centric way.

It establishes a new top-level directory sound (akin to win
for the window interface routines, or "window-port") where
sound-related additions and sndprocs and support files can be
added and used across platforms.

The default interface is nosound and the 'nosound' interface
is in src/sounds.c

The interface for 'windsound', which contains the same minimal
USER_SOUNDS support using built-in routines that has been in the
windows port for a long time is added to
sound/windsound/windsound.c.

For now, the sound interface support for 'qtsound' has been added
to the existing Qt files win/Qt/qt_bind.h and win/Qt/qt_bind.cpp,
and a note has been placed in sound/qtsound/README.md to avoid
confusion.

New header file added: include/sndprocs.h.

2 years agoMindless monsters are not scared of music
Pasi Kallinen [Thu, 19 Jan 2023 20:18:52 +0000 (22:18 +0200)]
Mindless monsters are not scared of music

2 years agoBoomerang hitting a sink is noisy
Pasi Kallinen [Thu, 19 Jan 2023 17:59:19 +0000 (19:59 +0200)]
Boomerang hitting a sink is noisy

2 years agoDigging is noisy
Pasi Kallinen [Thu, 19 Jan 2023 17:55:24 +0000 (19:55 +0200)]
Digging is noisy

2 years agoFix vibrating square
Pasi Kallinen [Thu, 19 Jan 2023 10:12:26 +0000 (12:12 +0200)]
Fix vibrating square

The Gehennom changes broke the vibrating square, allowing hero to go
down into the Sanctum via stairs without performing the invocation.

Fix this by making the hellfill lua check for invocation level, and
placing down the vibrating square trap, instead of stairs.

2 years agoadd Japanese item names to discoveries list
PatR [Thu, 19 Jan 2023 06:00:57 +0000 (22:00 -0800)]
add Japanese item names to discoveries list

When playing as a Samurai, add things like "osaku" to the discoveries
list even though they don't have separate descriptions to be used
when not yet discovered.  Non-magic ones are pre-discovered and
players can now use the '\' command to figure out what things like
"tanko" mean without resorting to '/?'.

"wooden harp" has been getting changed to "koto (harp)"; make that be
| koto [wooden harp] (koto)
"magic harp" has been staying as "magic harp (harp)"; add it to the
list of Japanese item names.  Since it's magic it isn't pre-discovered.
Once discovered it becomes
| magic koto [magic harp] (koto)

Those two needed special case handling, none of the other items did
aside from forcing them to be discoverable when lacking descriptions.
The discoveries list now has things like
| wakizashi [short sword]
| naginata [glaive] (single-edged polearm)
| gunyoki [food ration]
if--and only if--the hero is a Samurai.

2 years agoMove familiar level message into function
Pasi Kallinen [Wed, 18 Jan 2023 21:33:21 +0000 (23:33 +0200)]
Move familiar level message into function

2 years agopacify static analyzer - vision.c
PatR [Wed, 18 Jan 2023 19:57:49 +0000 (11:57 -0800)]
pacify static analyzer - vision.c

Include some assertions to convince the analyzer that some pointers
can't be Null.  They're Null if 'vis_func' is non-Null but only used
when that function pointer is Null and they have values.

If there's a macro that's defined when the analyzer is running and
undefined when not--or vice versa--it could be used to control NDEBUG
and avoid the assertion code when not analyzing.  That's a bit like
using fake code to pacify 'lint'; however, since the assertions should
never fail, suppressing them isn't really switching to fake code.

I reordered a couple of macros so that the set of them matches the
comment which precedes them and refers to "the last three".  It is
referring to the three within the block comment rather than the macro
defintions but putting those in the same order removes any ambiguity.

2 years agostatic analyzer vs symbols.c
PatR [Wed, 18 Jan 2023 19:29:40 +0000 (11:29 -0800)]
static analyzer vs symbols.c

This will probably shut up the static analyzer's exceedingly verbose
complaint for symbols.c.

2 years agoMake plane of fire hot
Pasi Kallinen [Wed, 18 Jan 2023 08:50:32 +0000 (10:50 +0200)]
Make plane of fire hot

2 years agovisual studio package settings
nhmall [Wed, 18 Jan 2023 02:07:45 +0000 (21:07 -0500)]
visual studio package settings

2 years agoquiet a new warning
nhmall [Wed, 18 Jan 2023 00:59:24 +0000 (19:59 -0500)]
quiet a new warning

src/eat.c(74,46): warning C4132: 'zero_victual': const object should be initialized

2 years agocomment typo: vicutal -> victual
nhmall [Wed, 18 Jan 2023 00:44:05 +0000 (19:44 -0500)]
comment typo: vicutal -> victual

2 years agomaybe pacify static analyzer - eat.c
PatR [Wed, 18 Jan 2023 00:31:59 +0000 (16:31 -0800)]
maybe pacify static analyzer - eat.c

The complaint is that victual.canchoke might be used without having
been initialized.  I'm fairly sure that that isn't correct but get
dizzy trying to trace through the eating code.

This might improve the situation, or maybe not.