View Single Post
Author Message
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 02-04-2004 , 13:00   Bug with reading big messages in AMX
Reply With Quote #1

Dunno if this is the right place to post this, but I can't see a better place.

There is a bug with registering messages in Olo's version of amx. If the message which is being read has too many values then the server will crash. This problem appears with the Natural-Selection mod as there is a few messages which have more than the 32 values in them (the biggest I've seen is 54).

The simple solution is to increase the size of the array in CEvent.h line 34:

#define MAX_PARSE_VALUES 32

64 should be fine. Although if you can be bothered it'd be a good idea to make sure it doesn't crash in CEvent.cpp line 223:

Code:
void EventsMngr::parseValue(int iValue) {
  if ( !parseNotDone ) return;
  parseVault[++parsePos].type = MSG_INTEGER;
  parseVault[parsePos].iValue = iValue;
  bool skip;
  for (ClEvent*p=parseFun;p;p=p->next){
    if ( p->done || !p->cond[parsePos] ) continue;
    skip = false;
	ClEvent::cond_t* a = p->cond[parsePos];
	do {
      switch(a->type){               <-- CRASH here
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline