AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   (OLD) Bug Reports (https://forums.alliedmods.net/forumdisplay.php?f=24)
-   -   [CORE] Small message_begin bug (https://forums.alliedmods.net/showthread.php?t=6942)

DS 10-19-2004 23:16

[CORE] Small message_begin bug
 
You can't send any messages with a destination of MSG_PVS_R or MSG_PAS_R. I realize such messages aren't commonly used, however, this should be supported since such messages are possible with the engine.

Anyways, the problem is with the switch statement that starts on line 1208 in amxmodx.cpp. There is no check at all for these message destinations. On line 1214, it checks for cases of MSG_PVS and MSG_PAS.

So that part of the code should really look like:

Code:

  case MSG_PVS: case MSG_PAS:
  case MSG_PVS_R: case MSG_PAS_R:
          if (numparam < 3) {
                  amx_RaiseError(amx,AMX_ERR_NATIVE);
                  return 0;
          }
          cpOrigin = get_amxaddr(amx,params[3]);
          vecOrigin[0] = *cpOrigin;
          vecOrigin[1] = *(cpOrigin+1);
          vecOrigin[2] = *(cpOrigin+2);
          MESSAGE_BEGIN( params[1], params[2] , vecOrigin );
          break;

That code should be executed for MSG_PVS_R and MSG_PAS_R besides the unreliable versions, as they too can pass an origin.

PM 10-20-2004 10:13

Thanks, fixed.


All times are GMT -4. The time now is 21:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.