Browse Source

Use consts instead of hardcoded values

pull/25/head
Anders Jenbo 7 years ago
parent
commit
390c51f4fa
  1. 4
      Source/multi.cpp
  2. 2
      Source/nthread.cpp

4
Source/multi.cpp

@ -460,8 +460,8 @@ void __cdecl multi_process_network_packets()
multi_clear_left_tbl();
v1 = pkt;
v2 = pkt;
if ((unsigned int)len >= 0x13
&& *(_DWORD *)arglist < 4u
if ((unsigned int)len >= sizeof(TPktHdr)
&& *(_DWORD *)arglist < MAX_PLRS
&& pkt->wCheck == 'ip'
&& (unsigned short)pkt->wLen == len) {
v3 = *(_DWORD *)arglist;

2
Source/nthread.cpp

@ -116,7 +116,7 @@ int __fastcall nthread_recv_turns(int *pfSendAsync)
sgbPacketCountdown = byte_679704;
if (!hasCountedDown)
goto LABEL_11;
if (SNetReceiveTurns(0, 4, (char **)glpMsgTbl, (unsigned int *)gdwMsgLenTbl, (LPDWORD)player_state)) {
if (SNetReceiveTurns(0, MAX_PLRS, (char **)glpMsgTbl, (unsigned int *)gdwMsgLenTbl, (LPDWORD)player_state)) {
if (!byte_679758) {
byte_679758 = 1;
last_tick = GetTickCount();

Loading…
Cancel
Save