diff options
| -rw-r--r-- | src/tools.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/tools.c b/src/tools.c index 3a19605..9a1c19d 100644 --- a/src/tools.c +++ b/src/tools.c | |||
| @@ -1392,10 +1392,26 @@ static void push_cached_func( struct s_Universe* U, lua_State* L2, uint_t L2_cac | |||
| 1392 | static bool_t inter_copy_one_( struct s_Universe* U, lua_State* L2, uint_t L2_cache_i, lua_State* L, uint_t i, enum e_vt vt, enum eLookupMode mode_, char const* upName_) | 1392 | static bool_t inter_copy_one_( struct s_Universe* U, lua_State* L2, uint_t L2_cache_i, lua_State* L, uint_t i, enum e_vt vt, enum eLookupMode mode_, char const* upName_) |
| 1393 | { | 1393 | { |
| 1394 | bool_t ret = TRUE; | 1394 | bool_t ret = TRUE; |
| 1395 | bool_t ignore = FALSE; | ||
| 1395 | STACK_GROW( L2, 1); | 1396 | STACK_GROW( L2, 1); |
| 1396 | STACK_CHECK( L2); | 1397 | STACK_CHECK( L2); |
| 1397 | 1398 | ||
| 1398 | switch( lua_type( L, i)) | 1399 | /* Skip the object if it has metatable with { __lanesignore = true } */ |
| 1400 | if( lua_getmetatable( L, i)) // ... mt | ||
| 1401 | { | ||
| 1402 | lua_pushstring( L, "__lanesignore"); // ... mt "__lanesignore" | ||
| 1403 | lua_gettable( L, -2); // ... mt ignore? | ||
| 1404 | |||
| 1405 | if( lua_isboolean( L, -1) && lua_toboolean( L, -1)) | ||
| 1406 | { | ||
| 1407 | ignore = TRUE; | ||
| 1408 | } | ||
| 1409 | |||
| 1410 | lua_pop( L, 2); // ... | ||
| 1411 | } | ||
| 1412 | |||
| 1413 | /* Lets push nil to L2 if the object should be ignored */ | ||
| 1414 | switch( ignore ? LUA_TNIL : lua_type( L, i)) | ||
| 1399 | { | 1415 | { |
| 1400 | /* Basic types allowed both as values, and as table keys */ | 1416 | /* Basic types allowed both as values, and as table keys */ |
| 1401 | 1417 | ||
