Commit Graph
100 Commits
Author SHA1 Message Date
Pasi Kallinen f6b9dc7d68 Don't try to write a zero-length message
If the message history contains a zero-length message line, skip it,
as trying to write a zero-length string will make bwrite panic.

Happened only on X11. This is post-3.6.1 bug.
2019-01-21 11:56:19 +02:00
Pasi Kallinen 77bc07f579 Make demon gating show a message
This was both an accessibility and comprehensibility issue.
2019-01-20 15:56:44 +02:00
Pasi Kallinen abcdb713d5 wizmakemap should reset lockpicking 2019-01-13 17:27:17 +02:00
Pasi Kallinen 5e2236a3ef Fix accessing deleted fire trap
melt_ice can delete the fire trap, in the case where the trap
is on ice, and a monster carrying a boulder triggers it, then drowns.

mintrap -> minliquid -> mondead -> ... -> mdrop_obj ->
   flooreffects -> boulder_hits_pool -> delfloortrap
2019-01-10 21:48:20 +02:00
Pasi Kallinen 45e06d638f Curses: Remove useless inventory label
The inventory window used a line to say "Inventory:", which is pretty
useless, and that was the only window showing such a label.

Also don't duplicate the "Not carrying anything" text from core.
2018-12-29 13:16:51 +02:00
Pasi Kallinen 6ac681b5fa X11: default to XPM-format tile file and rip screen
People have been wondering how to change the tiles on the X11
version, and the old default of NetHack-specific binary tile data
isn't directly editable with image editing tools.

Also show in the #version info if xpm and graphic rip are enabled.
2018-12-29 07:19:24 +02:00
Pasi Kallinen ca336bbf4b curses: include date.h
This way the curses port will show the version and compile date
on the startup banner, just like tty does.
2018-12-28 11:34:01 +02:00
Pasi Kallinen 8319227b55 Clear the getlin buffer
Recent change to this bit of code didn't clear the buffer,
which causes garbage in the string if compiled with EDIT_GETLIN
2018-12-07 22:18:53 +02:00
Pasi Kallinen 857b8af2ee Add missing valid location descriptors 2018-12-05 23:15:14 +02:00
Pasi Kallinen f020595fb7 Valid cursor locations showed null
When getting a cursor location, and there was no "valid" location
function defined, trying to go to the next or previous valid
location showed null.

Fix this by using the "interesting" locations if no valid ones.
2018-12-05 22:39:16 +02:00
Pasi Kallinen 6e0a9cad5a Fake leash object is not attached
When farlooking at a fake leash object, make it explicitly not
be attached to a monster.
2018-12-05 22:36:03 +02:00
Pasi Kallinen 4c9603298a glyph variable is actually used 2018-12-01 08:58:36 +02:00
Pasi Kallinen 75bf7c1975 X11: Disable menucolors when showing text files 2018-11-30 15:26:38 +02:00
Pasi Kallinen 9e6ba48dbd Typofix 2018-11-28 15:59:48 +02:00
Pasi Kallinen f942687378 Remove unnecessary define 2018-11-27 07:38:03 +02:00
Pasi Kallinen 3517277467 Add some commented out flags to linux hints file 2018-11-23 19:26:13 +02:00
Pasi Kallinen 80d1aae8a5 ifdef, not if 2018-11-23 15:15:04 +02:00
Pasi Kallinen 02749b7621 Fix guard shoving monsters away coordinate logic
The logic required both x and y coordinates of the guard location and
the new location the guard wanted to move to be different. This is
obviously wrong, as the guard may move horizontally or vertically.
2018-11-22 20:25:03 +02:00
Pasi Kallinen 030efe84fa Map column 0 is not a valid location 2018-11-21 19:17:08 +02:00
Pasi Kallinen b54dda5624 More monster location sanity checks
Placing a monster over already existing one will now complain.
Define EXTRA_SANITY_CHECKS to check monster removal too.
2018-11-19 22:38:16 +02:00
Pasi Kallinen 5acddebb3c Init long worm even if it does not have a tail
Long worms with no tail parts still apparently need to have
the zero-length tail placed.
2018-11-19 22:09:18 +02:00
Pasi Kallinen 20b47b5bbd Replace long worm on map after removing tail with wormgone
Calling wormgone will also remove the long worm monster from
the map, not just the worm tail. Put the monster back on map
so relmon can actually remove it properly.
2018-11-19 22:04:36 +02:00
Pasi Kallinen b0428321b8 Explicitly remove long worm segments from the map
When a long worm was removed from the map, the segments for that worm
retained their map location info. This caused problems later on if
wormgone (or toss_wsegs) was called, because it would try to remove the
segments of that worm from the map.
2018-11-19 21:54:35 +02:00
Pasi Kallinen 2a439af336 More long worm checks when splitting
When a long worm is split into two, perform more checks placing
the segments on the map.
2018-11-19 21:49:52 +02:00
Pasi Kallinen 7119baafb8 Long worm may get killed in middle of action
If long worm attacks you, and you have a passive response that may
kill the worm (eg. blue jelly), the worm may die in the middle of
a loop checking for a worm segment that can attack. This'll cause
a segfault because the worm segments will get freed.

If the worm dies, just exit the loop.
2018-11-19 21:27:26 +02:00
Pasi Kallinen 9ad7268c0a Moving long worms may still put tail in old location
When using rloc and friends to move monsters, and the monster
happens to be a long worm, the tail may get randomly placed
in the same place where the long worm was removed from.

In the cases where we expect the location to really be free,
explicitly recheck the location for a monster after rloc.
2018-11-19 21:24:11 +02:00
Pasi Kallinen 657f557821 Fix vault guard not considering monsters in walls
Two different cases here: a) Vault guard did not move away monsters
except if they were standing on gold, and b) moving away monsters
on a completely filled level did not work
2018-11-19 21:20:43 +02:00
Pasi Kallinen ebef31ffa5 Check monster relocation degenerate cases more strictly
Just in case we're trying to put the monster on the same location
where it already thinks it is... but actually isn't.
2018-11-19 21:16:50 +02:00
Pasi Kallinen 878ac24037 Fix freeing monsters not on map
Sometimes we free the monster data, but the monster is not on the
map - usually this happens if the map is full of monsters and a new one
is migrated on the level.

Make m_detach check the monster x coordinate, so it knows not to touch the map
if the monster isn't on it.
2018-11-19 21:16:46 +02:00
Pasi Kallinen f9f1236f26 Fix some buffer underflows 2018-11-08 21:02:24 +02:00
Pasi Kallinen afd793e9b7 Fix memory leak in makedefs 2018-11-08 17:38:36 +02:00
Pasi Kallinen 0bb6754998 Fuzz testing debug tool
Add code to run a fuzz tester, simulating (more-or-less) random
keyboard mashing. There's no option to turn it on, you need to
set iflags.debug_fuzzer on via a debugger or something along
those lines.
2018-11-08 15:55:49 +02:00
Pasi Kallinen 75f6001afc Report insanities via impossible 2018-11-07 18:50:09 +02:00
Pasi Kallinen c6ade9c715 Prevent out of array index 2018-11-07 18:39:00 +02:00
Pasi Kallinen e8eadac3c8 Feedback on trying to pick up stairs or altar 2018-11-05 18:35:20 +02:00
Pasi Kallinen d7c042eb80 Make Mjollnir lightning noisy 2018-11-02 20:49:11 +02:00
Pasi Kallinen 312f7ccc10 X11: Fix msghistory restore segfault 2018-10-30 17:40:22 +02:00
Pasi Kallinen fd60e11d8d X11: Remove leftover file display stuff 2018-10-27 20:47:27 +03:00
Pasi Kallinen 6d70997869 X11: Reuse menu code to display files
Previously the code used the ASCII Text Athena widgets for displaying
file contents. Unfortunately, the widget made it impossible to control
scrolling or pretty much anything else.

Use the menu code instead, making the file display window behave properly.
2018-10-27 13:58:59 +03:00
Pasi Kallinen 742ec3dd49 X11: Don't hilite the help ext menu entry
Both the "help" button at top and the "help" extended menu command
were hilighted by the X resources. Make the top buttons have
"btn_" prefix, so they're easily distinguished in the resources.
2018-10-25 15:58:22 +03:00
Pasi Kallinen ef4f56242c X11: Make TTY status obey hilite_status 2018-10-24 20:04:28 +03:00
Pasi Kallinen 45ecbb84d6 X11: Move color and font structs
... so that other window types can also use them.
2018-10-23 20:30:48 +03:00
Pasi Kallinen 6381c32a39 X11: Adjust some colors to differentiate them 2018-10-23 17:48:54 +03:00
Pasi Kallinen 0470065b47 X11: TTY-style status lines
Set X resource NetHack*fancy_status: False to enable the TTY-style
status lines. Default is the fancy status.

This patch is somewhat unfinished - even though the TTY-style status
allow for status hilites, the colors don't work correctly yet.
Also changes the fancy status to use the windowport notification code.
2018-10-22 21:26:56 +03:00
Pasi Kallinen b653d0d137 X11: Mouse wheel scrolling for message window 2018-10-21 19:30:05 +03:00
Pasi Kallinen d648f4c371 X11: save and load message history 2018-10-21 17:26:24 +03:00
Pasi Kallinen 7ed01793b4 X11: Fix couple issues from recent changes
Segfault due to arg array overflow, and a theoretical fix for
a hang on a Mac during player selection if -@ parameter was given
on the command line.
2018-10-20 11:17:41 +03:00
Pasi Kallinen 3f94cee340 X11: Add key and mouse scrolling to extended command menu 2018-10-18 21:33:17 +03:00
Pasi Kallinen d454855c54 X11: Handle the -@ parameter 2018-10-18 19:29:42 +03:00
Pasi Kallinen fa5e5ac4b4 X11: Obey menu movement keys 2018-10-18 18:39:27 +03:00
Pasi Kallinen c687bb7cd8 X11: Revert finding scrollbars in same window
Apparently this doesn't work, for some reason every widget reports
a different window, even when they are in the same window ...
Maybe widgets inside and outside a viewport are technically
in different windows?
2018-10-18 17:19:42 +03:00
Pasi Kallinen 4db9a06c6c X11: Find scrollbars in same window
Adding scroll() translations to a window with no scrollbars
scrolled the main window message area.
2018-10-16 20:44:56 +03:00
Pasi Kallinen 24674e10e5 X11: Add geometry handler on perm_invent win only 2018-10-16 19:21:46 +03:00
Pasi Kallinen 8c17825afd X11: Remember perm_invent window geometry
Instead of remembering the geometry at window closing time,
remember it immediately when it changes.
2018-10-16 19:08:49 +03:00
Pasi Kallinen b3c8acfeeb X11: Allow toggling mouse_support off
Prevents accidental mouse clicks on the map.
2018-10-16 18:09:54 +03:00
Pasi Kallinen ddf6d13fd1 X11: Don't reuse perm_invent window for picking an object
The core wants to reuse the permanent inventory window for choosing
an object from inventory, but the perm_invent window could be
hard to focus - it could even be on another display!

Instead, create a temporary new window from which the user can
pick an inventory item.
2018-10-16 17:39:45 +03:00
Pasi Kallinen 011dfee945 X11: Allocate menu translation tables only once
Also force free the menu entry widgets when non-perm-invent
window is popped down.
2018-10-15 18:38:41 +03:00
Pasi Kallinen b2d2521289 X11: Handle X errors via panic
This leaves a usable backtrace for debugging.
2018-10-13 15:07:27 +03:00
Pasi Kallinen d19a4ac590 Fix segfault in X11 perm_invent if it was partially obscured 2018-10-13 00:37:15 +03:00
Pasi Kallinen 9f2f232d99 X11: Allow bold attribute for menucolors 2018-10-12 20:46:19 +03:00
Pasi Kallinen 62234b871f X11: Remember perm_invent window geometry 2018-10-11 20:18:07 +03:00
Pasi Kallinen c09260d8f7 X11: Handle paged menu control keys
X11 doesn't do menu paging, so handle the select page, invert page,
and unselect page like selecting, inverting or unselecting all.
2018-10-11 18:07:56 +03:00
Pasi Kallinen bf81a981e3 X11: Mouse wheel scrolling in menus 2018-10-11 17:59:20 +03:00
Pasi Kallinen e48c61c06f X11: Menucolors
Replace the XawList with our own lists of labels and command widgets
to allow for menucolors. Supports only inverse line attribute for now.

Allow key translations to work with menus on Linux.
2018-10-10 21:50:23 +03:00
Pasi Kallinen 39d10d96df Prevent leash showing unseen monster as "it" 2018-09-22 15:55:26 +03:00
Pasi Kallinen e031800880 Use is_hole macro to check for trapdoors and holes 2018-09-15 17:57:57 +03:00
Pasi Kallinen adf070eb04 Use is_pit macro to check for (spiked) pit 2018-09-15 17:19:26 +03:00
Pasi Kallinen bd23a56f29 Update commented out perm_invent stuff 2018-09-15 11:29:13 +03:00
Pasi Kallinen e37087e999 Handle monsters inside the invocation area 2018-09-14 21:49:02 +03:00
Pasi Kallinen 97b2ba2e54 Mimics created by #wizgenesis blocked vision incorrectly 2018-09-14 21:07:08 +03:00
Pasi Kallinen b33b66aa29 Qt: Remember the tile and font size
The QT_TILEWIDTH and QT_TILEHEIGHT read from NetHack config file
override the remembered settings.
Also set the smallest tile size to 6x6
2018-09-12 18:43:10 +03:00
Pasi Kallinen c7c21c264e Remove unnecessary spaces from couple messages 2018-09-11 15:39:13 +03:00
Pasi Kallinen 8210f81618 fixes update 2018-09-10 21:33:41 +03:00
Pasi Kallinen 2ef07ad178 Qt4: Fix compile warning 2018-09-10 21:09:58 +03:00
Pasi Kallinen 249494c8ee Qt4 moc is moc-qt4
At least on my Debian, the Qt4 MOC is now called moc-qt4,
when it used to be just moc - probably due to Qt5 being moc-qt5
2018-09-10 21:06:37 +03:00
Pasi Kallinen 2122506ebe Spiders will occasionally spin webs
Idea and code inspired by aosdict
2018-09-07 20:26:18 +03:00
Pasi Kallinen 27d7f216c7 Split pickup checks out of dopickup 2018-09-01 20:45:51 +03:00
Pasi Kallinen 9e35a94097 Fix pickup awful hack
If pickup has been bound to some other key than ',', the awful hack
did not work correctly. Testing, I couldn't notice the difference,
but probably just not doing the right thing...
2018-09-01 20:15:19 +03:00
Pasi Kallinen d2eba695c8 Use DEADMONSTER instead of checking mhp 2018-08-30 20:05:18 +03:00
Pasi Kallinen 9457fde9fc Document windowcolors option 2018-08-29 19:39:30 +03:00
Pasi Kallinen 987516cedb Split string parsing and monster creation out of create_particular 2018-08-28 20:16:11 +03:00
Pasi Kallinen 599edde94d Fix monsters not wielding digging implements
My change to unify the pet and monster digging weapon choosing
made monsters not actually wield the chosen weapon, even though
they could still dig as if they did. Pets behaved properly.

Also add an explicit check for IS_STWALL so they won't keep
switching away from their current weapon until needed.
2018-08-28 18:15:46 +03:00
Pasi Kallinen bf10a70de0 Make it clear when a leprechaun dodges your attack
It was not obvious what was happening when a leprechaun dodged
your attack. Add a message to explicitly spell it out.
Code by aosdict.
2018-08-26 18:43:25 +03:00
Pasi Kallinen 43dc3bdf5f Hallu YAFM for stumbling onto an undetected monster
Pokemon reference. Based on an idea by aosdict.
2018-08-26 17:55:16 +03:00
Pasi Kallinen 6b79355494 Make wish prompts not remember the input
With EDIT_GETLIN, the wish prompt remembered the previous input,
but this isn't actually useful.
2018-08-26 12:18:16 +03:00
Pasi Kallinen f4057c2450 Allow defining file creation mask in hints file 2018-04-24 19:04:42 +03:00
Pasi Kallinen d5a0d846bf Mention boulder blocking path when traveling
...if mention_walls is on
2018-04-23 19:49:34 +03:00
Pasi Kallinen d0e2194036 Redraw screen after #wizintrinsics
Gaining monster detection requires redraw, possibly some others.
2018-04-21 13:28:27 +03:00
Pasi Kallinen 4a5115b417 Prevent hp-full or pw-full interrupt when running
The "You are in full health" and "You feel full of energy"
should only happen when repeating a command, not when running.
2018-04-20 23:35:59 +03:00
Pasi Kallinen d26fa16e5c Reorder #droptype menu and add some separators 2018-04-19 09:10:06 +03:00
Pasi Kallinen 22cc37ed61 How to create single-page Guidebook.txt 2018-04-10 18:19:45 +03:00
Pasi Kallinen 056a544f5a Missing word 2018-04-06 17:58:11 +03:00
Pasi Kallinen b87dfdbecd Guidebook: Just list the extended command
... the same way the extra key binds are listed just above.
2018-04-06 08:50:35 +03:00
Pasi Kallinen 095a00e0fc Guidebook: Move ladders into stairs section 2018-04-06 08:46:08 +03:00
Pasi Kallinen 57cadfd387 Capitalize NetHack correctly 2018-04-06 08:00:50 +03:00
Pasi Kallinen 4318aa8c04 Guidebook fix, 4 column dungeoneers 2018-04-03 20:41:53 +03:00
Pasi Kallinen c15546585a Update opthelp 2018-04-03 18:42:04 +03:00
Pasi Kallinen 98b0c8d4f0 More and more enums 2018-03-31 12:34:41 +03:00
Pasi Kallinen ebde14a6f9 Still more enums 2018-03-31 11:43:38 +03:00
Pasi Kallinen 9b7e146807 Use more enums 2018-03-31 08:57:22 +03:00