Subversion Repositories WoWGM

Rev

Rev 15 | Rev 22 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 19
Line 28... Line 28...
28
{
28
{
29
	char string[256];
29
	char string[256];
30
	SStrCopy(string, arguments, 0xffffffff);
30
	SStrCopy(string, arguments, 0xffffffff);
31
	char *token = 0;
31
	char *token = 0;
32
	token = strtok(string, " \t");
32
	token = strtok(string, " \t");
33
	int itemId = atoi(token);
33
	int itemId = SStrToInt(token);
34
	int quantity = 1;
34
	int quantity = 1;
35
	if (token = strtok(NULL, "\r\n")) {
35
	if (token = strtok(NULL, "\r\n")) {
36
		quantity = atoi(token);
36
		quantity = SStrToInt(token);
37
	}
37
	}
38
	CDataStore msg;
38
	CDataStore msg;
39
	msg.Put(CMSG_CREATEITEM);
39
	msg.Put(CMSG_CREATEITEM);
40
	msg.Put(itemId);
40
	msg.Put(itemId);
41
	msg.Put(quantity);
41
	msg.Put(quantity);
Line 47... Line 47...
47
//===========================================================================
47
//===========================================================================
48
BOOL CCommand_Learn(const char* command, const char* arguments)
48
BOOL CCommand_Learn(const char* command, const char* arguments)
49
{
49
{
50
	int spellId = 0;
50
	int spellId = 0;
51
	if (isdigit(*arguments)) {
51
	if (isdigit(*arguments)) {
52
		spellId = atoi(arguments);
52
		spellId = SStrToInt(arguments);
53
		if (spellId <= 0) {
53
		if (spellId <= 0) {
54
			return TRUE;
54
			return TRUE;
55
		}
55
		}
56
	}
56
	}
57
	else {
57
	else {