diff options
-rw-r--r-- | src/tools.cpp | 2 | ||||
-rw-r--r-- | src/universe.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools.cpp b/src/tools.cpp index 89e5499..52c70bc 100644 --- a/src/tools.cpp +++ b/src/tools.cpp | |||
@@ -632,7 +632,7 @@ static lua_Integer get_mt_id( Universe* U, lua_State* L, int i) | |||
632 | 632 | ||
633 | if( id == 0) | 633 | if( id == 0) |
634 | { | 634 | { |
635 | id = U->last_mt_id.fetch_add(1, std::memory_order_relaxed); | 635 | id = U->next_mt_id.fetch_add(1, std::memory_order_relaxed); |
636 | 636 | ||
637 | /* Create two-way references: id_uint <-> table | 637 | /* Create two-way references: id_uint <-> table |
638 | */ | 638 | */ |
diff --git a/src/universe.h b/src/universe.h index 3aac20d..bb3ebdd 100644 --- a/src/universe.h +++ b/src/universe.h | |||
@@ -154,7 +154,7 @@ struct Universe | |||
154 | // require() serialization | 154 | // require() serialization |
155 | std::recursive_mutex require_cs; | 155 | std::recursive_mutex require_cs; |
156 | 156 | ||
157 | std::atomic<lua_Integer> last_mt_id{ 0 }; | 157 | std::atomic<lua_Integer> next_mt_id{ 1 }; |
158 | 158 | ||
159 | #if USE_DEBUG_SPEW() | 159 | #if USE_DEBUG_SPEW() |
160 | int debugspew_indent_depth{ 0 }; | 160 | int debugspew_indent_depth{ 0 }; |