From: Daniel Karbach Date: Thu, 17 Sep 2015 15:47:20 +0000 (+0200) Subject: fixed old packet acks X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=8e7e042296946ba2aed73b77ab02feb267eb17d4;p=blank.git fixed old packet acks yeah, backwards is backwards -.- --- diff --git a/src/net/Packet.hpp b/src/net/Packet.hpp index c4a8ae3..87decec 100644 --- a/src/net/Packet.hpp +++ b/src/net/Packet.hpp @@ -26,7 +26,7 @@ struct Packet { // true if this contains an ack for given (remote) seq bool Acks(std::uint16_t) const noexcept; std::uint16_t AckBegin() const noexcept { return ack; } - std::uint16_t AckEnd() const noexcept { return ack + std::uint16_t(33); } + std::uint16_t AckEnd() const noexcept { return ack - std::uint16_t(33); } }; struct Header { diff --git a/src/net/net.cpp b/src/net/net.cpp index 6bd561c..4ad663e 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -462,7 +462,7 @@ void Connection::Received(const UDPpacket &udp_pack) { } } // check for newly ack'd packets - for (uint16_t s = ctrl_new.AckBegin(); s != ctrl_new.AckEnd(); ++s) { + for (uint16_t s = ctrl_new.AckBegin(); s != ctrl_new.AckEnd(); --s) { if (ctrl_new.Acks(s) && !ctrl_in.Acks(s)) { Handler().OnPacketReceived(s); }