Some more error checking for class names and tangible IDs

This commit is contained in:
2024-02-28 14:19:59 -05:00
parent 32dae0df5a
commit 0c126e62d6
8 changed files with 77 additions and 21 deletions

View File

@@ -58,11 +58,17 @@ eng::string World::tangible_ids_debug_string() const {
}
eng::string World::tangibles_near_debug_string(int64_t actor, int64_t distance) {
assert(stack_is_clear());
lua_State *L = state();
LuaVar tangibles, database, mt;
LuaExtStack LS(L, tangibles, database);
LS.rawget(tangibles, LuaRegistry, "tangibles");
eng::ostringstream result;
util::IdVector tans;
get_near(actor, distance, true, false, true, &tans);
for (int64_t id : tans) {
const Tangible *tan = tangible_get(id);
LS.rawget(database, tangibles, id);
AnimState state = tan->anim_queue_.get_final_everything();
result << id << ": " << state.debug_string() << std::endl;
}