Permalink
Browse files

jump.setKnown() setting known by default seems saner than removing.

  • Loading branch information...
1 parent b5f5c4d commit 29e7f9309784867cde9685806bf8f82b3997b666 @Deiz Deiz committed Apr 9, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/nlua_jump.c
View
@@ -435,7 +435,7 @@ static int jumpL_isKnown( lua_State *L )
*
* @usage j:setKnown( false ) -- Makes jump unknown.
* @luaparam j Jump to set known.
- * @luaparam b Whether or not to set as known (defaults to false).
+ * @luaparam b Whether or not to set as known (defaults to true).
* @luafunc setKnown( j, b )
*/
static int jumpL_setKnown( lua_State *L )
@@ -444,7 +444,12 @@ static int jumpL_setKnown( lua_State *L )
JumpPoint *jp;
jp = luaL_validjumpSystem(L, 1, &offset, NULL);
- b = lua_toboolean(L, 1 + offset);
+
+ /* True is boolean isn't supplied. */
+ if (lua_gettop(L) > offset )
+ b = lua_toboolean(L, 1 + offset);
+ else
+ b = 1;
if (b)
jp_setFlag( jp, JP_KNOWN );

0 comments on commit 29e7f93

Please sign in to comment.