Commit Graph

23 Commits

Author SHA1 Message Date
Patric Mueller
7d15535923 Fix always trapped castle chest 2018-12-15 22:40:30 +01:00
PatR
5d2686e7c1 lev_comp int vs long
Fix lev_comp's variable argument usage by changing it to make
add_opvars() expect an int rather than a long when given the "i"
indicator, and add "l" for really passing a long.  The ints are
conveted to longs when setting up the interpreter.  I think I changed
just about all the integer opvars to int, although there is one use
of "l" in lev_main.c just to make sure it works.  There could be
arguments that really do need to be 'long'; if so, the add_opvars()
calls for them will have to have its indicator string updated and
possibly add or remove some casts.

There's a lot of reformatting included but it's not consistent about
tab replacement.  Some of the changes are due to renaming long-named
'variable_definitions' to 'vardefs' to shorten a bunch of lines.

Updated sys/share/*_yacc.c will be checked in separately.  The ones
currently in the repository won't work with patched lev_main.c due to
that renamed variable.
2018-11-27 18:21:58 -08:00
PatR
ba7fbb6e8b lev_comp lint redux
The rest of this accidentally got pushed with the Reaper Man passages.
2016-02-17 14:08:19 -08:00
PatR
25d18ddeb8 lev_comp lint 2016-02-17 13:45:05 -08:00
PatR
7482be39e8 lev_comp update for older Unix system
Increase the lex paramaters in lev_comp.l and replace use of snprintf
with sprintf in lev_comp.y and lev_main.c.

Also some reformatting for lev_comp.y, but I gave up pretty quickly:
some early tab replacement and adjusting of the spacing for casts.
2016-01-19 16:27:39 -08:00
PatR
63dc6b3a31 lev_main cleanup
Use an alternate fix for the complaint from clang's static analyzer
(about potentially derefencing a null pointer, which can't happen
here because alloc() panics and quits rather than return Null), plus
some reformatting and removal of a chunk of unused code (strncmpi).

Also a formatting bit for lev_comp.y, making sys/share/lev_yacc.c
be out of date.  However, the generated code will be the same--except
for line numbers--so this shouldn't inhibit anybody's planned testing
waiting for the generated copy to be updated.
2015-11-20 18:58:48 -08:00
Pasi Kallinen
b0e4357c32 Fix lev_comp memory leaks 2015-11-01 00:28:28 +02:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
b8bea3af20 Make the wand of wishing chest immune to trapping
This eliminates a source of very random, unpreventable frustration to
players.
2015-05-24 11:12:41 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
Pasi Kallinen
b234c7032f Make the Valley have slight variations 2015-05-02 18:29:35 +03:00
PatR
71d7eff0a7 revisit variable arguments in new lev_comp
The previous USE_OLDARGS worked with gcc on Intel, but was inherently
unsafe.  This method is completely safe, just obnoxiously intrusive.
It you disliked debugpline*(), you're bound to hate this....
2015-04-10 01:39:55 -07:00
PatR
9072e80085 support pre-ansi varargs in new lev_comp
Remove the requirement for <stdarg.h> that was introduced to lev_comp.
USE_STDARG still works.  USE_OLDARGS required hackery but has been
tested and actually works, although I wouldn't trust it on platforms
where 'long' and 'char *' aren't the same size.  USE_VARARGS didn't
require any hackery--aside from the conversion to core's pline code--
but has not been tested:  <varargs.h> supplied with OSX won't compile,
with an #error directive that basically says "switch to <stdarg.h>".

I changed several printf formats of %i and %li to %d and %ld because
I'm not sure how widespread the 'i' variant was back in days of yore.
[TODO:  avoid use of snprintf since pre-ANSI systems won't have it.]
2015-04-09 03:09:00 -07:00
Pasi Kallinen
47bb9abace New level compiler: code changes 2015-03-17 18:52:42 +02:00
keni
25cd007c48 Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-03-17 18:45:12 +02:00
keni
4036a6727c Add RCS version lines 2009-05-06 10:55:43 +00:00
nethack.rankin
4c83db0294 fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
From a bug report, when ice on the Valkyrie
quest home level was melted and a boulder filled the resulting pool, that
pool was described as a moat.  This was actually a terrain issue rather
than a formatting glitch, so instead of tweaking waterbody_name() with an
extra special case, extend the level compiler to allow specifying ice as
frozen pool instead of always being frozen moat.  There's no provision
for having both types of ice on the same level, just a level-wide flag to
control which of the two applies for ice on that level.

     This change has a side-effect for the V quest levels:  once ice has
been melted, a second blast of fire will now boil away the pool and leave
a pit.  The unfrozen water locations on the home level already behaved
that way (ie, they are pools rather than moats) so this should be ok.  I
also added <Someone>'s suggestion to make one of the two drawbridges
on the goal level start in random state instead of always being open.
2007-08-03 01:05:50 +00:00
nethack.rankin
9e7d032c79 random initial drawbridge state (trunk only)
Suggested by <Someone>:  in the special level compiler, support
"random" in addition to "open" and "closed" for a drawbridge's inital
state.  Drawbridge shares code with door, so the necessary parsing was
already present.  This just treats random as valid for drawbridge instead
of explicitly rejecting it, and makes the special level loader process it.

     He also suggested that the two drawbridges on the bottom level of
the Valk's quest be changed from open to random, but this patch doesn't
go that far.  I think it's a good idea, but since the player can't use a
musicial instrument on those bridges, this has more impact on game play
than it might at first seem.  I don't really want to see Valkyries be
required to use magic for occasions where both bridges start out closed.
2007-04-21 01:54:56 +00:00
nethack.allison
e9b022d579 housekeeping: mark trunk sources 3.5 (misc) 2005-01-02 17:21:18 +00:00
cohrs
14c12765a0 U433 - infinite loop with place_branch
This solution is mostly a band-aid.  Make sure information set by join_map
that is overlaid by the MAP is cleared out.  This ensures that place_branch
will never consider invalid data.  A new function, remove_rooms(), with a
helper, remove_room(), takes care of this, but only for rooms created by
join_map, which addresses the only known case that causes this problem.
There's a possibility that some other strange behavior, especially in
minetn-6, will be fixed by this as well.  The problem of disconnected caves
on minetn-6 is not yet addressed.

Also, add a check to lev_comp.y to make sure the required fg semantics of
joined levels (fg must be ROOM or CORR) are actually met.  Doesn't affect
any levels currently included in the distro, but might address levels
others are trying to make.
2003-05-20 02:05:45 +00:00
cohrs
5d530348d4 containers and objects in special level descriptions
On mazelike levels, containers had to be listed before their objects.  But,
for roomfilled levels, containers had to be listed _after_ the objects.  All
our current levels that use containers with objects are mazelike, so I
changed the room behavior, updating the comment in lev_comp.y to match.
Other items/monsters are still processed in reverse on roomfilled special
levels, but I think this is OK.
2002-07-14 20:17:45 +00:00
nethack.allison
742e1e8c90 3.3.2 to 3.4.0 2002-02-04 16:11:00 +00:00
jwalz
17f3520f52 *** empty log message *** 2002-01-05 21:06:00 +00:00