Implement SetActorRot(x,y,z,TRUE) and IsActorTurning.

This commit is contained in:
Daniel Schepler 2003-08-22 11:37:39 +00:00
parent b57b823c2b
commit b18077ac5d
3 changed files with 51 additions and 9 deletions

12
lua.cpp
View file

@ -273,7 +273,10 @@ static void SetActorRot() {
float pitch = luaL_check_number(2);
float yaw = luaL_check_number(3);
float roll = luaL_check_number(4);
act->setRot(pitch, yaw, roll);
if (getbool(5))
act->turnTo(pitch, yaw, roll);
else
act->setRot(pitch, yaw, roll);
}
static void GetActorRot() {
@ -283,6 +286,11 @@ static void GetActorRot() {
lua_pushnumber(act->roll());
}
static void IsActorTurning() {
Actor *act = check_actor(1);
pushbool(act->isTurning());
}
static void GetAngleBetweenActors() {
Actor *act1 = check_actor(1);
Actor *act2 = check_actor(2);
@ -949,7 +957,6 @@ static char *stubFuncs[] = {
"IsActorResting",
"IsActorMoving",
"CompleteActorChore",
"IsActorTurning",
"SetActorRoll",
"SetActorPitch",
"GetPointSector",
@ -1182,6 +1189,7 @@ struct luaL_reg builtins[] = {
{ "GetActorPos", GetActorPos },
{ "SetActorRot", SetActorRot },
{ "GetActorRot", GetActorRot },
{ "IsActorTurning", IsActorTurning },
{ "GetAngleBetweenActors", GetAngleBetweenActors },
{ "PutActorInSet", PutActorInSet },
{ "SetActorWalkRate", SetActorWalkRate },