aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-24 11:15:50 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-24 11:15:50 +0200
commit452f24128791a27511fcebbff8fdecc4f3151d49 (patch)
tree8ff6dca0ecd5f4d01d2554b83d8235d4cc823e01 /src
parent9f4701efaa2167e915518f01ef9d61185377196d (diff)
downloadlanes-452f24128791a27511fcebbff8fdecc4f3151d49.tar.gz
lanes-452f24128791a27511fcebbff8fdecc4f3151d49.tar.bz2
lanes-452f24128791a27511fcebbff8fdecc4f3151d49.zip
Fix wrong Linda name when not giving any
Diffstat (limited to 'src')
-rw-r--r--src/keeper.cpp10
-rw-r--r--src/lindafactory.cpp2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp
index cdbfac9..8261f5a 100644
--- a/src/keeper.cpp
+++ b/src/keeper.cpp
@@ -656,6 +656,16 @@ void Keeper::operator delete[](void* p_, Universe* U_)
656// ################################################################################################# 656// #################################################################################################
657 657
658// only used by linda:dump() and linda:__towatch() for debugging purposes 658// only used by linda:dump() and linda:__towatch() for debugging purposes
659// table is populated as follows:
660// {
661// [<key>] = {
662// first = <n>,
663// count = <n>,
664// limit = <n> | 'unlimited',
665// fifo = { <array of values> }
666// }
667// ...
668// }
659int Keeper::PushLindaStorage(Linda& linda_, DestState const L_) 669int Keeper::PushLindaStorage(Linda& linda_, DestState const L_)
660{ 670{
661 Keeper* const _keeper{ linda_.whichKeeper() }; 671 Keeper* const _keeper{ linda_.whichKeeper() };
diff --git a/src/lindafactory.cpp b/src/lindafactory.cpp
index d5ebc9b..771a4c3 100644
--- a/src/lindafactory.cpp
+++ b/src/lindafactory.cpp
@@ -105,7 +105,7 @@ std::string_view LindaFactory::moduleName() const
105DeepPrelude* LindaFactory::newDeepObjectInternal(lua_State* const L_) const 105DeepPrelude* LindaFactory::newDeepObjectInternal(lua_State* const L_) const
106{ 106{
107 // we always expect name and group at the bottom of the stack (either can be nil). any extra stuff we ignore and keep unmodified 107 // we always expect name and group at the bottom of the stack (either can be nil). any extra stuff we ignore and keep unmodified
108 std::string_view _linda_name{ luaG_tostring(L_, 1) }; 108 std::string_view _linda_name{ lua_isnil(L_, 1) ? "" : luaG_tostring(L_, 1) };
109 LindaGroup _linda_group{ static_cast<int>(lua_tointeger(L_, 2)) }; 109 LindaGroup _linda_group{ static_cast<int>(lua_tointeger(L_, 2)) };
110 110
111 // store in the linda the location of the script that created it 111 // store in the linda the location of the script that created it