Change the creation/deletion of tangibles so that the tangible database is never really deleted.
This commit is contained in:
@@ -55,14 +55,11 @@ eng::string World::tangible_pprint(int64_t id) const {
|
||||
LS.rawget(tan, tangibles, id);
|
||||
eng::ostringstream oss;
|
||||
if (LS.istable(tan)) {
|
||||
LS.getmetatable(meta, tan);
|
||||
LS.clearmetatable(tan);
|
||||
PrettyPrintOptions opts;
|
||||
opts.indent = false;
|
||||
pprint(LS, tan, opts, &oss);
|
||||
LS.setmetatable(tan, meta);
|
||||
} else {
|
||||
oss << "<no such tangible: " << id << ">";
|
||||
oss << "<no such tangible " << id << ">{}";
|
||||
}
|
||||
LS.result();
|
||||
return oss.str();
|
||||
@@ -384,7 +381,7 @@ LuaDefine(unittests_world3diffluatab, "", "some unit tests") {
|
||||
|
||||
// The data in the master model should now look like this:
|
||||
const char *expect_123 =
|
||||
"{ "
|
||||
"<tangible 123>{ "
|
||||
"bacon='crispy', "
|
||||
"inventory={ gold='wealthy' }, "
|
||||
"skills={ "
|
||||
@@ -393,7 +390,7 @@ LuaDefine(unittests_world3diffluatab, "", "some unit tests") {
|
||||
"} "
|
||||
"}";
|
||||
const char *expect_345 =
|
||||
"{ "
|
||||
"<tangible 345>{ "
|
||||
"inventory={ gold='poor' }, "
|
||||
"phone='867-5309' "
|
||||
"}";
|
||||
|
||||
Reference in New Issue
Block a user