e_event_actorstartshoot.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 "../../../../renderer/r_mesh_anim.h"
00028 #include "e_event_actorstartshoot.h"
00029
00030 int CL_ActorStartShootTime (const eventRegister_t *self, struct dbuffer *msg, const int dt)
00031 {
00032 #if 0
00033 nextTime += 300;
00034 shootTime = nextTime;
00035 #else
00036 return cl.time;
00037 #endif
00038 }
00039
00050 void CL_ActorStartShoot (const eventRegister_t *self, struct dbuffer *msg)
00051 {
00052 le_t *le;
00053 pos3_t from, target;
00054 int entnum;
00055 shoot_types_t shootType;
00056
00057 NET_ReadFormat(msg, self->formatString, &entnum, &shootType, &from, &target);
00058
00059
00060 le = LE_Get(entnum);
00061
00062
00063 if (cl.actTeam != cls.team)
00064 CL_CameraRoute(from, target);
00065
00066
00067 if (!le)
00068
00069 return;
00070
00071 if (!LE_IsLivingActor(le) || LE_IsStunned(le)) {
00072 Com_Printf("CL_ActorStartShoot: LE (%i) not a living actor (type: %i)\n", entnum, le->type);
00073 return;
00074 }
00075
00076
00077 if (le->type == ET_ACTORHIDDEN)
00078 return;
00079
00080
00081 if (IS_SHOT_RIGHT(shootType)) {
00082 R_AnimChange(&le->as, le->model1, LE_GetAnim("move", le->right, le->left, le->state));
00083 } else if (IS_SHOT_LEFT(shootType)) {
00084 R_AnimChange(&le->as, le->model1, LE_GetAnim("move", le->left, le->right, le->state));
00085 } else if (!IS_SHOT_HEADGEAR(shootType)) {
00086
00087 Com_Error(ERR_DROP, "CL_ActorStartShoot: Invalid shootType given (entnum: %i, shootType: %i).\n", shootType, entnum);
00088 }
00089 }