fix $where in the lobby
This commit is contained in:
+11
-7
@@ -2775,16 +2775,20 @@ ChatCommandDefinition cc_where(
|
|||||||
{"$where"},
|
{"$where"},
|
||||||
+[](const ServerArgs& a) -> void {
|
+[](const ServerArgs& a) -> void {
|
||||||
auto l = a.c->require_lobby();
|
auto l = a.c->require_lobby();
|
||||||
|
uint32_t floor = l->is_game() ? a.c->floor : 0x0F;
|
||||||
|
Episode episode = l->is_game() ? l->episode : Episode::EP1;
|
||||||
send_text_message_printf(a.c, "$C7%01" PRIX32 ":%s X:%" PRId32 " Z:%" PRId32,
|
send_text_message_printf(a.c, "$C7%01" PRIX32 ":%s X:%" PRId32 " Z:%" PRId32,
|
||||||
a.c->floor,
|
floor,
|
||||||
FloorDefinition::get(l->episode, a.c->floor).short_name,
|
FloorDefinition::get(episode, floor).short_name,
|
||||||
static_cast<int32_t>(a.c->pos.x.load()),
|
static_cast<int32_t>(a.c->pos.x.load()),
|
||||||
static_cast<int32_t>(a.c->pos.z.load()));
|
static_cast<int32_t>(a.c->pos.z.load()));
|
||||||
for (auto lc : l->clients) {
|
if (l->is_game()) {
|
||||||
if (lc && (lc != a.c)) {
|
for (auto lc : l->clients) {
|
||||||
string name = lc->character()->disp.name.decode(lc->language());
|
if (lc && (lc != a.c)) {
|
||||||
send_text_message_printf(a.c, "$C6%s$C7 %01" PRIX32 ":%s",
|
string name = lc->character()->disp.name.decode(lc->language());
|
||||||
name.c_str(), lc->floor, FloorDefinition::get(l->episode, lc->floor).short_name);
|
send_text_message_printf(a.c, "$C6%s$C7 %01" PRIX32 ":%s",
|
||||||
|
name.c_str(), lc->floor, FloorDefinition::get(l->episode, lc->floor).short_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user