Jump to content

Error code in instance.c ?


cwgxcqwr

Recommended Posts


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   1
  • Joined:  08/23/13
  • Last Seen:  

source


int instance_create{
...
	// Searching a Free Instance
	// 0 is ignored as this mean "no instance" on maps
	ARR_FIND(1, MAX_INSTANCE_DB, i, instance_data[i].state == INSTANCE_FREE);
	if( i >= MAX_INSTANCE_DB )
		return -4;
...
}

 

I think the MAX_INSTANCE_DB should be replaced by MAX_INSTANCE_DATA

because size of instance_data can be found in instance.h.

extern struct instance_data instance_data[MAX_INSTANCE_DATA];

 

 

 

Edited by cwgxcqwr
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

It's using MAX_INSTANCE_DB because only X amount of instances can be created. Also, it cycles through, instance_db.txt to check to see if the name given in the instance_create command, actually exists. Hence the reason for using it.

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

Fixed in 5bdb25e.

Link to comment
Share on other sites

×
×
  • Create New...