BUG: $target(sclass) does not work.

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

User avatar
Schark
orc pawn
orc pawn
Posts: 28
Joined: Sat Nov 29, 2003 5:37 am

BUG: $target(sclass) does not work.

Post by Schark » Mon Dec 15, 2003 12:46 pm

BUG: $target(sclass) does not work.

SOLUTION: Change

Code: Select all

} else if (!strncmp("$target(sclass)",szVar,13)) {
	i+=12;
to

Code: Select all

} else if (!strncmp("target(sclass)",szVar,14)) {
	i+=13;
in MQ2Parms.cpp

BUG: $spawn(id,sclass) returns the long class name.

SOLUTION: Change the function FullClassToShort() in MQ2Parms.cpp into something like this:

Code: Select all

DWORD FullClassToShort(CHAR* szClass) {
	if (!strnicmp(szClass, "Warrior", 7)) {
        strcpy(szClass,"WAR");
	} else if (!strnicmp(szClass, "Wizard", 6)) {
        strcpy(szClass,"WIZ");
	} else if (!strnicmp(szClass, "Shadow Knight", 13)) {
        strcpy(szClass,"SHD");
	} else if (!strnicmp(szClass, "Magician", 8)) {
        strcpy(szClass,"MAG");
	} else if (!strnicmp(szClass, "Enchanter", 9)) {
        strcpy(szClass,"ENC");
	} else if (!strnicmp(szClass, "Necromancer", 11)) {
        strcpy(szClass,"NEC");
	} else if (!strnicmp(szClass, "Cleric", 6)) {
        strcpy(szClass,"CLR");
	} else if (!strnicmp(szClass, "Druid", 5)) {
        strcpy(szClass,"DRU");
	} else if (!strnicmp(szClass, "Shaman", 6)) {
        strcpy(szClass,"SHM");
	} else if (!strnicmp(szClass, "Beastlord", 9)) {
        strcpy(szClass,"BST");
	} else if (!strnicmp(szClass, "Paladin", 7)) {
        strcpy(szClass,"PAL");
	} else if (!strnicmp(szClass, "Bard", 4)) {
        strcpy(szClass,"BRD");
	} else if (!strnicmp(szClass, "Monk", 4)) {
        strcpy(szClass,"MNK");
	} else if (!strnicmp(szClass, "Ranger", 6)) {
        strcpy(szClass,"RNG");
	} else if (!strnicmp(szClass, "Rogue", 5)) {
		strcpy(szClass,"ROG");
	} else {
		strcpy(szClass,"UNK");
	}
    return 3;
}
I hope someone with CVS access will look into this :)

Thanks!

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Mon Dec 15, 2003 2:21 pm

CVS'd -- thanks!

(Note: Added Merchant to the list of classes for FullClassToShort)

User avatar
Schark
orc pawn
orc pawn
Posts: 28
Joined: Sat Nov 29, 2003 5:37 am

Post by Schark » Mon Dec 15, 2003 2:26 pm

Thanks! :)