Commit Graph
11 Commits
Author SHA1 Message Date
SHIRAKATA Kentaro b87dd4423b remove redundant code
The values of lx and ly are always assigned just before their usage.
So, assignments in advance are redundant.
2022-02-05 20:31:17 +09:00
SHIRAKATA Kentaro cf810630de add missing const
If you want to declare a pointer which the address pointed to is constant,
you should declare it as like `static const char *const var = "...";`.

This commit supplies missing `const` and prevents some programming
error in the future.
2022-01-29 11:13:01 -08:00
SHIRAKATA Kentaro a2a40c6b0b fix typo in Guidebook.tex 2022-01-10 21:36:16 +09:00
SHIRAKATA Kentaro 546377581a use %d for short
obj->otyp is short, so corresponding format string is %d.

(from Coverity Scan)
2021-11-24 06:30:00 +09:00
SHIRAKATA Kentaro bfd79f5c9d use %lu for unsigned long
`curr->tid` is unsigned long, so use `%lu`.
2021-10-23 01:07:40 +09:00
SHIRAKATA Kentaro 62e6b5a336 guard lua_close()
nhl_done() can be called with L == NULL.
So lua_close() should be guarded.
2021-10-22 02:13:17 +09:00
SHIRAKATA Kentaro 1f651f8f00 initialize attknum
`attknum` is declared without initialization, and is used on
find_roll_to_hit().  This leads unexpected result.
2021-10-21 08:48:23 -04:00
SHIRAKATA Kentaro 0f36d7ac6e revert MAX_RADIUS change
On 59818fb, MAX_RADIUS was changed from 15 to 16 to intend to support
"radius 0".  But MAX_RADIUS doesn't means the range but outer bound of
the radius table, so it should not be changed, and this change led
possible out-of-bound access on view_from() and do_clear_area() in
vision.c.

This commit reverts the change and avoids the problem.
2021-10-21 08:48:23 -04:00
SHIRAKATA Kentaro ed543d7832 fix pointer precedence 2021-10-21 17:41:13 +09:00
SHIRAKATA Kentaro 96679152ef Supply missing changes
Some changes applied to Guidebook.mn were not applied to Guidebook.tex.
This commit supplies them.
2021-09-25 23:28:16 +09:00
SHIRAKATA Kentaro 83c626b707 delete extra lines 2021-09-23 03:30:57 +09:00