Fixed crash in packet_ordered_check_for_processing
This commit is contained in:
parent
f9c0e2cfe2
commit
44bbfb46a1
|
@ -24,8 +24,7 @@ static struct OrderedPacketTable* orderedPacketTable[MAX_PLAYERS] = { 0 };
|
||||||
u8 gAllowOrderedPacketClear = 1;
|
u8 gAllowOrderedPacketClear = 1;
|
||||||
|
|
||||||
static void packet_ordered_check_for_processing(struct OrderedPacketTable* opt) {
|
static void packet_ordered_check_for_processing(struct OrderedPacketTable* opt) {
|
||||||
// sanity check
|
if (!opt) { return; }
|
||||||
SOFT_ASSERT(opt != NULL);
|
|
||||||
|
|
||||||
struct OrderedPacketList* opl = opt->packets;
|
struct OrderedPacketList* opl = opt->packets;
|
||||||
struct OrderedPacketList* oplLast = opl;
|
struct OrderedPacketList* oplLast = opl;
|
||||||
|
@ -52,7 +51,7 @@ static void packet_ordered_check_for_processing(struct OrderedPacketTable* opt)
|
||||||
if (oplLast == opl) {
|
if (oplLast == opl) {
|
||||||
// we processed the head of the list
|
// we processed the head of the list
|
||||||
opt->packets = opl->next;
|
opt->packets = opl->next;
|
||||||
} else {
|
} else if (oplLast) {
|
||||||
// we processed from after the head
|
// we processed from after the head
|
||||||
oplLast->next = opl->next;
|
oplLast->next = opl->next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue