Raised This Month: $12 Target: $400
 3% 

[CORE] Small message_begin bug


  
 
 
Thread Tools Display Modes
Author Message
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 10-19-2004 , 23:16   [CORE] Small message_begin bug
#1

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.
DS is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 10-20-2004 , 10:13  
#2

Thanks, fixed.
__________________
hello, i am pm
PM is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:00.


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