fix char range error in some envs

This commit is contained in:
Martin Michelsen
2022-08-09 16:59:35 -07:00
parent d006359f87
commit 25c68ef43c
+5 -1
View File
@@ -688,7 +688,11 @@ static HandlerResult process_server_60_62_6C_6D_C9_CB(shared_ptr<ServerState>,
true, cmd.area, cmd.x, cmd.z, cmd.request_id);
session.next_drop_item.clear();
return HandlerResult::Type::SUPPRESS;
} else if (data[0] == -0x5E) { // A2
// Note: This static_cast is required to make compilers not complain that
// the comparison is always false (which even happens in some environments
// if we use -0x5E... apparently char is unsigned on some systems, or
// std::string's char_type isn't char??)
} else if (static_cast<uint8_t>(data[0]) == 0xA2) {
const auto& cmd = check_size_t<G_BoxItemDropRequest_6xA2>(data);
session.next_drop_item.data.id = session.next_item_id++;
send_drop_item(session.server_channel, session.next_drop_item.data,