e_event_actorturn.c
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "../../../../client.h"
00026 #include "../../../cl_localentity.h"
00027 #include "e_event_actorturn.h"
00028
00034 void CL_ActorDoTurn (const eventRegister_t *self, struct dbuffer *msg)
00035 {
00036 le_t *le;
00037 int entnum, dir;
00038
00039 NET_ReadFormat(msg, self->formatString, &entnum, &dir);
00040
00041
00042 le = LE_Get(entnum);
00043 if (!le)
00044 LE_NotFoundError(entnum);
00045
00046 if (!LE_IsActor(le))
00047 Com_Error(ERR_DROP, "Can't turn, LE doesn't exist or is not an actor (number: %i, type: %i)\n",
00048 entnum, le->type);
00049
00050 if (LE_IsDead(le))
00051 Com_Error(ERR_DROP, "Can't turn, actor dead\n");
00052
00053 le->dir = dir;
00054 le->angles[YAW] = directionAngles[le->dir];
00055 }