REQUEST: /face heading fix`

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

REQUEST: /face heading fix`

Post by fwiggles » Sat Sep 20, 2003 11:12 am

/face heading works correct however it works like a /face fast. I was curious if anyone with some coding skills could make it work like a normal /face. I am looking through the code and i found the command...but i still lack the ability to fix it =P thanks. Oh, and just to save some time, here is the /face heading code i believe.

Code: Select all

	} else if (!stricmp(Arg1, "heading")) {
		if (Arg2[0]==0) {
			WriteChatBuffer("Face: heading specified but angle not found.",CONCOLOR_RED);
			strcpy(gLastError,"FACE_BADCOMMAND");
			return;
		}
		FLOAT Heading = (FLOAT)(atof(Arg2));
		while (Heading>=360.0f) Heading -= 360.0f;
		while (Heading<0.0f) Heading += 360.0f;
		pChar->Heading = Heading/0.703125f;
		return;
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Tue Sep 30, 2003 4:32 pm

This is not fully tested but if I understand the rest of the face command, the following change will allow a /face fast heading xxx to work the way /face heading xxx used to and makes /face heading xxx turn more slowly the way the normal /face command does.

Code: Select all

[color=red]	} else if (!stricmp(Arg1, "heading")) {
		if (Arg2[0]==0) {
			WriteChatBuffer("Face: heading specified but angle not found.",CONCOLOR_RED);
			strcpy(gLastError,"FACE_BADCOMMAND");
			return;
		}
		FLOAT Heading = (FLOAT)(atof(Arg2));
		while (Heading>=360.0f) Heading -= 360.0f;
		while (Heading<0.0f) Heading += 360.0f;[/color]
		gFaceAngle = Heading/0.703125f;
		if (Fast) {
			pChar->Heading = (FLOAT)gFaceAngle;
			gFaceAngle=10000.0f;
			bRunNextCommand = TRUE;
		}[color=red]
		return;
[/color]

FrankJScott
naggy
naggy
Posts: 2384
Joined: Sun Feb 19, 2023 7:11 am

High Rated Interior Design Details

Post by FrankJScott » Thu Aug 10, 2023 10:08 pm

Why don't you Google it! before you post