Fix a bug in synchronous model similarity

This commit is contained in:
2021-12-21 15:22:26 -05:00
parent f2a20c0231
commit b4639c70db
5 changed files with 48 additions and 16 deletions

View File

@@ -169,6 +169,7 @@ void World::patch_luatabs(StreamBuffer *sb, DebugCollector *dbc) {
util::HashValue closehash = sb->read_hashvalue();
int ncreate = sb->read_int32();
util::IdVector closetans = get_near(actor_id, RadiusClose, true, false);
std::cerr << "Sync closetans=" << util::id_vector_debug_string(closetans) << std::endl;
assert(closehash == util::hash_id_vector(closetans));
number_lua_tables(closetans);
create_new_tables(ncreate);
@@ -183,6 +184,7 @@ void World::diff_luatabs(int64_t actor_id, World *master, StreamBuffer *xsb) {
// Calculate the set of close tangibles.
util::IdVector closetans = master->get_near(actor_id, RadiusClose, true, false);
std::cerr << "Master closetans=" << util::id_vector_debug_string(closetans) << std::endl;
assert(get_near(actor_id, RadiusClose, true, false) == closetans);
util::HashValue closehash = util::hash_id_vector(closetans);
@@ -281,6 +283,7 @@ void World::diff_tanclass(int64_t actor_id, World *master, StreamBuffer *xsb) {
void World::patch_source(StreamBuffer *sb, DebugCollector *dbc) {
DebugBlock dbb(dbc, "patch_source");
std::cerr << "Before PS ids=" << tangible_ids_debug_string() << std::endl;
bool modified = source_db_.patch(sb, dbc);
if (modified) {
std::string errs = source_db_.rebuild();
@@ -288,6 +291,7 @@ void World::patch_source(StreamBuffer *sb, DebugCollector *dbc) {
// TODO: I don't currently have any good place to send the
// error messages. This is a stopgap.
std::cerr << errs;
std::cerr << "After PS ids=" << tangible_ids_debug_string() << std::endl;
}
}