fix assumption

This commit is contained in:
Green Sky 2024-07-30 10:29:31 +02:00
parent e2c9880a15
commit 53d5229391
No known key found for this signature in database

View File

@ -448,9 +448,10 @@ bool ToxTransferManager::onToxEvent(const Tox_Event_Friend_Connection_Status* e)
std::vector<Object> to_destory;
_os.registry().view<ObjComp::Ephemeral::ToxTransferFriend>().each([&](const Object ov, const auto& ttf) {
assert(ttf.friend_number == friend_number);
to_destory.push_back(ov);
std::cerr << "TTM warning: friend disconnected, forcefully removing e:" << entt::to_integral(ov) << " frd:" << friend_number << " fnb:" << ttf.transfer_number << "\n";
if (ttf.friend_number == friend_number) {
to_destory.push_back(ov);
std::cerr << "TTM warning: friend disconnected, forcefully removing e:" << entt::to_integral(ov) << " frd:" << friend_number << " fnb:" << ttf.transfer_number << "\n";
}
});
for (const auto ov : to_destory) {