Minor changes to help players see each other

This commit is contained in:
2024-02-28 15:35:47 -05:00
parent 0c126e62d6
commit 4495ae7133
8 changed files with 25 additions and 15 deletions

View File

@@ -60,17 +60,19 @@ 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);
LuaVar tangibles, tanobj, classtab;
LuaExtStack LS(L, tangibles, tanobj, classtab);
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;
LS.rawget(tanobj, tangibles, id);
LS.tangetclass(classtab, tanobj);
eng::string cname = LS.classname(classtab);
AnimState state = tan->anim_queue_.get_final_persistent();
result << id << " (" << cname << "): " << state.debug_string() << std::endl;
}
return result.str();
}